/* Header Component Styles */

/* Ensuring logo is clickable */
header .logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    z-index: 1001;  /* Higher than any other elements */
}

header .logo * {
    pointer-events: none; /* Ensure click events go to the parent anchor */
}

/* Make sure no elements are blocking the logo */
header::before, 
header::after {
    display: none;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 80px; /* Fixed height for consistent spacing */
    display: flex;
    align-items: center;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Increased padding for better spacing */
    width: 100%;
    max-width: 1200px; /* Add max-width for better control */
    margin: 0 auto; /* Center the container */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 100;
    position: relative;
    flex-shrink: 0; /* Prevent logo from shrinking too much */
    min-width: 200px; /* Ensure minimum space for logo */
}

.logo:hover {
    opacity: 0.9;
}

.logo-img {
    width: 50px;
    height: 50px;
    margin-left: 15px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h1 {
    font-size: 22px;
    color: var(--secondary-color); /* Gold color for company name */
    margin: 0;
    white-space: nowrap; /* Prevent text wrapping */
}

.logo-text p {
    font-size: 13px;
    color: var(--primary-color); /* Navy for subtitle */
    white-space: nowrap; /* Prevent text wrapping */
}

nav {
    display: flex;
    align-items: center;
    flex-shrink: 1; /* Allow nav to shrink when needed */
}

nav ul {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap; /* Prevent wrapping in normal view */
}

nav ul li {
    margin: 0 12px; /* Slightly reduced margin for better space usage */
    padding: 0;
    flex-shrink: 1; /* Allow items to shrink */
}

nav ul li:last-child {
    margin-right: 0;
}

nav ul li a {
    font-size: 16px;
    font-weight: 500;
    padding: 28px 3px; /* Reduced horizontal padding */
    transition: all 0.3s ease;
    display: block;
    position: relative;
    white-space: nowrap; /* Prevent text wrapping */
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--secondary-color); /* Gold color for active/hover links */
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 20px;
    left: 0;
    background-color: var(--secondary-color); /* Gold underline */
    transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 1002; /* Higher than nav menu */
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle:hover span {
    background-color: var(--secondary-color);
}

.mobile-menu-toggle.active span:nth-child(1),
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
    background-color: var(--secondary-color);
}

.mobile-menu-toggle.active span:nth-child(2),
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3),
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
    background-color: var(--secondary-color);
}

/* Add a larger hit area for better touch on mobile */
.mobile-menu-toggle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
}

/* Header responsive styles - Intermediate breakpoint for tablets/split screen */
@media (max-width: 1024px) and (min-width: 769px) {
    header .container {
        padding: 0 15px;
    }
    
    nav ul li {
        margin: 0 8px; /* Further reduce spacing */
    }
    
    nav ul li a {
        font-size: 15px; /* Slightly smaller font */
        padding: 28px 2px;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .logo-text p {
        font-size: 12px;
    }
    
    .logo-img {
        width: 45px;
        height: 45px;
    }
    
    /* Ensure mobile menu toggle stays hidden in this range */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* Ensure nav stays in desktop mode */
    nav {
        position: static !important;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        height: auto !important;
        background: none !important;
        box-shadow: none !important;
        flex-direction: row !important;
        padding: 0 !important;
        margin-top: 0 !important;
    }
    
    nav ul {
        flex-direction: row !important;
        width: auto !important;
    }
}

/* Enhanced mobile/tablet breakpoint - Match mobile-optimizations.css */
@media (max-width: 768px) {
    header {
        height: auto;
        min-height: 70px;
        position: sticky;
        top: 0;
        padding: 5px 0;
    }
    
    header .container {
        padding: 5px 15px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: #fff;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: 10px 0;
        margin-top: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1001;
    }

    nav.mobile-active {
        display: flex !important;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav ul li {
        margin: 0;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        padding: 15px 20px;
        display: block;
        width: 100%;
        font-size: 18px;
    }

    nav ul li a::after {
        bottom: 10px;
    }

    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Animation for nav items */
    nav.mobile-active ul li {
        animation: fadeInRight 0.5s ease forwards;
        animation-delay: calc(0.1s * var(--item-index, 0));
        opacity: 0;
    }
    
    nav ul li:nth-child(1) { --item-index: 1; }
    nav ul li:nth-child(2) { --item-index: 2; }
    nav ul li:nth-child(3) { --item-index: 3; }
    nav ul li:nth-child(4) { --item-index: 4; }
    nav ul li:nth-child(5) { --item-index: 5; }
    nav ul li:nth-child(6) { --item-index: 6; }
    nav ul li:nth-child(7) { --item-index: 7; }
    
    @keyframes fadeInRight {
        from {
            opacity: 0;
            transform: translateX(20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 576px) {
    nav ul {
        padding: 10px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 5px 10px;
    }

    .logo-text h1 {
        font-size: 18px;
    }

    .logo-text p {
        font-size: 12px;
    }

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

/* Logo hover fixes */
header .logo {
    color: inherit;
    text-decoration: none;
}

header .logo:hover,
header .logo:focus,
header .logo:active {
    text-decoration: none;
}

header .logo * {
    pointer-events: none;
}

header::before, 
header::after {
    pointer-events: none;
} 