:root {
    --nantes-green: #1e9bbb;
    --nantes-gold: #FAB700;
    --nantes-red: #C2201B;
    --light-gray: #f8f9fa;
    --dark-gray: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-gray);
}

/* =============================================
   HEADER
   ============================================= */
.header {
    background-color: var(--nantes-green);
    color: white;
    padding: 1rem 0;
    position: relative;
    overflow: hidden;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-align: center;
    flex-grow: 1;
}

.logo img {
    height: 80px;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.logo p {
    font-size: 1rem;
    opacity: 0.9;
}

/* =============================================
   SECTION HERO
   ============================================= */
.hero-section {
    padding: 2rem 0;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.hero-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

.filigrane-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(1px);
}

.hero-content {
    flex: 1;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: #2d5a3d;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.hero-image {
    flex: 1;
    position: relative;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    margin: 0 auto;
    display: block;
}

/* =============================================
   BOUTONS CTA
   ============================================= */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cta-primary {
    background-color: #ffc107;
    color: #2d5a3d;
}

.cta-primary:hover {
    background-color: #e6ac00;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.cta-secondary {
    background-color: white;
    color: #2d5a3d;
    border: 2px solid #2d5a3d;
}

.cta-secondary:hover {
    background-color: #2d5a3d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* =============================================
   SECTION ITINÉRAIRES
   ============================================= */
.section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.8rem;
    color: var(--nantes-green);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--nantes-gold);
    border-radius: 2px;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    justify-content: flex-end;
}

.items-per-page select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group-label {
    font-weight: 600;
    color: var(--dark-gray);
    text-align: center;
    margin-bottom: 0.3rem;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
}

.filter-btn.active {
    background-color: var(--nantes-green);
    color: white;
    border-color: var(--nantes-green);
}

.filter-btn:hover:not(.active) {
    background-color: #f0f0f0;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
}

.itineraries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* =============================================
   CARTES D'ITINÉRAIRE
   ============================================= */
.itinerary-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.itinerary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.itinerary-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.itinerary-image-container {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: #f5f5f5;
}

.itinerary-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.itinerary-card:hover .itinerary-image {
    transform: scale(1.05);
}

.classement-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.5);
}

.classement-badge.top-1 { background-color: gold; }
.classement-badge.top-2 { background-color: silver; }
.classement-badge.top-3 { background-color: #cd7f32; }

.classement-badge i {
    font-size: 1rem;
}

.view-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--nantes-green);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
}

.itinerary-card:hover .view-indicator {
    opacity: 1;
}

