/* Variables pour les couleurs pastel */
:root {
    --primary-color: #a8dadc; /* Bleu pastel */
    --secondary-color: #bde0fe; /* Mauve pastel */
    --accent-color: #cdb4db; /* Violet pastel */
    --text-color: #264653; /* Bleu foncé */
    --background-color: #f1faee; /* Blanc cassé */
    --button-color: #98d8d8; /* Vert pastel */
    --button-hover-color: #6b5b95; /* Violet foncé */
}
h1{
    color: var(--text-color);
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 20px;
}

body {
    margin: 0;
    padding: 20px;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}
/* Menu latéral */
.sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%); /* Par défaut, le menu est masqué */
    transition: transform 0.3s ease; /* Animation fluide */
    z-index: 1000; /* Assure que le menu est au-dessus de la carte */
}

.sidebar.visible {
    transform: translateX(0); /* Affiche le menu */
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 16px;
    color: var(--text-color);
    display: block;
    border-radius: 8px;
    margin: 10px;
    transition: background-color 0.3s ease;
    text-align: center;
}

.sidebar a:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Bouton pour afficher/masquer le menu */
.menu-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1100; /* Assure que le bouton est au-dessus du menu */
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: var(--button-hover-color);
}
.map-container {
    position: relative; /* Assure que la carte reste en dessous du menu */
    z-index: 0; /* Assure que la carte est en dessous du menu */
}
#map { 
    height: 400px; 
    width: 100%; 
    margin: 20px 0; 
}

.restaurant-item { 
    padding: 10px; 
    margin: 5px 0; 
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    /* Suppression de l'animation fadeInUp et opacity */
}

.restaurant-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.reviews-section {
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

/* Styles de la section de recherche */
.search-section {
    background: linear-gradient(to right, rgba(168, 218, 220, 0.8), rgba(189, 224, 254, 0.8));
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 60px auto 20px auto;
    width: 70%;
    max-width: 1200px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.search-controls {
    display: flex;
    gap: 15px; /* Augmenter l'espacement entre les éléments */
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    justify-content: center; /* Centrer les éléments */
}

.search-controls label {
    font-weight: 500;
    color: var(--text-color);
    margin-right: 5px;
}

.search-controls select,
.search-controls input {
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    width: 200px; /* Largeur fixe pour les inputs et selects */
    max-width: 100%;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-controls select:hover,
.search-controls input:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-controls select:focus,
.search-controls input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(205, 180, 219, 0.3);
}

.search-controls button {
    background: var(--button-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px; /* Largeur minimale pour les boutons */
}

.search-controls button:hover {
    background: var(--button-hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Styles des boutons */
button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-review-btn {
    background: #4CAF50;
    color: white;
}

.add-review-btn:hover {
    background: #45a049;
}

/* Styles des favoris */
.favorite-heart {
    color: #ccc;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
}

.favorite-heart.active {
    color: #e91e63;
}

.restaurant-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Système d'étoiles */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.star-rating label:before {
    content: '★';
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffd700;
    transform: scale(1.1);
}

.gold-star {
    color: #ffd700;
}

/* Styles pour les avis */
.review-form {
    display: none; /* Assurons-nous que c'est bien caché par défaut */
    margin-top: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    opacity: 0;
    transition: all 0.3s ease;
}

.review-form.visible {
    display: block !important;
    opacity: 1;
}

/* S'assurer que le style visible surpasse le display none */
.review-form.visible {
    display: block !important;
    opacity: 1;
}

/* Style du textarea */
.review-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.review-form textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(205, 180, 219, 0.3);
}

/* Style des boutons d'avis */
.add-review-btn {
    background: linear-gradient(to right, var(--button-color), var(--accent-color));
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 5px;
}

.add-review-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.add-review-btn[type="button"] {
    background: #f0f0f0 !important; /* Fond gris clair */
    color: #333 !important; /* Texte foncé */
    border: 1px solid #ddd !important; /* Bordure subtile */
}

.add-review-btn[type="button"]:hover {
    background: #e0e0e0 !important;
    color: #000 !important;
}

/* Style du conteneur des boutons */
.review-form-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

/* Styles pour le formulaire d'ajout de restaurant */
#addRestaurantForm {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#restaurantForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#restaurantForm label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#restaurantForm input,
#restaurantForm select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#restaurantForm .button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#restaurantForm button {
    flex: 1;
    padding: 10px;
}

/* Ajouter ces styles pour l'animation de chargement */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin: 20px 0;
}

/* Supprimer ces styles */
/*
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
*/

/* Optimiser le rendu des restaurants */
#restaurant_list {
    contain: content;
    /* Supprimer will-change qui peut causer des problèmes de rendu */
}

/* Style pour les avis cachés */
.hidden-review {
    display: none !important;  /* Force le masquage par défaut */
}

.hidden-review.visible {
    display: block !important;  /* Force l'affichage uniquement quand visible */
}

/* Style pour le bouton "Voir plus" */
.show-more-btn {
    background: var(--button-color);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    display: block;  /* Assure que le bouton est visible */
    width: auto;
}

.show-more-btn:hover {
    background: var(--button-hover-color);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .search-section {
        width: 90%;
        margin-top: 50px; /* Ajusté pour mobile */
        
    }
    .search-controls {
        flex-direction: column;
    }
    
    .search-controls > * {
        width: 100%;
    }
    
    #map {
        height: 300px;
        margin-left: 10px; /* Ajoute un décalage vers la droite */
        margin-right: 10px; 
    }
    .sidebar {
        width: 100%; /* Le menu prend toute la largeur sur téléphone */
        height: auto;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
    }

    .main-content {
        margin-left: 0;
        padding: 10px;
    }

    .menu-toggle {
        top: 10px;
        left: 10px;
    }
    #restaurant_list {
        margin-left: 10px; /* Ajoute un décalage vers la droite */
        margin-right: 10px; /* Ajoute un espace pour équilibrer */
    }
}
