/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* Lower z-index when modal is open */
body.modal-open header {
    z-index: 5 !important;
}

.header-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.07);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0.75rem;
    background: var(--gradient);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
    width: calc(100% - 1.5rem);
}

/* Button styles are now in buttons.css */

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Responsive Navigation */
@media (max-width: 1024px) {
    nav {
        height: 70px;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 100px 2rem 2rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 1000;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        padding: 1rem 0;
        width: 100%;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .nav-links a::after {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
        /* Hide CTA button in mobile header */
    nav > .cta-button {
        display: none;
        z-index: 1001;
    }
    
    /* Show CTA button in desktop view */
    @media (min-width: 1025px) {
        nav > .cta-button {
            display: block;
        }
    }
    
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        padding: 2rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links a {
        font-size: 1.25rem;  
        padding: 0.75rem 1rem;  
        width: 100%;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    .nav-links a:hover,
    .nav-links a:focus {
        background: rgba(37, 99, 235, 0.05);
        transform: translateX(5px);
    }
    
    .nav-links a::after {
        display: none;  
    }
    
    /* Dark mode adjustments for mobile */
    .dark-mode .nav-links {
        background: #1e293b;  
    }
    
    .dark-mode .nav-links a {
        color: #e2e8f0;  
    }
    
    .dark-mode .nav-links a:hover,
    .dark-mode .nav-links a:focus {
        background: rgba(59, 130, 246, 0.1);  
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: var(--transition);
        z-index: 1000;
        padding: 2rem;
    }

    .nav-links.active {
        right: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active div:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    
    .hamburger.active div:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active div:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .button-group .cta-button {
        width: 100%;
        text-align: center;
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(30deg);
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #0f172a;
    color: #e2e8f0;
}

.dark-mode header {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .header-scrolled {
    background: rgba(15, 23, 42, 0.98);
}

.dark-mode .nav-links a {
    color: #e2e8f0;
}

.dark-mode .nav-links a:hover,
.dark-mode .nav-links a.active {
    color: var(--accent);
}

.dark-mode .hamburger span {
    background: #e2e8f0;
}

/* Override for Privacy Modal */
body.modal-open header {
    z-index: 999 !important;
}
