/* Variables globales */
:root {
    --primary-color: #0066b3;    /* Bleu principal */
    --secondary-color: #00a0e6;  /* Bleu secondaire */
    --accent-color: #ff6b00;     /* Orange pour les accents */
    --text-color: #333333;
    --light-gray: #f5f5f5;
    --white: #ffffff;
}

/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
}

/* Header et Navigation */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hero section */
.hero {
    background-image: url('img/corbeil-essonnes.jpg'); /* Image aérienne de Corbeil-Essonnes */
    background-size: cover;
    background-position: center;
    height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
}

.hero-content {
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    color: var(--white);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: var(--secondary-color);
}

/* Style pour le lien actif dans la navigation */
nav a.active {
    background-color: var(--secondary-color);
}

/* Sections principales */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    padding: 4rem 2rem;
}

section h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

/* Cartes et contrôles */
.map-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.map-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 1rem;
}

#map {
    flex: 1;
    height: 700px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#map-controls {
    width: 200px;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

#map-controls h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.layer-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.layer-control input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.layer-control label {
    cursor: pointer;
    user-select: none;
}

@media (max-width: 500px) {
    /* Header mobile */
    header {
        position: relative;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .header-text h1 {
        font-size: 1.5rem;
        margin: 1rem 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav a {
        display: block;
        padding: 0.5rem;
        border-radius: 4px;
        background: var(--light-gray);
    }

    /* Hero section mobile */
    .hero {
        height: 400px;
        margin-top: 0;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    /* Carte et contrôles mobile */
    .map-container {
        padding: 1rem;
    }

    .map-wrapper {
        flex-direction: column;
    }

    #map {
        height: 400px;
        width: 100%;
        margin-bottom: 1rem;
    }

    #map-controls {
        width: 100%;
        margin-top: 1rem;
    }

    .search-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    #search-btn {
        width: 100%;
    }

    /* Résultats de recherche mobile */
    .search-results {
        position: relative;
        margin-top: 0.5rem;
    }

    /* Formulaires mobile */
    .form-group {
        margin-bottom: 1rem;
    }

    input, select, textarea {
        width: 100%;
    }

    /* Forum mobile */
    .forum-header {
        flex-direction: column;
        gap: 1rem;
    }

    .topic-list {
        margin-top: 1rem;
    }

    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
}

/* Ajustements pour très petits écrans */
@media (max-width: 480px) {
    section {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }
}

/* Grille de données */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.data-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 4rem 2rem;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

/* Styles pour l'infobulle des quartiers */
#neighborhood-info {
    position: absolute;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    pointer-events: none;
    min-width: 150px;
    border: 1px solid #ccc;
}

#neighborhood-info h3 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

#neighborhood-info p {
    margin: 0;
    font-size: 0.9em;
}

/* Conteneur pour les détails des quartiers */
#neighborhood-details {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

#neighborhood-details ul {
    list-style: none;
    padding: 0;
}

#neighborhood-details li {
    margin: 0.5rem 0;
}

/* Formulaire de plainte */
.complaint-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-submit {
    text-align: center;
    margin-top: 2rem;
}

.submit-btn {
    background: var(--accent-color);
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #ff8533;
    transform: translateY(-2px);
}

/* Style pour le message de confirmation */
.confirmation-message {
    background-color: #2ecc71;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: none;
}

.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: none;
}

/* Styles pour le forum */
.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.forum-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.category-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.category-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-card {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 4px;
    transition: transform 0.2s;
    cursor: pointer;
}

.topic-card:hover {
    transform: translateX(5px);
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.topic-title {
    font-weight: bold;
    color: var(--primary-color);
}

.topic-meta {
    font-size: 0.9em;
    color: #666;
}

.topic-preview {
    color: #555;
    font-size: 0.95em;
}

.cancel-btn {
    background-color: #e74c3c;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 1rem;
}

.cancel-btn:hover {
    background-color: #c0392b;
}

/* Style pour les réponses */
.topic-responses {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--secondary-color);
}

.response-card {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

/* Style pour le bouton de réinitialisation de la carte */
.reset-view-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.reset-view-btn:hover {
    background-color: #f4f4f4;
}

/* Style pour les labels des zones */
.zone-label {
    background: none;
    border: none;
    box-shadow: none;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 14px;
    text-shadow: -1px -1px 0 #fff, 
                 1px -1px 0 #fff, 
                 -1px 1px 0 #fff, 
                 1px 1px 0 #fff;
}

/* Style pour la barre de recherche */
.search-container {
    position: relative;
    margin-bottom: 2rem;
    max-width: 600px;
}

#address-search {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#address-search:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,160,230,0.1);
}

#search-btn {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#search-btn:hover {
    background: #ff8533;
}

/* Style pour les résultats de recherche */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}