/* ====================================
   MOBILOSOFT DOCUMENTATION - STYLES
   ==================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #7c3aed;
    --secondary-light: #ede9fe;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --dark: #f8fafc;
    --dark-light: #e2e8f0;
    --light: #0f172a;
    --border: #334155;
    --gray: #94a3b8;
    --gray-light: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.7;
    font-size: 16px;
}

/* ====================================
   SCROLLBAR
   ==================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* ====================================
   NAVIGATION SIDEBAR
   ==================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, var(--dark) 0%, #0f172a 100%);
    padding: 25px;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    text-align: center;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 25px;
}

.sidebar-logo {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.sidebar-title {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-version {
    color: var(--gray-light);
    font-size: 0.85rem;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section-title {
    color: var(--primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: 700;
    padding-left: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.15);
    color: white;
    border-left-color: var(--primary);
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    border-left-color: white;
}

.nav-link-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* ====================================
   MAIN CONTENT
   ==================================== */
.main-content {
    margin-left: 300px;
    padding: 40px 50px;
    min-height: 100vh;
    max-width: 1400px;
}

/* ====================================
   PAGE HEADER
   ==================================== */
.page-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 15px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.page-description {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 800px;
    line-height: 1.8;
}

/* ====================================
   SECTIONS
   ==================================== */
.section {
    background: white;
    border-radius: var(--radius);
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.section-title-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.section-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    margin: 30px 0 15px;
}

.section-content {
    color: var(--dark-light);
    font-size: 1rem;
    line-height: 1.8;
}

.section-content p {
    margin-bottom: 15px;
}

.section-content ul, .section-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.section-content li {
    margin-bottom: 10px;
}

/* ====================================
   CARDS
   ==================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    padding: 25px;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card.primary { border-left-color: var(--primary); }
.card.success { border-left-color: var(--success); }
.card.warning { border-left-color: var(--warning); }
.card.danger { border-left-color: var(--danger); }
.card.info { border-left-color: var(--info); }
.card.secondary { border-left-color: var(--secondary); }

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: white;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
}

.card-content {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.6;
}

/* ====================================
   ACCORDIONS
   ==================================== */
.accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.accordion-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    user-select: none;
}

.accordion-header:hover {
    background: var(--primary-light);
}

.accordion-header.active {
    background: var(--primary);
    color: white;
}

