/* --- 1. STICKY HEADER & NAVIGATION --- */
header {
    background: #11253E;
    border-bottom: 2px solid #ceb888;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 5000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.navbar {
    display: flex;
    justify-content: center;
    height: 100%;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: #ceb888;
    text-decoration: none;
    font-weight: bold;
    padding: 10px;
    font-size: 1.1rem;
    transition: 0.3s;
}

/* Link Hover State */
.nav-links li a:not(.adv-btn):hover {
    background-color: darkblue;
    color: lightskyblue;
    border-radius: 5px;
}

/* Logo Hover Fix - No Blue Background */
.nav-logo-item a:hover,
.mobile-logo-link:hover {
    background-color: transparent !important;
}

.logo-inline {
    height:80px;
    width: auto;
    transition: 0.3s;
    display: block;
}

.logo-inline:hover { transform: scale(1.05); }

.adv-btn {
    background: #e67e22;
    color: white !important;
    padding: 8px 18px !important;
    border-radius: 5px;
    font-weight: 700;
}

/* --- 2. INTERACTIVE SEARCH BAR --- */
.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(184, 140, 92, 0.4);
    border-radius: 50px;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: #ceb888;
    box-shadow: 0 0 15px rgba(206, 184, 136, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 5px;
    outline: none;
    width: 200px;
    font-size: 1rem;
}

.search-btn {
    background: transparent;
    border: none;
    color: #b88c5c;
    cursor: pointer;
    font-size: 1.1rem;
}

/* --- 3. MEGA MENU CONTAINER --- */
.dropdown { position: relative; }

.dropdown-content {
    display: none;
    position: absolute;
    top: 250%;
    left: 168%;
    transform: translateX(-50%);
    background: #11253E;
    width: 700px;
    border: 1px solid rgba(206, 184, 136, 0.4);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    z-index: 6000;
}

.dropdown-content.show-menu { display: flex !important; }

.mega-wrapper {
    display: flex;
    width: 100%;
    height: 320px;
    overflow: hidden;
    align-items: stretch;
}

