/* =========================================
   INTQUES NAVBAR — Redesigned
========================================= */

.navbar {
    /* Was rgba(...,0.96), then 0.99 — neither was enough. backdrop-filter blurs whatever's
       behind but doesn't remove it; even 1% remaining transparency still let the dark footer's
       large white wordmark ghost through once scrolled directly underneath, since a blurred
       high-contrast shape stays faintly visible at very low opacity. Fully opaque is the only
       value that guarantees zero bleed-through — backdrop-filter is a no-op now (nothing behind
       an opaque background can show through it) but left in place in case opacity ever changes. */
    background: #ffffff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(68px + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    z-index: 1300;
    transition: box-shadow 300ms ease, background 300ms ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.navbar .container {
    display: flex;
    align-items: center;
    height: 100%;
}

/* =========================================
   BRAND
========================================= */
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 0;
    margin-right: 0;
}

.nav-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255,106,0,0.20);
    transition: box-shadow 220ms ease, transform 220ms ease;
}
.navbar-brand:hover .nav-brand-logo {
    box-shadow: 0 4px 14px rgba(255,106,0,0.35);
    transform: scale(1.06);
}

.nav-brand-text {
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.04em;
}

/* =========================================
   NAV LINKS
========================================= */
.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569 !important;
    padding: 6px 12px !important;
    border-radius: 8px;
    transition: color 200ms ease, background 200ms ease;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover {
    color: #0f172a !important;
    background: rgba(15, 23, 42, 0.05);
}

.navbar-nav .nav-link.active {
    color: #ff6a00 !important;
    background: rgba(255, 106, 0, 0.06);
    font-weight: 700;
}

/* =========================================
   WORKSHOPS DROPDOWN TOGGLE
========================================= */
.nav-dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}

/* Hide Bootstrap's default caret */
.nav-dropdown-toggle::after { display: none !important; }

.nav-chevron {
    font-size: 11px;
    color: #94a3b8;
    transition: transform 220ms ease;
}

.dropdown.show .nav-chevron {
    transform: rotate(180deg);
}

/* =========================================
   DROPDOWN MENU
========================================= */
.nav-dropdown-menu {
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
    padding: 14px;
    min-width: 320px;
    background: #ffffff;
    margin-top: 8px !important;
    animation: dropdownFade 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 10px;
}

.nav-dropdown-label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
}

.nav-dropdown-price-note {
    font-size: 12px;
    font-weight: 800;
    color: #ff6a00;
    background: rgba(255, 106, 0, 0.08);
    padding: 2px 8px;
    border-radius: 999px;
}

.nav-dropdown-divider {
    height: 1px;
    background: rgba(15, 23, 42, 0.06);
    margin-bottom: 8px;
}

/* Dropdown items */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 180ms ease;
    cursor: pointer;
}

.nav-dropdown-item:hover {
    background: rgba(255, 106, 0, 0.05);
}

.nav-dropdown-item:hover .nav-di-name {
    color: #ff6a00;
}

/* Icon box */
.nav-di-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

