/* Header and Navigation Styles */
.main-nav {
    background: linear-gradient(135deg, #222936 0%, #222936 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border: none;
    outline: none;
}

.nav-container {
    max-width: 1600px; /* Increased to match container width */
    margin: 0 auto;
    padding: 0 2rem; /* Increased padding for desktop */
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0; /* Increased padding for thicker header */
    flex-wrap: wrap;
    position: relative;
}

/* Brand Logo */
.brand-logo {
    text-decoration: none;
    transition: var(--transition);
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
}

.logo-image {
    height: auto;
    max-height: 60px; /* Increased size for desktop */
    width: auto;
    max-width: 350px; /* Increased max width */
    transition: var(--transition);
    display: block; /* Better for SVG rendering */
    object-fit: contain; /* Maintain aspect ratio */
}

.brand-logo:hover {
    text-decoration: none;
    transform: scale(1.02);
}

.brand-logo:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    border: none;
    border-radius: 4px;
    transform: scale(1.02);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: white;
    margin: 2px 0;
    transition: var(--transition);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem; /* Increased gap between nav items */
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem; /* Increased padding for desktop */
    color: white;
    text-decoration: none;
    font-weight: 700; /* Bolder text */
    font-size: 0.9rem; /* Slightly larger text */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.375rem;
    transition: var(--transition);
    min-height: 44px; /* Increased height */
    border: none;
    outline: none;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.nav-link:focus {
    outline: none;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Search Container */
.search-container {
    margin-left: auto;
}

.search-form {
    position: relative;
    border: none;
    outline: none;
}

.header-search-input-container {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: none;
    outline: none;
}

.search-input {
    padding: 0.75rem 1rem; /* Increased padding */
    border: none;
    outline: none;
    font-size: 0.9rem; /* Slightly larger text */
    color: var(--text-color);
    background-color: transparent;
    width: 250px; /* Wider search input for desktop */
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.search-button {
    padding: 0.5rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    box-shadow: none;
}

.search-button:hover {
    background-color: var(--primary-hover);
}

.search-button:focus {
    outline: none;
    border: none;
    box-shadow: none;
    background-color: var(--primary-hover);
}

.search-button i {
    font-size: 0.875rem;
}

/* Header Search Suggestions */
.header-suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.header-suggestions-container.show {
    display: block;
}

.header-suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.header-suggestion-item:last-child {
    border-bottom: none;
}

.header-suggestion-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.header-suggestion-item.active {
    background-color: #e8f5e8;
}

.header-suggestion-icon {
    font-size: 1.2rem;
    color: #2c8462;
    margin-right: 12px;
    min-width: 20px;
}

.header-suggestion-content {
    flex: 1;
}

.header-suggestion-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: #333;
}

.header-suggestion-description {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
}

/* Mobile Navigation Styles */
@media (max-width: 1023px) {
    .nav-content {
        padding: 0.5rem 0;
    }

    .nav-container {
        overflow: visible;
    }

    .main-nav {
        overflow: visible;
    }

    .mobile-menu-toggle {
        display: flex;
        border: none;
        outline: none;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

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

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0.75rem;
        border: none;
        outline: none;
        min-height: 36px;
        font-size: 0.9rem; /* Ensure readable text size */
    }

    .search-container {
        margin-left: 0;
        width: 100%;
        position: relative;
        z-index: 999;
    }

    .search-form {
        width: 100%;
        border: none;
        outline: none;
        position: relative;
        z-index: 1000;
    }

    .header-search-input-container {
        width: 100%;
    }

    .search-input {
        flex: 1;
        width: auto;
        border: none;
        outline: none;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Ensure search suggestions appear on top on mobile */
    .header-suggestions-container {
        z-index: 10001;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }
}

/* Mobile Desktop Mode Navigation - Better handling for mobile browsers in desktop mode */
@media (max-width: 1023px) and (min-width: 768px) {
    .nav-container {
        padding: 0 1.5rem;
    }

    .logo-image {
        max-height: 55px; /* Increased size for tablet */
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
        min-height: 40px;
    }

    .search-input {
        width: 200px;
        font-size: 16px;
        padding: 0.6rem 0.8rem;
    }

    .search-button {
        padding: 0.6rem;
        min-height: 40px;
    }
}

/* Tablet Adjustments */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 0.75rem;
    }

    .logo-image {
        max-height: 40px; /* Responsive height for mobile */
    }

    .search-input {
        width: 150px;
        border: none;
        outline: none;
    }

    /* Ensure search suggestions appear on top on tablet */
    .header-suggestions-container {
        z-index: 10001;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }
}

/* Large Screen Optimizations */
@media (min-width: 1024px) {
    .nav-content {
        padding: 0.70rem 0; /* Maintain thicker header on desktop */
    }

    .nav-menu {
        display: flex !important;
        border: none;
        outline: none;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .nav-links {
        gap: 1.5rem; /* Larger gap for desktop */
    }

    .search-input {
        width: 250px; /* Maintain wider search */
    }
}

/* Extra Large Screen Optimizations */
@media (min-width: 1200px) {
    .nav-links {
        gap: 2rem; /* Even larger gap on very wide screens */
    }

    .search-input {
        width: 300px; /* Even wider search on large screens */
    }

    .logo-image {
        max-height: 45px; /* Slightly larger logo on very wide screens */
        max-width: 300px;
    }
}

/* Focus States for Accessibility */
.mobile-menu-toggle:focus {
    outline: none;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Remove any unwanted borders/outlines */
.main-nav *,
.main-nav *:before,
.main-nav *:after {
    box-sizing: border-box;
}

.main-nav,
.nav-container,
.nav-content,
.nav-menu,
.nav-links {
    border: none;
    outline: none;
    box-shadow: none;
}

/* Ensure no green lines appear */
.search-form *,
.search-container *,
.nav-menu * {
    border: none !important;
    outline: none !important;
}

.search-form:focus-within {
    outline: none;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .main-nav {
        border-bottom: 2px solid white;
    }

    .nav-link:hover {
        background-color: white;
        color: black;
    }

    /* Ensure logo is visible in high contrast mode */
    .logo-image {
        filter: brightness(1.2) contrast(1.2);
    }
}
