/* ===========================================
   QRAMM Shared Navbar Styles
   Single source of truth for all navbar styling
   =========================================== */

/* Header */
.header {
    background: var(--color-surface, #ffffff);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    font-family: var(--font-display, 'DM Serif Display', Georgia, serif);
    font-size: 2.25rem;
    color: var(--color-primary, #1e3a5f);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
}

.logo img {
    height: 54px;
    width: auto;
    margin-right: 14px;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text-muted, #5a6778);
    font-weight: 500;
    font-size: 1.125rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-primary, #1e3a5f);
}

.nav-cta {
    background: var(--color-primary, #1e3a5f);
    color: white !important;
    padding: 14px 28px;
    border-radius: var(--radius-md, 8px);
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
    background: var(--color-secondary, #2d6a8a);
    transform: translateY(-1px);
}

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

.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-dropdown > a::after {
    content: '';
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    display: inline-block;
    padding: 2.5px;
    transform: rotate(45deg);
    margin-top: -2px;
    transition: transform 0.2s;
}

.nav-dropdown:hover > a::after {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(30, 58, 95, 0.12));
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1001;
    margin-top: 8px;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--color-text-muted, #5a6778);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
    background: var(--color-bg, #f8f9fa);
    color: var(--color-primary, #1e3a5f);
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    z-index: 1002;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary, #1e3a5f);
    margin: 6px 0;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}

/* Hamburger to X animation when active */
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .nav {
        height: 70px;
    }

    .logo {
        font-size: 1.75rem;
    }

    .logo img {
        height: 40px;
        margin-right: 10px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-surface, #ffffff);
        flex-direction: column;
        padding: 0;
        gap: 0;
        border-top: 1px solid var(--color-border, #e2e8f0);
        box-shadow: 0 12px 32px rgba(30, 58, 95, 0.12);
        overflow-y: auto;
        z-index: 1001;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links > li {
        width: 100%;
        border-bottom: 1px solid var(--color-border, #e2e8f0);
    }

    .nav-links > li > a {
        display: block;
        padding: 16px 24px;
        font-size: 1rem;
    }

    .mobile-toggle {
        display: block;
    }

    /* Dropdown styles for mobile */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown > a {
        display: flex;
        justify-content: space-between;
        padding: 16px 24px;
    }

    .nav-dropdown > a::after {
        padding: 4px;
        margin-left: 12px;
        margin-right: 4px;
        margin-top: -2px;
        flex-shrink: 0;
        transform: rotate(45deg);
        transition: transform 0.2s, margin-top 0.2s;
    }

    /* Hide dropdown by default on mobile */
    .dropdown-menu {
        display: none;
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        opacity: 1;
        visibility: visible;
        min-width: auto;
        margin-top: 0;
        background: var(--color-bg, #f8f9fa);
    }

    /* Show dropdown when parent has .open class */
    .nav-dropdown.open .dropdown-menu {
        display: block;
    }

    .nav-dropdown.open > a::after {
        transform: rotate(-135deg);
        margin-top: 4px;
    }

    .dropdown-menu a {
        padding: 14px 24px 14px 40px;
        border-bottom: 1px solid var(--color-border, #e2e8f0);
    }

    .dropdown-menu li:last-child a {
        border-bottom: none;
    }

    /* Mobile CTA button */
    .nav-links .nav-cta {
        margin: 16px 24px;
        text-align: center;
        display: block;
    }
}