.nav-di-icon.sql    { background: rgba(14,165,233,0.10);  color: #0284c7; }
.nav-di-icon.java   { background: rgba(255,106,0,0.10);   color: #ea580c; }
.nav-di-icon.kafka  { background: rgba(99,102,241,0.10);  color: #4f46e5; }
.nav-di-icon.spring { background: rgba(34,197,94,0.10);   color: #16a34a; }

/* Text block */
.nav-di-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-di-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    transition: color 180ms ease;
}

.nav-di-meta {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
}

/* PRO badge — used on premium nav items (desktop dropdown + mobile drawer) */
.nav-pro-badge {
    font-size: 0.68rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6a00, #ff8c3a);
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    vertical-align: middle;
    letter-spacing: 0.03em;
    margin-left: 4px;
}

/* Price tag */
.nav-di-price {
    font-size: 0.86rem;
    font-weight: 800;
    color: #ff6a00;
    background: rgba(255, 106, 0, 0.08);
    padding: 3px 9px;
    border-radius: 999px;
    flex-shrink: 0;
}

/* =========================================
   NAV DROPDOWN — DYNAMIC CARD ROWS
========================================= */
.nav-dd-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 160ms ease, border-color 160ms ease;
    margin-bottom: 4px;
}
.nav-dd-card:last-of-type { margin-bottom: 0; }

.nav-dd-card:hover {
    background: rgba(255, 106, 0, 0.04);
    border-color: rgba(255, 106, 0, 0.12);
}
.nav-dd-card-course:hover {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.12);
}

.nav-dd-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.nav-dd-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 160ms ease;
}
.nav-dd-card:hover .nav-dd-name { color: #ff6a00; }
.nav-dd-card-course:hover .nav-dd-name { color: #6366f1; }

.nav-dd-meta {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-dd-price {
    font-size: 0.86rem;
    font-weight: 800;
    color: #ff6a00;
    background: rgba(255, 106, 0, 0.08);
    padding: 3px 10px;
    border-radius: 999px;
    flex-shrink: 0;
    white-space: nowrap;
}
.nav-dd-price-course {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.nav-dropdown-price-course {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.nav-dd-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    margin-top: 4px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
}
.nav-dd-view-all:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}

.nav-dd-empty {
    padding: 10px 12px;
    font-size: 0.86rem;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

/* =========================================
   LIVE COURSE LINK — special treatment
========================================= */
.nav-live-course {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    color: #0f172a !important;
    font-weight: 700 !important;
    position: relative;
}

.nav-live-course:hover {
    background: rgba(255, 106, 0, 0.06) !important;
    color: #ff6a00 !important;
}

.nav-live-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
    animation: navLivePulse 2s ease-in-out infinite;
}

@keyframes navLivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}

.nav-course-badge {
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6a00, #ff8c3a);
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 999px;
    letter-spacing: 0.2px;
}

/* =========================================
   RIGHT SIDE — My Account
========================================= */
.nav-right-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
}

.nav-account-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 9px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
    white-space: nowrap;
}

.nav-account-link i { font-size: 15px; }

.nav-account-link:hover {
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.20);
    background: rgba(15, 23, 42, 0.03);
}

.nav-account-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #ffffff;
    color: #475569;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.nav-account-toggle::after { display: none !important; }

.nav-account-toggle:hover,
.dropdown.show > .nav-account-toggle {
    color: #ff6a00;
    border-color: rgba(255, 106, 0, 0.30);
    background: rgba(255, 106, 0, 0.06);
}

.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #ffffff;
    color: #475569;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.nav-search-btn:hover {
    color: #ff6a00;
    border-color: rgba(255, 106, 0, 0.30);
    background: rgba(255, 106, 0, 0.06);
    text-decoration: none;
}

.nav-account-menu { min-width: 260px; }

/* =========================================
   NOTIFICATION BELL
========================================= */
.nav-notif-toggle { position: relative; }

.nav-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px #ffffff;
}

.nav-notif-menu { min-width: 340px; max-width: 380px; padding: 14px 0; }

.nav-notif-header { padding: 0 14px 10px; }

.nav-notif-mark-all {
    border: none;
    background: none;
    color: #ff6a00;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
}

.nav-notif-mark-all:hover { text-decoration: underline; }

.nav-notif-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-notif-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    text-decoration: none;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 150ms ease;
}

.nav-notif-item:hover { background: rgba(255, 106, 0, 0.05); }

.nav-notif-item.nav-notif-unread {
    border-left-color: #ff6a00;
    background: rgba(255, 106, 0, 0.03);
}

