/* ===================================
   HEADER & NAVIGATION STYLES
   =================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: var(--z-fixed);
    transition: var(--transition-normal);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.header.dark {
    background: rgba(26, 26, 26, 0.95);
}

.header.dark.scrolled {
    background: rgba(26, 26, 26, 0.98);
}

.navbar {
    padding: var(--spacing-md) 0;
    transition: var(--transition-normal);
}

.header.scrolled .navbar {
    padding: var(--spacing-sm) 0;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Logo Styles */
.logo a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    transition: var(--transition-normal);
}

.logo-img {
    height: 50px;
    width: auto;
    transition: var(--transition-normal);
}

.header.scrolled .logo-img {
    height: 35px;
}

.logo-text {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--primary-color);
    transition: var(--transition-normal);
}

.header.dark .logo-text {
    color: var(--white);
}

.logo:hover .logo-text {
    color: var(--primary-light);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: var(--spacing-xl);
    margin: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    position: relative;
}

.header.dark .nav-link {
    color: var(--white);
}

.nav-link.active,
.nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 102, 204, 0.1);
}

.header.dark .nav-link.active,
.header.dark .nav-link:hover {
    color: var(--accent-color);
    background: rgba(0, 212, 255, 0.1);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle i {
    font-size: var(--fs-xs);
    transition: var(--transition-fast);
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-normal);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.header.dark .dropdown-menu {
    background: var(--dark-secondary);
    border-color: rgba(255, 255, 255, 0.1);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--gray-dark);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-size: var(--fs-sm);
}

.header.dark .dropdown-item {
    color: var(--gray-light);
}

.dropdown-item:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.header.dark .dropdown-item:hover {
    background: var(--dark-color);
    color: var(--accent-color);
}

/* CTA Button */
.nav-cta {
    margin-left: var(--spacing-lg);
}

.nav-cta .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--fs-sm);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.mobile-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--dark-color);
    border-radius: 2px;
    transition: var(--transition-normal);
    transform-origin: center;
}

.header.dark .mobile-toggle span {
    background: var(--white);
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: var(--spacing-xl);
        gap: 0;
        transform: translateX(-100%);
        transition: var(--transition-normal);
        overflow-y: auto;
        box-shadow: var(--shadow-xl);
    }

    .header.dark .nav-menu {
        background: var(--dark-color);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--gray-light);
    }

    .header.dark .nav-item {
        border-bottom-color: var(--gray-dark);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        width: 100%;
        padding: var(--spacing-lg);
        font-size: var(--fs-lg);
        justify-content: space-between;
        border-radius: 0;
        background: transparent;
    }

    .nav-link:hover {
        background: var(--light-color);
    }

    .header.dark .nav-link:hover {
        background: var(--dark-secondary);
    }

    /* Mobile Dropdown */
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--light-color);
        margin-top: 0;
        padding-left: var(--spacing-xl);
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height var(--transition-normal);
    }

    .header.dark .dropdown-menu {
        background: var(--dark-secondary);
    }

    .dropdown.active .dropdown-menu {
        max-height: 300px;
    }

    .dropdown-item {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--fs-base);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .header.dark .dropdown-item {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }

    /* Mobile CTA */
    .nav-cta {
        margin: var(--spacing-xl) 0 0 0;
        padding-top: var(--spacing-xl);
        border-top: 1px solid var(--gray-light);
    }

    .header.dark .nav-cta {
        border-top-color: var(--gray-dark);
    }

    .nav-cta .btn {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-lg);
        font-size: var(--fs-lg);
    }
}

/* Tablet Adjustments */
@media (max-width: 1024px) {
    .nav-menu {
        gap: var(--spacing-lg);
    }

    .nav-link {
        font-size: var(--fs-sm);
    }
}

/* Large Screen Adjustments */
@media (min-width: 1200px) {
    .nav-menu {
        gap: var(--spacing-2xl);
    }
}
/* ===================================
   MOBILE HEADER SIZE REDUCTION
   Add this to your header.css file
   =================================== */