.accordion-title {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-icon {
    transition: var(--transition);
    font-size: 1.2rem;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: white;
}

.accordion-body.active {
    padding: 25px;
    max-height: 2000px;
}

.accordion-content {
    color: var(--dark-light);
    line-height: 1.8;
}

/* ====================================
   TABS
   ==================================== */
.tabs-container {
    margin: 25px 0;
}

.tabs-header {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 25px;
    overflow-x: auto;
}

.tab-button {
    padding: 15px 25px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====================================
   CODE BLOCKS
   ==================================== */
.code-block {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 25px;
    margin: 20px 0;
    overflow-x: auto;
    position: relative;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.code-block-title {
    color: var(--gray-light);
    font-size: 0.85rem;
    font-weight: 600;
}

.code-block-copy {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.code-block-copy:hover {
    background: var(--primary);
}

.code-block code {
    color: #e2e8f0;
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}

.code-block .comment { color: #6b7280; font-style: italic; }
.code-block .keyword { color: #c084fc; }
.code-block .string { color: #86efac; }
.code-block .function { color: #60a5fa; }
.code-block .class { color: #fbbf24; }
.code-block .number { color: #f472b6; }
.code-block .decorator { color: #fb923c; }

code {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

/* ====================================
   TABLES
   ==================================== */
.table-container {
    overflow-x: auto;
    margin: 25px 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

tr:hover {
    background: var(--light);
}

tr:last-child td {
    border-bottom: none;
}

/* ====================================
   BADGES
   ==================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: #0891b2; }
.badge-secondary { background: var(--secondary-light); color: var(--secondary); }
.badge-dark { background: #e2e8f0; color: var(--dark); }

/* ====================================
   API ENDPOINTS
   ==================================== */
.api-endpoint {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--light);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.api-endpoint:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.api-method {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    min-width: 70px;
    text-align: center;
    font-family: monospace;
}

.api-method.get { background: var(--success-light); color: var(--success); }
.api-method.post { background: var(--primary-light); color: var(--primary); }
.api-method.put { background: var(--warning-light); color: #b45309; }
.api-method.delete { background: var(--danger-light); color: var(--danger); }

.api-path {
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--dark);
}

.api-desc {
    color: var(--gray);
    font-size: 0.85rem;
    max-width: 300px;
}

/* ====================================
   DIAGRAMS
   ==================================== */
.diagram {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius);
    padding: 40px;
    margin: 25px 0;
    color: white;
}

.diagram-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: white;
}

.diagram-layer {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.diagram-layer-title {
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.diagram-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diagram-box {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.diagram-box:hover {
    transform: scale(1.05);
}

.diagram-box.blue { background: rgba(37, 99, 235, 0.4); }
.diagram-box.purple { background: rgba(124, 58, 237, 0.4); }
.diagram-box.green { background: rgba(16, 185, 129, 0.4); }
.diagram-box.orange { background: rgba(245, 158, 11, 0.4); }
.diagram-box.cyan { background: rgba(6, 182, 212, 0.4); }
.diagram-box.pink { background: rgba(236, 72, 153, 0.4); }

.diagram-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin: 10px 0;
}

/* ====================================
   FLOW DIAGRAMS
   ==================================== */
.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius);
    margin: 25px 0;
}

.flow-step {
    background: white;
    padding: 20px 30px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    text-align: center;
    min-width: 150px;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.flow-step:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.flow-step.primary { border-color: var(--primary); background: var(--primary-light); }
.flow-step.success { border-color: var(--success); background: var(--success-light); }
.flow-step.warning { border-color: var(--warning); background: var(--warning-light); }
.flow-step.danger { border-color: var(--danger); background: var(--danger-light); }

.flow-step-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.flow-step-desc {
    font-size: 0.8rem;
    color: var(--gray);
}

.flow-arrow {
    font-size: 1.8rem;
    color: var(--primary);
}

/* ====================================
   STATS
   ==================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card.green { background: linear-gradient(135deg, var(--success) 0%, #059669 100%); }
.stat-card.orange { background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%); }
.stat-card.cyan { background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%); }
.stat-card.pink { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.stat-card.red { background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ====================================
   FOLDER TREE
   ==================================== */
.folder-tree {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 25px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 2;
    overflow-x: auto;
}

.folder-tree .folder { color: #60a5fa; font-weight: 600; }
.folder-tree .file { color: #94a3b8; }
.folder-tree .comment { color: #6b7280; font-style: italic; }

/* ====================================
   TOOLTIPS
   ==================================== */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px);
}

/* ====================================
   ALERTS
   ==================================== */
.alert {
    padding: 20px 25px;
    border-radius: var(--radius);
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    margin-bottom: 5px;
}

.alert-info {
    background: var(--info-light);
    border-left: 4px solid var(--info);
}

.alert-warning {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
}

.alert-success {
    background: var(--success-light);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: var(--danger-light);
    border-left: 4px solid var(--danger);
}

/* ====================================
   SEARCH
   ==================================== */
.search-container {
    position: relative;
    margin-bottom: 25px;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1.2rem;
}

/* ====================================
   THEME TOGGLE
   ==================================== */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* ====================================
   PROGRESS INDICATOR
   ==================================== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
    transition: width 0.2s ease;
}

/* ====================================
   BACK TO TOP
   ==================================== */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--dark);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

/* ====================================
   MOBILE MENU
   ==================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 1001;
    font-size: 1.3rem;
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 30px 20px;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}

/* ====================================
   PRINT STYLES
   ==================================== */
@media print {
    .sidebar,
    .theme-toggle,
    .back-to-top,
    .mobile-menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ====================================
   ANIMATIONS
   ==================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.5s ease forwards;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}