.nav-notif-title { font-size: 0.88rem; font-weight: 700; color: #0f172a; }
.nav-notif-message { font-size: 0.82rem; color: #475569; }
.nav-notif-time { font-size: 0.74rem; color: #94a3b8; margin-top: 2px; }

.nav-notif-empty {
    padding: 24px 14px;
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* =========================================
   MOBILE HAMBURGER — left-aligned
========================================= */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 10px;
    transition: background 200ms ease;
    -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.nav-hamburger:focus-visible { outline: 3px solid rgba(255, 106, 0, 0.35); outline-offset: 2px; }
.nav-hamburger:hover { background: rgba(15, 23, 42, 0.04); }

.nav-toggler-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    pointer-events: none;
}

.nav-toggler-bars span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #334155;
}

/* =========================================
   NARROW DESKTOP NAV (tablets in landscape, iPad Pro 12.9" portrait,
   and any window from 992-1199px — Bootstrap's own "lg" breakpoint
   already switches to this full nav at 992px, but at 992-1199px it's a lot
   of top-level items + up to 4 icon buttons (search/theme/notifications/
   account-avatar when logged in) in not much room. Unpadded, the
   Quizzes/Flashcards/Play/Rewards/Assignments/My Courses/Resume row plus
   those icons wanted ~1104px — 112px more than a 992px viewport has, and
   nothing scrolls to compensate, so the rightmost icon(s) were simply
   clipped off-screen and unreachable. First pass here only recovered
   enough for 3 icons — a logged-in visitor's 4th (account avatar) was
   still ~34px off-screen, so this also shrinks the icon buttons themselves
   and their gaps, not just the nav links. ── */
@media (min-width: 992px) and (max-width: 1199px) {
    .navbar-nav .nav-link {
        padding: 6px 6px !important;
        font-size: 0.85rem;
    }
    .nav-dropdown-toggle { gap: 3px; }
    .nav-brand-text { font-size: 1.15rem; }
    .nav-right-actions {
        gap: 4px;
        margin-left: 0;
    }
    .nav-search-btn,
    .nav-account-toggle {
        width: 34px;
        height: 34px;
    }
}

/* =========================================
   MOBILE — compact header (drawer handles nav)
========================================= */
@media (max-width: 991px) {
    .navbar {
        height: calc(60px + env(safe-area-inset-top, 0px)) !important;
        padding: 0 !important;
        padding-top: env(safe-area-inset-top, 0px) !important;
    }

    .navbar .container {
        position: relative;
    }

    .navbar-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-hamburger { display: flex; }

    /* Drawer handles mobile navigation; collapse stays hidden */
    .navbar-collapse {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .nav-brand-text { font-size: 1.2rem; }
    .nav-brand-icon { font-size: 1.15rem; }
}

/* =========================================
   NAVIGATION DRAWER
========================================= */

/* Backdrop overlay */
.nav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1599;
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.nav-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Drawer panel */
.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    height: 100dvh;
    background: #ffffff;
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 32px rgba(15, 23, 42, 0.14);
    will-change: transform;
}
.nav-drawer.open {
    transform: translateX(0);
}

/* Drawer header */
.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 64px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    flex-shrink: 0;
}

.nav-drawer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.nav-drawer-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.nav-drawer-brand .nav-brand-text {
    font-size: 1.2rem !important;
}

.nav-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: #64748b;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 180ms ease, color 180ms ease;
    -webkit-tap-highlight-color: transparent;
}
.nav-drawer-close:hover { background: rgba(15, 23, 42, 0.05); color: #0f172a; }
.nav-drawer-close:focus:not(:focus-visible) { outline: none; }
.nav-drawer-close:focus-visible { outline: 3px solid rgba(255, 106, 0, 0.35); outline-offset: 2px; }

/* Drawer nav list */
.nav-drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.nav-drawer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease;
    -webkit-tap-highlight-color: transparent;
}
.nav-drawer-link:hover {
    background: rgba(255, 106, 0, 0.05);
    color: #ff6a00;
}
.nav-drawer-link.active {
    background: rgba(255, 106, 0, 0.08);
    color: #ff6a00;
    font-weight: 700;
}

/* Icon boxes */
.nav-drawer-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
    flex-shrink: 0;
    transition: background 160ms ease, color 160ms ease;
}
.nav-drawer-link:hover .nav-drawer-icon,
.nav-drawer-link.active .nav-drawer-icon {
    background: rgba(255, 106, 0, 0.10);
    color: #ff6a00;
}

/* Drawer footer — My Account / theme toggle */
.nav-drawer-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    /* Keeps My Account / theme toggle clear of the iPhone home-indicator gesture area — same
       env(safe-area-inset-bottom) awareness as the mobile tab bar and floating buttons. */
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(15, 23, 42, 0.07);
    flex-shrink: 0;
}

.nav-drawer-theme-toggle {
    width: 100%;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.nav-drawer-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
    -webkit-tap-highlight-color: transparent;
}
.nav-drawer-account:hover {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}
.nav-drawer-account .nav-drawer-icon {
    background: rgba(99, 102, 241, 0.07);
    color: #6366f1;
}
.nav-drawer-account:hover .nav-drawer-icon {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}

.nav-drawer-chevron {
    margin-left: auto;
    font-size: 11px;
    color: #94a3b8;
}

/* Prevent body scroll when drawer is open */
body.nav-drawer-open {
    overflow: hidden;
    touch-action: none;
}

/* =========================================
   MOBILE HEADER — user account icon (right)
========================================= */
.nav-mobile-account {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 6px 8px;
    border-radius: 8px;
    color: #475569;
    font-size: 1.3rem;
    text-decoration: none;
    transition: color 200ms ease, background 200ms ease;
    flex-shrink: 0;
}
.nav-mobile-account:hover {
    color: #ff6a00;
    background: rgba(255, 106, 0, 0.06);
}