/* Mobile Header Optimizations */
@media (max-width: 768px) {
    /* Reduce navbar padding significantly */
    .navbar {
        padding: var(--spacing-xs) 0; /* Reduced from var(--spacing-md) */
    }

    .header.scrolled .navbar {
        padding: var(--spacing-xs) 0; /* Keep consistent small padding */
    }

    /* Significantly reduce logo size */
    .logo-img {
        height: 35px; /* Reduced from 50px */
        width: auto;
    }

    .header.scrolled .logo-img {
        height: 30px; /* Reduced further when scrolled */
    }

    /* Reduce logo text size if you have any */
    .logo-text {
        font-size: var(--fs-lg); /* Reduced from var(--fs-2xl) */
    }

    /* Compact nav wrapper */
    .nav-wrapper {
        align-items: center;
        min-height: 50px; /* Set a maximum height */
    }

    /* Make mobile toggle smaller */
    .mobile-toggle {
        width: 20px; /* Reduced from 24px */
        height: 14px; /* Reduced from 18px */
    }

    .mobile-toggle span {
        height: 2px; /* Keep thin lines */
    }

    /* Reduce CTA button size in mobile */
    .nav-cta .btn {
        padding: var(--spacing-xs) var(--spacing-sm); /* Much smaller padding */
        font-size: var(--fs-xs); /* Smaller font */
        min-height: 32px; /* Reduce minimum height */
    }
}

/* Extra small mobile devices (under 480px) */
@media (max-width: 480px) {
    /* Even more compact for very small screens */
    .navbar {
        padding: 6px 0; /* Very minimal padding */
    }

    .logo-img {
        height: 30px; /* Even smaller logo */
    }

    .header.scrolled .logo-img {
        height: 25px;
    }

    .nav-wrapper {
        min-height: 45px; /* Reduce further */
    }

    .mobile-toggle {
        width: 18px;
        height: 12px;
    }

    /* Hide CTA button on very small screens to save space */
    .nav-cta {
        display: none;
    }
}

/* ===================================
   ALTERNATIVE SOLUTION - FIXED HEIGHT
   Use this instead if you want a fixed header height
   =================================== */

/*
@media (max-width: 768px) {
    .header {
        height: 50px; // Fixed height
    }

    .navbar {
        height: 100%;
        padding: 0;
    }

    .nav-wrapper {
        height: 100%;
        padding: 0 var(--spacing-md);
    }

    .logo-img {
        height: 30px;
    }

    .mobile-toggle {
        width: 20px;
        height: 14px;
    }

    // Position the mobile menu to account for smaller header
    .nav-menu {
        top: 50px; // Match header height
        height: calc(100vh - 50px);
    }
}
*/

/* ===================================
   ADJUST PAGE MARGINS FOR SMALLER HEADER
   Update these values in your existing CSS
   =================================== */

@media (max-width: 768px) {
    /* Reduce top margin since header is smaller */
    .page-header {
        margin-top: 45px; /* Reduced from 50px */
    }

    /* For pages without page-header class */
    .main-content,
    .hero {
        margin-top: 45px; /* Reduced from 50px */
    }
}

@media (max-width: 480px) {
    .page-header {
        margin-top: 40px; /* Even smaller for tiny screens */
    }

    .main-content,
    .hero {
        margin-top: 40px;
    }
}

/* ===================================
   LOGO RESPONSIVE BEHAVIOR
   =================================== */

@media (max-width: 768px) {
    /* If you want the logo to scale smoothly */
    .logo a {
        transition: all var(--transition-normal);
    }

    /* Ensure logo container doesn't add extra height */
    .logo {
        display: flex;
        align-items: center;
        height: 100%;
    }

    /* Remove any extra margins on logo */
    .logo-img {
        margin: 0;
        display: block;
    }
}

/* ===================================
   MOBILE MENU POSITIONING FIX
   =================================== */

@media (max-width: 768px) {
    /* Adjust mobile menu to start right below the smaller header */
    .nav-menu {
        top: 100%; /* This should work with the smaller header */
        /* If you're using fixed positioning, calculate the exact height */
        /* top: 50px; */ /* Use this if header has fixed height */
    }

    /* Ensure mobile menu items aren't too large */
    .nav-link {
        padding: var(--spacing-md) var(--spacing-lg); /* Reduce if needed */
        font-size: var(--fs-base); /* Reduce from var(--fs-lg) if too large */
    }

    /* Compact mobile CTA section */
    .nav-cta {
        margin: var(--spacing-md) 0 0 0; /* Reduce top margin */
        padding-top: var(--spacing-md); /* Reduce padding */
    }

    .nav-cta .btn {
        padding: var(--spacing-sm) var(--spacing-lg); /* Smaller button */
        font-size: var(--fs-base); /* Reduce from var(--fs-lg) */
    }
}