.itinerary-content {
    padding: 1.2rem;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.itinerary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.itinerary-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.itinerary-stats {
    display: flex;
    gap: 8px;
}

.duree, .niveau {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.facile { background-color: #e8f5e9; color: #2e7d32; }
.moyen { background-color: #fff3e0; color: #f57c00; }
.difficile { background-color: #ffebee; color: #c62828; }

.itinerary-title {
    color: var(--nantes-green);
    margin: 0 0 0.8rem;
    font-size: 1.3rem;
    line-height: 1.3;
}

.itinerary-description {
    margin: 0;
    color: #555;
    line-height: 1.4;
    font-size: 0.9rem;
    max-height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.itinerary-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #eee;
    z-index: 2;
}

.action-btn {
    background: none;
    border: none;
    color: var(--nantes-green);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 1;
    min-width: 0;
}

.action-btn:hover { color: var(--nantes-gold); }
.action-btn.active { color: var(--nantes-red); }

.btn-text {
    font-size: 0.7rem;
    margin-top: 3px;
    color: #666;
}

.vote-count, .comment-count {
    position: absolute;
    top: -2px;
    right: 0;
    min-width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    border-radius: 50%;
    background-color: rgba(30, 155, 187, 0.1);
    color: #333;
}

@keyframes voteAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

.voted-animation {
    animation: voteAnimation 0.5s ease;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 16px;
    margin: 0 4px;
    text-decoration: none;
    border-radius: 4px;
    color: var(--nantes-green);
    background-color: #f1f1f1;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--nantes-gold);
    color: var(--nantes-green);
}

.pagination .active {
    background-color: var(--nantes-green);
    color: white;
    font-weight: bold;
}

/* =============================================
   MODALE DES COMMENTAIRES
   ============================================= */
.comment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.comment-modal.active {
    display: flex;
}

.comment-modal .modal-content {
    background-color: white;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.comment-modal .modal-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, var(--nantes-green), var(--nantes-gold));
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.comment-modal .modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-modal .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.comment-modal .modal-close:hover {
    opacity: 0.8;
}

.comment-modal .comment-form-container {
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.comment-modal .comment-form-container h3 {
    color: var(--nantes-green);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-modal .user-comment-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.comment-modal .user-comment-header .comment-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--nantes-gold);
}

.comment-modal .user-comment-header .author-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--nantes-green);
}

.comment-modal #newComment {
    width: 100%;
    min-height: 80px;
    max-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.comment-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.comment-modal .submit-btn {
    background-color: var(--nantes-green);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.comment-modal .submit-btn:hover {
    background-color: #1a87a8;
}

.comment-modal .comments-list {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 220px);
}

.comment-modal .comment {
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #eee;
}

.comment-modal .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.comment-modal .comment-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-modal .comment-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--nantes-gold);
}

.comment-modal .author-name {
    font-weight: 600;
    color: var(--nantes-green);
    font-size: 0.9rem;
}

.comment-modal .comment-date {
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
}

.comment-modal .comment-content {
    color: #555;
    line-height: 1.5;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.comment-modal .comment-actions {
    display: flex;
    gap: 0.5rem;
}

.comment-modal .edit-comment-btn,
.comment-modal .delete-comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.comment-modal .edit-comment-btn {
    color: var(--nantes-green);
}

.comment-modal .edit-comment-btn:hover {
    background-color: rgba(30, 155, 187, 0.1);
}

.comment-modal .delete-comment-btn {
    color: #dc3545;
}

.comment-modal .delete-comment-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.comment-modal .login-prompt {
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
}

.comment-modal .login-btn {
    display: inline-flex;
    align-items: center;
    background-color: var(--nantes-green);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
}

.comment-modal .no-comments {
    text-align: center;
    color: #999;
    padding: 2rem 1rem;
}

/* =============================================
   MODALE DE PARTAGE
   ============================================= */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1003;
    justify-content: center;
    align-items: center;
}

.share-modal.active {
    display: flex;
}

.share-modal .modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.share-url-section {
    margin-bottom: 1.5rem;
}

.share-url-section p {
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.share-url-container {
    display: flex;
    margin-bottom: 1rem;
}

.share-url-input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.copy-button {
    padding: 0.8rem 1.2rem;
    background-color: var(--nantes-gold);
    color: var(--nantes-green);
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background-color: #e6a200;
}

.share-networks {
    text-align: center;
}

.share-networks p {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 500;
}

.network-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.network-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.network-icon.facebook { background-color: #3b5998; }
.network-icon.twitter { background-color: #1da1f2; }
.network-icon.instagram { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.network-icon.whatsapp { background-color: #25D366; }
.network-icon.email { background-color: #666; }

.network-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .hero-section .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-image {
        margin-top: 2rem;

    }

    .itineraries-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .btn-text {
        display: none;
    }

    .comment-modal .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .comment-modal .comments-list {
        padding: 1rem;
        max-height: calc(90vh - 200px);
    }

    .comment-modal #newComment {
        min-height: 70px;
        font-size: 0.85rem;
    }
}
/* =============================================
   CORRECTION DE LA LARGEUR ET DES FILTRES
   ============================================= */

/* Conteneur principal - largeur limitée */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Assure que le conteneur ne dépasse pas */
}

/* Section des itinéraires */
.section {
    margin-bottom: 3rem;
    width: 100%; /* Prend toute la largeur du conteneur */
}

/* Filtres - Conteneur flexible */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    width: 100%;
}

/* Groupe de filtres - plus compact */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
    max-width: 200px; /* Limite la largeur des groupes */
}

/* Boutons de filtre - permettent la multi-sélection */
.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
    font-size: 0.9rem;
}

.filter-btn.active {
    background-color: var(--nantes-green);
    color: white;
    border-color: var(--nantes-green);
}

.filter-btn:hover:not(.active) {
    background-color: #f0f0f0;
}

/* Bouton de réinitialisation */
.filter-btn.reset-btn {
    background-color: #f0f0f0;
    color: #666;
}

.filter-btn.reset-btn:hover {
    background-color: #e0e0e0;
}

/* Bouton "Voir sur la carte" */
.map-link-container {
    text-align: center;
    margin: 2rem 0;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 12px 24px;
    background-color: var(--nantes-gold);
    color: var(--nantes-green);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.map-link:hover {
    background-color: #e6a700;
    transform: translateY(-2px);
}

.map-link i {
    font-size: 1.2rem;
}