/* ===========================================
   FIZICA CU FEYNMAN — nav.css
   Sistem de navigație profesional
   =========================================== */

/* ——— SITE NAVBAR ——— */
.site-nav {
    background: linear-gradient(135deg, #1F4E79 0%, #2E75B6 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.site-nav__inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 54px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-nav__brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.site-nav__brand:hover { color: #E8A000; transition: color 0.2s; }

.site-nav__spacer { flex: 1; }

/* Acasă link */
.site-nav__home {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.site-nav__home:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Simulări link */
.site-nav__simulari {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.site-nav__simulari:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Despre Feynman link */
.site-nav__despre-feynman {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.site-nav__despre-feynman:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Despre autor link */
.site-nav__despre-autor {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.site-nav__despre-autor:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Module dropdown */
.site-nav__dropdown-wrap { position: relative; }

.site-nav__modules-btn {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fff;
    padding: 0.35rem 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.2s;
    white-space: nowrap;
}
.site-nav__modules-btn:hover { background: rgba(255,255,255,0.24); }
.site-nav__modules-btn .nav-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s;
    display: inline-block;
}
.site-nav__modules-btn.open .nav-arrow { transform: rotate(180deg); }

.site-nav__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.16);
    min-width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.4rem 0;
    z-index: 2000;
    border: 1px solid rgba(0,0,0,0.07);
}
.site-nav__dropdown.open { display: block; }
.site-nav__dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 1.1rem;
    width: 11px;
    height: 11px;
    background: #fff;
    border-left: 1px solid rgba(0,0,0,0.07);
    border-top: 1px solid rgba(0,0,0,0.07);
    transform: rotate(45deg);
}

.site-nav__dropdown a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 1.1rem;
    color: #2C3E50;
    text-decoration: none;
    font-size: 0.87rem;
    transition: background 0.15s;
}
.site-nav__dropdown a:hover { background: #F7FAFD; }
.site-nav__dropdown a.nav-active {
    background: #EBF4FB;
    color: #1F4E79;
    font-weight: 600;
    border-left: 3px solid #E8A000;
    padding-left: calc(1.1rem - 3px);
}
.site-nav__dropdown .drop-num {
    font-size: 0.72rem;
    color: #9EA7B0;
    min-width: 16px;
    font-weight: 500;
}
.site-nav__dropdown .drop-icon { font-size: 1rem; }
.site-nav__dropdown .drop-title { flex: 1; line-height: 1.3; }
.site-nav__dropdown hr {
    border: none;
    border-top: 1px solid #F0F0F0;
    margin: 0.3rem 0;
}
.drop-bloc-label {
    padding: 0.45rem 1.1rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #7C8B96;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #F7FAFD;
    pointer-events: none;
    user-select: none;
}

/* Link "Module" în navbar */
.site-nav__module-list {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.site-nav__module-list:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Mobile-only links in dropdown (Despre Feynman, Simulări) */
.drop-mobile-link { display: none !important; }

/* Hamburger (mobile) */
.site-nav__hamburger {
    display: none;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.site-nav__hamburger:hover { background: rgba(255,255,255,0.24); }

/* ——— MODULE TOPBAR (progres + breadcrumb) ——— */
.mod-topbar {
    background: #F7FAFD;
    border-bottom: 1px solid #DEE2E6;
}
.mod-topbar__inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0.55rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    flex: 1;
    min-width: 0;
}
.breadcrumb a {
    color: #2E75B6;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb__sep { color: #C4CAD0; }
.breadcrumb__current {
    color: #2C3E50;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Progress dots */
.mod-progress {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.mod-progress__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #DEE2E6;
    border: 1.5px solid #C4CAD0;
    cursor: default;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.mod-progress__dot.done {
    background: #5B9BD5;
    border-color: #2E75B6;
}
.mod-progress__dot.current {
    background: #E8A000;
    border-color: #C07800;
    width: 8px;
    height: 8px;
}
.mod-progress__label {
    font-size: 0.77rem;
    color: #7C8B96;
    margin-left: 6px;
    white-space: nowrap;
}

/* ——— PREV / NEXT NAVIGATION ——— */
.module-nav {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0.65rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.module-nav--top {
    border-bottom: 1px solid #DEE2E6;
    background: #FAFBFC;
}
.module-nav--bottom {
    border-top: 1px solid #DEE2E6;
    background: #FAFBFC;
}

.module-nav__btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1.5px solid #DEE2E6;
    border-radius: 6px;
    text-decoration: none;
    color: #2C3E50;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
    max-width: 260px;
    line-height: 1.3;
}
.module-nav__btn:hover {
    border-color: #2E75B6;
    background: #EBF4FB;
    color: #1F4E79;
    box-shadow: 0 2px 8px rgba(46,117,182,0.1);
}
.module-nav__btn .nav-arrow { font-size: 1rem; flex-shrink: 0; }
.module-nav__btn .btn-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.module-nav__btn .btn-meta {
    font-size: 0.7rem;
    color: #9EA7B0;
    font-weight: 400;
}
.module-nav__btn.next { margin-left: auto; }
.module-nav__placeholder { flex: 1; }

/* ——— LAYOUT: TOC + CONȚINUT ——— */
.with-toc-layout {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    position: relative;
}

/* ——— TOC SIDEBAR ——— */
.toc-sidebar {
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 1.5rem 1rem 2rem 1.5rem;
    border-right: 1px solid #E8EDF2;
    font-size: 0.82rem;
    scrollbar-width: thin;
    scrollbar-color: #DEE2E6 transparent;
    align-self: flex-start;
}
.toc-sidebar::-webkit-scrollbar { width: 4px; }
.toc-sidebar::-webkit-scrollbar-track { background: transparent; }
.toc-sidebar::-webkit-scrollbar-thumb { background: #DEE2E6; border-radius: 2px; }

.toc-sidebar__title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9EA7B0;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.toc-sidebar__title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #E8A000, transparent);
    border-radius: 1px;
}

.toc-sidebar__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-sidebar__list li { margin: 0; }
.toc-sidebar__list a {
    display: block;
    padding: 0.28rem 0.5rem;
    color: #7C8B96;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1.35;
    border-radius: 0 3px 3px 0;
}
.toc-sidebar__list a:hover {
    color: #2E75B6;
    background: #F7FAFD;
}
.toc-sidebar__list a.toc-active {
    color: #1F4E79;
    font-weight: 600;
    border-left-color: #E8A000;
    background: #FFF8EC;
}
.toc-sidebar__list .toc-h2 a {
    padding-left: 1.2rem;
    font-size: 0.79rem;
    color: #9EA7B0;
}
.toc-sidebar__list .toc-h2 a:hover { color: #2E75B6; }
.toc-sidebar__list .toc-h2 a.toc-active { color: #2E75B6; font-weight: 500; }

/* Butonul ✕ ascuns global — apare doar în overlay-ul mobile */
.toc-close-btn { display: none; }

/* Mobile TOC toggle button */
.toc-toggle-btn {
    display: none;
    background: #1F4E79;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    gap: 0.4rem;
    align-items: center;
    white-space: nowrap;
    transition: background 0.2s;
}
.toc-toggle-btn:hover { background: #2E75B6; }

/* ——— MAIN CONTENT AREA ——— */
.module-main {
    flex: 1;
    min-width: 0;
    max-width: 900px;
    padding: 0 2rem 48px;
}

/* ——— BACK TO TOP ——— */
.back-to-top {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 42px;
    height: 42px;
    background: #E8A000;
    color: #1F4E79;
    border: none;
    border-radius: 50%;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 900;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover { background: #d09000; }

/* ——— RESPONSIVE ——— */
@media (max-width: 1100px) {
    .toc-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        max-height: 100vh;
        z-index: 1500;
        background: #fff;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
        width: 270px;
        padding-top: 3.5rem;
        border-right: 1px solid #DEE2E6;
    }
    .toc-sidebar.mobile-open { display: block; }

    .toc-close-btn {
        position: absolute;
        top: 0.9rem;
        right: 0.9rem;
        background: none;
        border: none;
        font-size: 1.1rem;
        cursor: pointer;
        color: #6C757D;
        padding: 0.2rem 0.4rem;
    }

/* Butonul ✕ e vizibil doar când sidebar-ul e deschis ca overlay mobile */
.toc-close-btn { display: none; }
.toc-sidebar.mobile-open .toc-close-btn { display: block; }

    /* Butonul "Cuprins" apare deasupra conținutului, nu lângă el */
    .with-toc-layout {
        flex-wrap: wrap;
        justify-content: center;
    }
    .toc-toggle-btn {
        display: flex;
        order: -1;
        flex-basis: 100%;
        margin: 0.65rem 1.5rem 0;
        align-self: flex-start;
    }

    .module-main {
        max-width: 100%;
        padding: 0 1.5rem 48px;
    }
}

@media (max-width: 768px) {
    .site-nav__home { display: none; }
    .site-nav__module-list { display: none; }
    .site-nav__despre-feynman { display: none; }
    .site-nav__despre-autor { display: none; }
    .site-nav__simulari { display: none; }
    .site-nav__hamburger { display: flex; }

    /* Ascundem doar butonul "Module ▾", nu și wrapper-ul */
    .site-nav__modules-btn { display: none; }
    .site-nav__dropdown-wrap {
        position: static;
        width: 0;
        height: 0;
        overflow: visible;
    }

    /* Dropdown full-width sub navbar pe mobil */
    .site-nav__dropdown.open {
        position: fixed;
        top: 54px;
        left: 0;
        right: 0;
        min-width: 100vw;
        border-radius: 0 0 10px 10px;
        max-height: calc(100vh - 54px);
        overflow-y: auto;
        box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    }
    .site-nav__dropdown.open::before { display: none; }

    .mod-topbar__inner { flex-wrap: wrap; gap: 0.4rem; padding: 0.4rem 1rem; }
    .breadcrumb__current { max-width: 160px; }
    .mod-progress__label { display: none; }

    .module-nav { padding: 0.5rem 1rem; }
    .module-nav__btn .btn-meta { display: none; }
    .module-nav__btn { padding: 0.45rem 0.75rem; font-size: 0.82rem; max-width: 200px; }

    .module-main { padding: 0 1rem 48px; }

    .back-to-top { bottom: 1rem; right: 1rem; width: 38px; height: 38px; font-size: 1rem; }

    .drop-mobile-link { display: flex !important; }
}

@media (max-width: 480px) {
    .module-nav__btn { max-width: 47%; }
    .site-nav__inner { padding: 0 1rem; }
}

/* ——— MOBILE OVERLAY ——— */
.toc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1400;
}
.toc-overlay.visible { display: block; }
