/* ═══════════════════════════════════════════════════════════════
   Mobile Navigation — Left-Side Drawer + Infographic Slide
   Active below Bootstrap lg breakpoint (< 992px)
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay (shared by nav drawer and infographic) ── */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 300ms ease-in-out;
}
.mobile-nav-overlay.active {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

/* ── Panel (slides from LEFT) ── */
.mobile-nav-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    z-index: 1070;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(-100%);
    transition: transform 300ms ease-in-out;
    -webkit-overflow-scrolling: touch;
}
.mobile-nav-panel.open {
    transform: translateX(0);
}

/* Dark theme */
html[data-mode="dark"] .mobile-nav-panel {
    background: #1f1f1f;
    color: #e2e8f0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}
/* Light theme */
html[data-mode="light"] .mobile-nav-panel {
    background: var(--page-bg, #f0f0f0);
    color: #1e293b;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

/* ── Close button ── */
.mobile-nav-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
    transition: background 0.15s;
    z-index: 1;
}
html[data-mode="dark"] .mobile-nav-close { color: #94a3b8; }
html[data-mode="light"] .mobile-nav-close { color: #64748b; }
.mobile-nav-close:hover { background: rgba(128, 128, 128, 0.15); }

/* ── Section headers ── */
.mobile-nav-section {
    padding: 20px 20px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.mobile-nav-section:first-of-type {
    padding-top: 52px;
}
html[data-mode="dark"] .mobile-nav-section { color: rgba(255, 255, 255, 0.4); }
html[data-mode="light"] .mobile-nav-section { color: rgba(0, 0, 0, 0.4); }

/* Nav links (pages — text only, no icons) */
.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    line-height: 1.3;
}
html[data-mode="dark"] .mobile-nav-link { color: #cbd5e1; }
html[data-mode="light"] .mobile-nav-link { color: #334155; }

html[data-mode="dark"] .mobile-nav-link:hover,
html[data-mode="dark"] .mobile-nav-link:focus {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}
html[data-mode="light"] .mobile-nav-link:hover,
html[data-mode="light"] .mobile-nav-link:focus {
    background: rgba(0, 0, 0, 0.04);
    color: #0f172a;
}

/* Active page indicator */
html[data-mode="dark"] .mobile-nav-link.active {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4caf50;
}
html[data-mode="light"] .mobile-nav-link.active {
    color: #2e7d32;
    background: rgba(76, 175, 80, 0.08);
    border-left: 3px solid #2e7d32;
}

.mobile-nav-link i,
.mobile-nav-link svg {
    display: none;
}

/* ── Action buttons (look like real buttons) ── */
.mobile-nav-action {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 16px;
    padding: 11px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 10px;
    border: 1px solid;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    width: calc(100% - 32px);
    text-align: left;
    background: none;
    line-height: 1.3;
}
html[data-mode="dark"] .mobile-nav-action {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}
html[data-mode="light"] .mobile-nav-action {
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.18);
    background: rgba(0, 0, 0, 0.02);
}
html[data-mode="dark"] .mobile-nav-action:hover,
html[data-mode="dark"] .mobile-nav-action:focus {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border-color: #4caf50;
}
html[data-mode="light"] .mobile-nav-action:hover,
html[data-mode="light"] .mobile-nav-action:focus {
    background: var(--btn-hover-bg, #ffe27d);
    color: #000;
    border-color: rgba(0, 0, 0, 0.25);
}
.mobile-nav-action i,
.mobile-nav-action svg {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.mobile-nav-action svg {
    height: 17px;
    width: 17px;
    fill: currentColor;
}

/* ── Divider ── */
.mobile-nav-divider {
    height: 1px;
    margin: 8px 20px;
}
html[data-mode="dark"] .mobile-nav-divider { background: rgba(255, 255, 255, 0.08); }
html[data-mode="light"] .mobile-nav-divider { background: rgba(0, 0, 0, 0.08); }

/* ── Footer row (language + theme) ── */
.mobile-nav-footer {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.mobile-nav-footer .mode-toggle-btn {
    width: 38px;
    height: 38px;
}
.mobile-nav-footer .lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    height: 38px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 8px;
    border: 1px solid rgba(128, 128, 128, 0.3);
    text-decoration: none !important;
    transition: background 0.15s;
    cursor: pointer;
    background: none;
}
html[data-mode="dark"] .mobile-nav-footer .lang-btn {
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.15);
}
html[data-mode="light"] .mobile-nav-footer .lang-btn {
    color: #334155;
    border-color: rgba(0, 0, 0, 0.2);
}
.mobile-nav-footer .lang-btn:hover {
    background: rgba(128, 128, 128, 0.1);
}
.mobile-nav-footer .lang-btn.active-lang {
    border-color: #4caf50;
}
html[data-mode="dark"] .mobile-nav-footer .lang-btn.active-lang { color: #4caf50; }
html[data-mode="light"] .mobile-nav-footer .lang-btn.active-lang { color: #2e7d32; }

/* ── Hamburger button (centered in navbar on mobile) ── */
.mobile-hamburger-btn {
    background: none;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}
html[data-mode="dark"] .mobile-hamburger-btn { color: #e2e8f0; }
html[data-mode="light"] .mobile-hamburger-btn { color: #1e293b; }
.mobile-hamburger-btn:hover {
    background: rgba(128, 128, 128, 0.1);
}
.mobile-hamburger-btn i {
    font-size: 1.5rem;
    transition: opacity 0.15s;
}

/* ═══════════════════════════════════════════════════════════════
   Infographic Right-Side Slide (mobile only)
   Full-page push: main content slides left, infographic from right
   ═══════════════════════════════════════════════════════════════ */

.mobile-info-overlay {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 300ms ease-in-out;
}
.mobile-info-overlay.active {
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

/* ── Responsive visibility ── */
@media (max-width: 991.98px) {
    /* Hide desktop-only nav items */
    .desktop-nav-item { display: none !important; }
    /* Hide old sidebar toggle and slide panel */
    .navbar-toggler.toggle-sidebar { display: none !important; }
    .navbar-slide { display: none !important; }

    /* ── Infographic: hidden by default, slides from right (full-screen) ── */
    #rightSidebar {
        position: fixed !important;
        top: var(--topnav-height, 100px);
        left: 0 !important;
        right: 0 !important;
        bottom: 0;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        z-index: 1058;
        transform: translateX(100%);
        transition: transform 300ms ease-in-out;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 10px 10px 120px 10px !important;
    }
    html[data-mode="dark"] #rightSidebar {
        background: #1f1f1f;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
    }
    html[data-mode="light"] #rightSidebar {
        background: var(--page-bg, #f0f0f0);
        border-left: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    }
    #rightSidebar.mobile-info-open {
        transform: translateX(0);
    }

    /* Main content takes full width on mobile always */
    #mainContentWrapper {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        transition: transform 300ms ease-in-out;
    }
    /* Push main content fully off-screen left when infographic is open */
    body.mobile-info-active #mainContentWrapper {
        transform: translateX(-100%);
    }

    /* Override desktop toggle button to be a floating action button */
    .infografika-toggle {
        position: fixed !important;
        right: 16px !important;
        bottom: 16px !important;
        z-index: 1200 !important;
    }
}

@media (min-width: 992px) {
    /* Hide mobile-only elements on desktop */
    .mobile-nav-overlay { display: none !important; }
    .mobile-nav-panel { display: none !important; }
    .mobile-only { display: none !important; }
    .mobile-info-overlay { display: none !important; }
}

/* ── Prevent body scroll when panel open ── */
body.mobile-nav-open,
body.mobile-info-active {
    overflow: hidden;
}
