/* ==========================================================================
   Header Styles - Redesigned
   ========================================================================== */
:root {
    --header-height: 80px;
    --transition-speed: 0.4s;
    --easing: cubic-bezier(0.16, 1, 0.3, 1);
    --primary-color: #10b981;
    --text-color: #1a1a1a;
    --text-light: #666;
    --bg-color: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Base Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
        position: relative;
        gap: 1rem; /* Add gap between flex items */
    }

/* Responsive header container */
@media (max-width: 1200px) {
    .header-container {
        padding: 0 1.5rem;
        max-width: 1200px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1002;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-right: 5rem; /* Increased space between logo and menu toggle */
}

.logo:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.logo-img {
    height: 45px;
    width: auto;    
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column; /* Keep vertical stacking */
    align-items: flex-start; /* Align to left */
    line-height: 1.1;
    gap: 0.25rem; /* Small gap between main and subtitle */
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.logo-sub {
    font-size: 0.7rem; /* Slightly smaller for better fit */
    color: #64748b;
    letter-spacing: 0.8px;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping */
    line-height: 1; /* Tighter line height */
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    flex-wrap: nowrap;
    overflow: visible;
    margin-right: 2rem; /* Add space between nav links and CTA button */
}

/* Responsive navigation list */
@media (max-width: 1400px) {
    .nav-list {
        gap: 1.75rem;
        margin-right: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .nav-list {
        gap: 1.5rem;
        margin-right: 1.25rem;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .nav-list {
        gap: 1.25rem;
        margin-right: 1rem;
    }
}

.nav-link {
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    white-space: nowrap;
    display: inline-block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    position: relative;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    margin-left: 0.5rem; /* Add space from logo (reduced since logo margin increased) */
}

/* Menu Open State */
.menu-open .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-open .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Styles */
@media (max-width: 1023px) {
    .header {
        padding: 0;
    }

    .header-container {
        padding: 0 1.5rem;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.75rem;
        z-index: 1001;
        position: relative;
        width: 50px;
        height: 50px;
        border-radius: 0.5rem;
        transition: background-color 0.3s ease;
        margin-left: 1.5rem; /* Increased space from logo in mobile for better proportion */
    }

    .menu-toggle:hover {
        background-color: rgba(16, 185, 129, 0.1);
    }

    .hamburger {
        display: block;
        position: relative;
        width: 24px;
        height: 18px;
    }

    .hamburger-line {
        display: block;
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: var(--text-color);
        border-radius: 2px;
        transition: all 0.3s var(--easing);
    }

    .hamburger-line:nth-child(1) {
        top: 0;
    }

    .hamburger-line:nth-child(2) {
        top: 50%;
        transform: translateY(-50%);
    }

    .hamburger-line:nth-child(3) {
        bottom: 0;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0; /* Ensure right alignment */
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: calc(var(--header-height) + 2rem) 2rem 2rem;
        transform: translateX(100%); /* Start off-screen to the right */
        transition: transform 0.5s var(--easing);
        will-change: transform;
        z-index: 1000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15); /* Shadow from left side */
        pointer-events: auto; /* Ensure menu interactions work */
    }

    .menu-open .main-nav {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-bottom: 2rem;
        padding: 0;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 0;
        font-size: 1rem;
        color: var(--text-color);
        text-decoration: none;
        transition: all 0.3s ease;
        position: relative;
        cursor: pointer;
        pointer-events: auto; /* Ensure clicks work */
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-link:hover {
        color: var(--primary-color);
        padding-left: 0.5rem;
    }

    .nav-cta {
        margin-left: 1rem;
        flex-shrink: 0;
    }

    .nav-cta .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        font-weight: 600;
        border-radius: 0.5rem;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    }

    .nav-cta .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    .menu-overlay {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .menu-open .menu-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* Prevent scrolling when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .main-nav {
        display: flex !important;
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        padding: 0;
        transform: none;
        box-shadow: none;
        overflow: visible;
    }

    /* Ensure navigation links don't wrap on smaller laptops */
    .nav-link {
        min-width: max-content;
        flex-shrink: 0;
    }

    /* Reduce gap on smaller laptop screens */
    @media (max-width: 1200px) {
        .nav-list {
            gap: 1.5rem;
        }
    }

    /* Very small laptops - ensure minimum spacing */
    @media (max-width: 1024px) and (min-width: 769px) {
        .nav-list {
            gap: 1.25rem;
        }

        .nav-link {
            font-size: 0.95rem;
        }
    }
}