/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1565C0;
    --dark-blue: #0D47A1;
    --accent-orange: #E87511;
    --light-gray: #E8EEF3;
    --medium-gray: #666666;
    --text-dark: #2C3E50;
    --white: #FFFFFF;
    --border-gray: #D0D7DE;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--light-gray);
}

/* Navigation */
.navbar {
    background-color: var(--primary-blue);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px;  /* Augmentez de 1200px à 1400px */
    margin: 0 auto;
    padding: 0.5rem 2rem;  /* Corrigez : 0.5rem au lieu de 0 rem */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: opacity 0.2s;
    margin-left: 2rem;  /* AJOUTEZ CETTE LIGNE pour décaler vers la gauche */
}

.nav-brand:hover {
    opacity: 0.9;
}

.logo-image {
    width: 170px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-name {
    color: var(--white);
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    white-space: nowrap;  /* AJOUTEZ CETTE LIGNE pour éviter le retour à la ligne */
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin-left: auto;  /* Pousse le menu vers la droite */
    margin-right: 2rem;  /* Marge à droite */
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-menu a:hover {
    opacity: 0.85;
}

.search-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.search-icon-btn:hover {
    opacity: 0.85;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-toggle span {
    width: 28px;
    height: 3px;
    background-color: var(--white);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    height: 450px;
    background-image: url('kaysersberg5.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.2));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;

    padding: 0 2rem;
    color: var(--white);
    width: 100%;
}

.hero h1 {
    font-size: 3.5rem;
    font-family: 'Comic Sans MS';
    font-weight: 545;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 3px;
}

.hero p {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-explore {
    background-color: var(--accent-orange);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-explore:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 117, 17, 0.35);
}

/* Main Content */
.main-content {
    background-color: var(--light-gray);
}

/* Communes Section */
.communes-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    color: var(--primary-blue);
    font-family: 'Comic sans ms';
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.tab {
    background-color: transparent;
    color: var(--text-dark);
    border: 2px solid var(--border-gray);
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.tab svg {
    width: 12px;
    height: 8px;
}

.tab.active {
    background-color: var(--accent-orange);
    color: var(--white);
    border-color: var(--accent-orange);
}

.tab:not(.active) {
    background-color: var(--white);
}

.tab:not(.active):hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.tabs .tab:nth-child(2).active {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    position: relative;
}

.search-wrapper {
    position: relative;
    background-color: var(--white);
    border: 2px solid var(--border-gray);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    transition: border-color 0.3s;
}

.search-wrapper:focus-within {
    border-color: var(--primary-blue);
}

.search-icon {
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.search-input {
    flex: 1;
    border: none;
    padding: 1rem 0;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    background: transparent;
    color: var(--text-dark);
}

.search-input::placeholder {
    color: #999;
}

/* Autocomplete Dropdown */
.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 2px solid var(--border-gray);
    border-radius: 6px;
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 100;
}

.autocomplete-list.active {
    display: block;
}

.autocomplete-item {
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--light-gray);
    transition: background-color 0.2s;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #F5F8FA;
}

.autocomplete-item-name {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
}

.autocomplete-item-dept {
    color: var(--medium-gray);
    font-size: 0.85rem;
}

/* Communes Container */
.communes-container {
    max-width: 700px;
    margin: 0 auto;
}

.department-group {
    display: none;
}

.department-group.active {
    display: block;
}

.department-title {
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-gray);
}

.commune-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-gray);
    transition: background-color 0.2s;
}

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

.commune-item:hover {
    background-color: rgba(21, 101, 192, 0.03);
}

.commune-name {
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 500;
}

.play-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.play-btn:hover {
    transform: scale(1.08);
}

.play-btn svg circle {
    transition: fill 0.2s;
}

.play-btn:hover svg circle {
    fill: var(--dark-blue);
}

/* Géographie */
.geo-section {
    background-color: var(--white);
    padding: 4rem 2rem;
}

/* Info Section */
.info-section {
    background-color: var(--light-gray);
    padding: 1.5rem 2rem;
}

.info-card {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 12px;
    padding: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.info-illustration {
    flex-shrink: 0;
}

.info-content h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.info-content p {
    color: var(--medium-gray);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.btn-learn-more {
    background-color: var(--accent-orange);
    color: var(--white);
    border: none;
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-learn-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 117, 17, 0.35);
}

/* Media Section - On en parle */
.media-section {
    background-color: var(--white);
    padding: 4rem 2rem;
}

.media-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.media-card {
    background-color: var(--white);
    border: 2px solid var(--border-gray);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-blue);
}

.media-logo {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 1rem;
}

.media-logo img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
}

.media-card h3 {
    color: var(--primary-blue);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.media-card p {
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.media-date {
    color: var(--medium-gray);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: var(--white);
    padding: 2rem 2rem;
    border-top: 1px solid var(--border-gray);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    color: var(--medium-gray);
    font-size: 0.95rem;
}

.footer-text strong {
    color: var(--text-dark);
}

.footer-text a {
    color: var(--medium-gray);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-text a:hover {
    color: var(--primary-blue);
}

.social-icons {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none;
}

.social-link.facebook {
    background-color: #3B5998;
    color: var(--white);
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: var(--white);
}

.social-link:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--primary-blue);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

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

    .mobile-toggle {
        display: flex;
    }

    .hero {
        height: 350px;
    }

    .hero-content {
        margin-left: 0;
        padding: 0 1.5rem;
    }
    
    .hero h1 {
        letter-spacing: 1.5px;
        font-family: 'Comic Sans MS';
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .tabs {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tab {
        width: 100%;
        justify-content: center;
    }

    .info-card {
        flex-direction: column;
        padding: 2rem;
        text-align: center;
    }

    .media-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .logo-image {
        width: 45px;
        height: 45px;
    }

    .brand-name {
        font-size: 2.5rem;
    }

}

@media (max-width: 480px) {
    .hero h1 {
        letter-spacing: 1.5px;
        font-size: 2.5rem;
        font-family: 'Comic Sans MS';
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-content {
        margin-left: 0;
        padding: 0 1.5rem;
    }
    
    .hero h1 {
        letter-spacing: 1.5px;
    }

    .btn-explore {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .commune-name {
        font-size: 1rem;
    }

    .play-btn svg {
        width: 40px;
        height: 40px;
    }

    .logo-image {
        width: 25px;
        height: 25px;
    }

    .brand-name {
        font-size: 1.4rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* Scrollbar Styling */
.autocomplete-list::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-list::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

.autocomplete-list::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 4px;
}

.autocomplete-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-dark);
}
