/* css/nav.css - Navigation Styles with Dropdown + Drawer */
:root {
    --nav-h: 72px;
    --nav-bg: rgba(255, 255, 255, 0.97);
    --nav-border: rgba(148, 163, 184, 0.2);
    --nav-ink: #0f172a;
    --nav-muted: #475569;
    --nav-accent: #2563eb;
    --nav-accent-2: #1d4ed8;
    --nav-shadow: 0 4px 20px -6px rgba(0, 0, 0, 0.1);
    --nav-radius: 12px;
}

/* Accessibility Skip Links */
.skip-link {
    position: absolute;
    top: -80px;
    left: 20px;
    background: var(--nav-accent);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 0 0 12px 12px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* Header Container */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 9991;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-nav .container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.nav-inner {
    min-height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
}

/* Brand */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
    flex-shrink: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, var(--nav-accent), var(--nav-accent-2));
    box-shadow: 0 8px 16px -8px rgba(37, 99, 235, 0.7);
    flex: 0 0 auto;
    font-size: 1rem;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-title {
    font-weight: 800;
    color: var(--nav-ink);
    font-size: 1rem;
    white-space: nowrap;
}

.brand-subtitle {
    font-weight: 600;
    color: var(--nav-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Desktop Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    text-decoration: none;
    color: var(--nav-muted);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all .2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-link i {
    font-size: 0.8rem;
    opacity: 0.7;
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nav-accent);
}

.nav-link-active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--nav-accent);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle i {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 100;
}

.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--nav-ink);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.nav-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--nav-muted);
    font-size: 0.85rem;
}

.nav-dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nav-accent);
}

.nav-dropdown-item:hover i {
    color: var(--nav-accent);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--nav-border);
    margin: 6px 0;
}

/* Mobile Header */
.nav-mobile-header {
    display: none;
    align-items: center;
    gap: 8px;
}

.nav-search-btn,
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--nav-border);
    background: #fff;
    cursor: pointer;
    transition: all .2s ease;
    color: var(--nav-muted);
    font-size: 1rem;
}

.nav-search-btn:hover,
.nav-toggle:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Hamburger Icon */
.nav-toggle {
    flex-direction: column;
    gap: 5px;
    padding: 12px;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--nav-ink);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle span:nth-child(2) {
    width: 14px;
}

.site-nav.is-open .nav-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.site-nav.is-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.site-nav.is-open .nav-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile CTA */
.nav-cta-mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--nav-accent);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-cta-mobile:hover {
    background: var(--nav-accent-2);
}

/* Drawer */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 10000;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.site-nav.is-open .nav-drawer {
    display: flex;
    /* Show when open */
}

.nav-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--nav-border);
    flex-shrink: 0;
}

.nav-drawer-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--nav-ink);
}

.nav-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: var(--nav-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-drawer-close:hover {
    background: #e2e8f0;
    color: var(--nav-ink);
}

.nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.nav-drawer-section {
    margin-bottom: 16px;
}

.nav-drawer-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nav-muted);
    padding: 0 12px 8px;
}

.nav-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--nav-ink);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.nav-drawer-item i {
    width: 20px;
    text-align: center;
    color: var(--nav-accent);
    font-size: 0.95rem;
}

.nav-drawer-item:hover,
.nav-drawer-item:active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nav-accent);
}

.nav-drawer-item-featured {
    background: linear-gradient(135deg, var(--nav-accent), var(--nav-accent-2));
    color: #fff !important;
    margin-bottom: 8px;
}

.nav-drawer-item-featured i {
    color: #fff;
}

.nav-drawer-item-featured:hover {
    background: linear-gradient(135deg, var(--nav-accent-2), var(--nav-accent));
    color: #fff;
}

.nav-drawer-item-small {
    font-size: 0.8rem;
    padding: 8px 12px;
    color: var(--nav-muted);
}

.nav-drawer-section-muted {
    border-top: 1px solid var(--nav-border);
    padding-top: 12px;
    margin-top: 8px;
}

/* Overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.site-nav.is-open .nav-overlay {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 1100px) {
    .nav-links {
        display: none;
    }

    .nav-mobile-header {
        display: flex;
    }

    .brand-subtitle {
        display: none;
    }
}

@media (min-width: 1101px) {

    .nav-drawer,
    .nav-overlay,
    .nav-mobile-header {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .brand-title {
        font-size: 0.9rem;
    }

    .nav-inner {
        min-height: 60px;
        gap: 10px;
    }

    .nav-search-btn,
    .nav-toggle {
        width: 38px;
        height: 38px;
    }

    .nav-cta-mobile {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .nav-drawer {
        width: 260px;
    }
}