.district-sidebar {
    width: 250px;
    background: #0d1b2e;
    border-right: 1px solid rgba(206, 184, 136, 0.2);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.district-item {
    padding: 15px 20px;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    border-left: 4px solid transparent;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.district-item.active-district {
    background: rgba(206, 184, 136, 0.15);
    color: #ceb888;
    border-left-color: #ceb888;
}

/* --- 4. MEGA MENU CONTENT --- */
.town-display {
    flex: 1;
    padding: 25px 35px;
    background: #11253E;
    overflow-y: auto;
    height: 100%;
}

.town-group { display: none; }
.town-group.active-group {
    display: block !important;
    animation: slideIn 0.4s ease forwards;
}

.town-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.town-grid a {
    color: white;
    font-size: 0.95rem;
    opacity: 0.8;
    text-decoration: none;
    padding: 5px 0;
}

.town-grid a:hover { opacity: 1; color: #ceb888; transform: translateX(5px); transition: 0.2s; }

/* Enhanced Centered Titles */
h3.hub-title,
.district-hub-link {
    display: block !important;
    text-align: center !important;
    margin: 10px auto 20px auto !important;
    padding: 10px 20px !important;
    width: fit-content;
    min-width: 180px;
    background: rgba(206, 184, 136, 0.1);
    border: 1px solid #ceb888;
    color: #ceb888 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    border-radius: 30px; /* Pill Shape */
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s ease;
}

/* Update Hub Links to match the rest of the site hover style */
.district-hub-link:hover {
    background-color: darkblue !important; /* Dark Blue Background */
    color: lightskyblue !important;        /* Light Sky Blue Text */
    border-color: lightskyblue !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 139, 0.4);
}

/* --- 5. SEARCH RESULTS STYLING --- */

/* Search Results Header */
.search-header-container {
    max-width: 1000px;
    margin: 40px auto 20px auto;
    padding: 30px;
    background: rgba(17, 37, 62, 0.6);
    backdrop-filter: blur(10px);
    border-left: 4px solid #ceb888; /* Gold Accent Bar */
    border-radius: 10px;
    text-align: left;
}

.search-header-container h2 {
    color: white;
    font-size: 1.8rem;
    margin: 0;
}

.search-header-container .query-text {
    color: #ceb888;
    font-style: italic;
}

/* Individual Search Result Cards */
.search-result-item {
    background: rgba(17, 37, 62, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(184, 140, 92, 0.3);
    border-radius: 15px;
    padding: 25px 30px;
    margin: 0 auto 20px auto;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    transition: all 0.4s ease;
}

.search-result-item:hover {
    border-color: #ceb888;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: rgba(17, 37, 62, 1);
}

.result-content h3 {
    color: #ceb888;
    font-size: 1.4rem;
    margin: 5px 0;
}

.result-content p {
    color: #f4f4f4;
    opacity: 0.8;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.result-arrow {
    color: #ceb888;
    font-size: 1.2rem;
}

/* Category Badges for Search */
.category-badge {
    background: rgba(206, 184, 136, 0.15);
    color: #ceb888;
    border: 1px solid rgba(206, 184, 136, 0.3);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 8px;
}

/* Back Link on Results Page */
.back-link-container {
    max-width: 1000px;
    margin: 20px auto;
    text-align: left;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ceb888;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 15px;
    border: 1px solid rgba(206, 184, 136, 0.3);
    border-radius: 5px;
    background: rgba(17, 37, 62, 0.4);
    transition: 0.3s;
}

.back-btn:hover {
    background: #ceb888;
    color: #11253E;
    border-color: #ceb888;
}

/* Search Loading Spinner */
.search-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(184, 140, 92, 0.2);
    border-top: 5px solid #ceb888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 6. MOBILE HEADER RULES --- */
.mobile-logo-link, .logo-mobile, .hamburger { display: none; }
.desktop-only { display: block; }

@media (max-width: 768px) {
    header { height: 70px; }
    .navbar { justify-content: space-between; padding: 0 20px; }
    .mobile-logo-link, .logo-mobile, .hamburger { display: block; }
    .logo-mobile { height: 50px; width: auto; }
    .desktop-only { display: none !important; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- 7. TOWN LINK ENHANCEMENTS --- */
.town-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-bottom: 20px;
}

.town-grid a {
    color: white;
    font-size: 0.9rem;
    opacity: 1; /* Keeping text bright */
    text-decoration: none;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05); /* Subtle dark background */
    border: 1px solid rgba(206, 184, 136, 0.2); /* Faded gold border */
    border-radius: 8px; /* Slightly rounded corners */
    text-align: center;
    transition: all 0.3s ease;
    display: block;
}

/* Town Hover State - Becomes a Gold Pill */
.town-grid a:hover {
    background: rgba(206, 184, 136, 0.15);
    color: #ceb888;
    border-color: #ceb888;
    transform: scale(1.02); /* Slight pop out effect */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Small scrollbar styling for the town display area */
.town-display::-webkit-scrollbar {
    width: 6px;
}

.town-display::-webkit-scrollbar-track {
    background: #0d1b2e;
}

.town-display::-webkit-scrollbar-thumb {
    background: #ceb888;
    border-radius: 10px;
}
/* --- 8. COOKIE BANNER (Unified Design) --- */
.cookie-banner {
    position: fixed;
    bottom: 25px;
    left: 25px;
    right: 25px;
    background: #11253E; /* Matching Header Navy */
    color: white;
    padding: 20px 30px;
    border-radius: 25px; /* Theme Consistent Curve */
    border: 2px solid #ceb888; /* Header Gold */
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-text {
    text-align: left;
    flex: 1;
    min-width: 250px;
}

.cookie-text h4 {
    color: #ceb888;
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.cookie-text p {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.9;
}

.cookie-actions {
    display: flex;
    gap: 15px;
}

.cookie-btn {
    padding: 12px 28px;
    border-radius: 25px; /* Pill Shape Buttons */
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

/* Primary Accept Button */
.cookie-btn.accept {
    background: #ceb888;
    color: #11253E;
}

.cookie-btn.accept:hover {
    background-color: darkblue; /* Matches your Nav Hover */
    color: lightskyblue;       /* Matches your Nav Hover */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 139, 0.4);
}

/* Secondary Reject Button */
.cookie-btn.reject {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(206, 184, 136, 0.4);
}

.cookie-btn.reject:hover {
    background: rgba(206, 184, 136, 0.1);
    border-color: #ceb888;
    color: #ceb888;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .cookie-banner {
        bottom: 15px;
        left: 15px;
        right: 15px;
        padding: 20px;
    }
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    .cookie-text { text-align: center; }
    .cookie-actions { width: 100%; justify-content: center; }
    .cookie-btn { flex: 1; padding: 12px 10px; }
}
/* --- New Link Styling for Cookie Banner --- */
.cookie-policy-link {
    color: #ceb888;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s ease;
}

.cookie-policy-link:hover {
    color: lightskyblue;
    text-decoration: none;
}



.privacy-nav-link {
    color: #ceb888 !important; /* Gold to make it stand out */
    font-weight: bold;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid rgba(206, 184, 136, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .nav-links {
        display: none; /* Hide links by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 60px; /* Adjust based on your header height */
        left: 0;
        width: 100%;
        background-color: #11253e; /* Matches your theme */
        padding: 20px;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex; /* Show when hamburger is clicked */
    }

    .hamburger {
        display: block !important; /* Ensure hamburger is visible */
        cursor: pointer;
        font-size: 1.5rem;
        color: #ceb888;
    }

    .desktop-only {
        display: none; /* Hide desktop specific elements like the inline logo */
    }

    /* Stack the search bar on mobile */
    .search-container {
        width: 100%;
        margin-top: 15px;
    }

    .search-form {
        width: 100%;
        display: flex;
    }

    /* Simplify the Mega Menu for Mobile */
    .mega-dropdown .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
    }

    .mega-dropdown.active .dropdown-content {
        display: block;
    }
}
/* Ensure the navbar uses the full width */
.navbar {
    display: flex;
    align-items: center;
    justify-content: center; /* Initial center alignment */
    width: 100%;
    padding: 0 20px;
}

/* This wrapper handles the 3-column layout */
.nav-container-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes left, center, and right apart */
    width: 100%;
    max-width: 1400px; /* Adjust based on your design */
}

/* Make sure the logo is perfectly centered */
.nav-logo-centered {
    flex: 0 0 auto;
    text-align: center;
}

.nav-logo-centered img {
    max-height: 60px; /* Adjust size as needed */
    display: block;
    margin: 0 auto;
}

/* Ensure side menus take up equal space so center is true center */
.nav-left, .nav-right {
    flex: 1;
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-right {
    justify-content: flex-end; /* Align right links to the far right */
}
