html.i18n-pending body {
    visibility: hidden;
}

@media (max-width: 700px) {
    .modal-content {
        width: 95vw !important;
        max-width: 98vw !important;
        min-width: 0 !important;
    }
}
/* Styles pour les sections pliables */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 15px 0;
    margin: 0;
    transition: all 0.3s ease;
}

.collapsible-header:hover {
    color: #a65902;
}

.collapse-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}

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

/* Forcer l'affichage des emojis dans tout le texte */
body, .card, .modal-content, .message-item {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Noto Color Emoji";
}

body {
    background-color: #f8faf9;
    color: #081c15;
    line-height: 1.6;
    padding-bottom: 50px;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    text-rendering: auto;

    -webkit-text-size-adjust: 100%;
}

/* Header */
.header {
    background: #a65902;
    color: white;
    padding: 6px 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
}

.app-icon-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.app-icon-link:hover {
    transform: scale(1.1);
}

.app-icon {
    width: 60px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}


.header .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Contenu principal */
.main-content {
    margin-top: 1px;
    padding: 1px;
    min-height: calc(100vh - 170px);
}

/* Navigation mobile */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(166, 89, 2, 0.95);
    border-top: 1px solid rgba(166, 89, 2, 0.2);
    display: flex;
    justify-content: space-around;
    padding: 5px 0;
    z-index: 3000;
    box-shadow: 0 -2px 10px rgba(166, 89, 2, 0.15);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 4px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
}

.nav-item.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-item:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-icon {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 2px;
}

/* Cartes */
.card {
    background: white;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

/* Formulaires */
.form-group {
    margin-bottom: 4px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: black;
}

.form-control {
    width: 100%;
    padding: 4px 8px;
    border: 2px solid #a65902;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #a65902;
    box-shadow: 0 0 0 3px rgba(166, 89, 2, 0.1);
}

/* S'assurer que les textarea ont la même police que les inputs */
textarea.form-control {
    font-family: inherit;
    font-size: 0.8rem;
    resize: vertical;
    min-height: auto;
}

/* Boutons */
/* Boutons */
.btn {
    padding: 3px 10px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: 40px; /* AccessibilitÃ© mobile */
}

.btn-primary {
    background: white;
    color: #a65902;
    width:100%;
    padding: 5px 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(166, 89, 2, 0.2);
    border: 2px solid #a65902;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 160, 23, 0.3);
}

.btn-secondary {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;   
    cursor: pointer;
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 160, 23, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    width: 100%;
}


/* Carte Leaflet */
#map {
    height: 300px;
    border-radius: 8px;
    margin: 15px 0;
}

/* Map toggle functionality */
.map-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.map-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.location-actions {
    display: flex;
    align-items: center;
}

.map-toggle-btn {
    background: #a65902;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.map-toggle-btn:hover {
    background: #a65902;
    transform: translateY(-1px);
}

.map-toggle-btn.active {
    background: #a65902;
}

.maplist-link {
    color: #a65902;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(200, 209, 211, 0.1);
}

.maplist-link:hover {
    color: #a65902;
    background: #aae3ae;
    transform: translateY(-1px);
}
.location-link {
display:flex;
    gap:10px;
    flex-wrap:wrap;
    color: #a65902;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    align-items: center;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;    
}

.location-link:hover {
     transform: translateY(-2px);
}

/* Conteneur principal des vues avec animation */
.view-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.view-container {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animation slide droite (carte -> liste) */
.view-container.slide-right {
    transform: translateX(-100%);
}

/* Animation slide gauche (liste -> carte) */
.view-container.slide-left {
    transform: translateX(100%);
}

/* Positionnement pour l'animation */
#map-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#list-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Etats pour l'animation */
#map-view.active {
    transform: translateX(0);
}

#map-view.inactive {
    transform: translateX(-100%);
}

#list-view.active {
    transform: translateX(0);
}

#list-view.inactive {
    transform: translateX(100%);
}

/* Conteneur parent pour le positionnement absolu */
#rides-container {
    position: relative;
    width: 100%;
    min-height: 400px; /* Hauteur minimale pour contenir les vues */
    overflow: hidden;
}

.map-hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    z-index: 1;
}

.map-visible {
    max-height: 250px;
    opacity: 1;
    overflow: visible;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    display: block;
    z-index: 10;
}

/* Liste des trajets */
.ride-list {
    list-style: none;
}

/* Styles pour les trajets */
.ride-card {
    background: white;
    border: 2px solid #a65902;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ride-card .ride-header {
    font-size: 0.85rem;
    line-height: 1;
    margin-bottom: 0px;
    color: #a65902;
}


.ride-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(166, 89, 2, 0.25);
    border-color: #a65902;
}

.ride-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(166, 89, 2, 0.2);
}

.ride-card .arrival-info {
    padding: 4px 8px;
    background: #f0f8f0;    
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1;
    color: #a65902;
    margin-bottom: 0;
}


/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Largeur modale desktop harmonisée */
/* Largeur modale desktop harmonisée */
.modal-content {
    background: white;
    border-radius: 12px;
    width: 80vw;
    max-width: 1100px;
    min-width: 600px;
    margin: 20px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
}
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-title {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

.modal button .fas,
.modal button .fa-solid,
.modal button .fa-regular {
    color: white !important;
}

/* Alertes */
.alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 0;
    min-width: 300px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
    font-weight: 500;
    text-align: center;
    box-sizing: border-box;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.alert-message {
    display: block;
}

.alert-close {
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    opacity: 0.9;
    padding: 0 2px;
}

.alert-close:hover,
.alert-close:focus {
    opacity: 1;
}

.alert.alert-manual-close {
    position: relative;
    padding-right: 38px;
    overflow: hidden;
}

.alert.alert-manual-close .alert-close {
    position: absolute;
    top: 8px;
    right: 10px;
}

.alert-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.28);
}

.alert-progress > i {
    display: block;
    width: 100%;
    height: 100%;
    background: #ffffff;
    transform-origin: left center;
    animation: alertTimer linear forwards;
}

#alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    width: auto;
    max-width: 90%;
    pointer-events: none;
}

#alert-container .alert {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-bottom: 10px;
    pointer-events: auto;
}

/* Types d'alertes */
div.alert.alert-success,
#alert-container .alert.alert-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
    color: white !important;
    border: 1px solid #28a745 !important;
}

div.alert.alert-error,
#alert-container .alert.alert-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border: 1px solid #dc3545 !important;
}

div.alert.alert-warning,
#alert-container .alert.alert-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #212529 !important;
    border: 1px solid #ffc107 !important;
}

div.alert.alert-info,
#alert-container .alert.alert-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: white !important;
    border: 1px solid #17a2b8 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes alertTimer {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}


/* Modale de partage */
.share-modal-content {
    text-align: center;
}
.share-link-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 15px 0;
    border-radius: 8px;
    background: #98e9ac;
}


/* Input groups pour le modal de succès */
.input-group {
    display: flex;
    gap: 5px;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.input-group .btn:hover {
    border-left: none;
}

.share-link-container input {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.share-buttons .btn {
    flex: 1;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #a65902;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Styles pour les dropdowns de suggestions de communes */

/* Conteneur principal du dropdown */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 300px; /* Augmenté pour afficher plus de suggestions */
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    pointer-events: auto; /* S'assurer que le dropdown reste cliquable */
}

/* Éléments de suggestion individuels */
.suggestion-item {
    padding: 4px 6px;
    cursor: pointer;
    border-bottom: 1px solid #859e8eff;
    font-size: 16px;
    border-radius: 8px;
    background-color: white;
    color: black;
    transition: all 0.2s ease;
}

/* État sélectionné/hover */
.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #a65902;
    color: white;
}


/* Conteneur parent positionné en relatif */
.form-group {
    position: relative;
    z-index: auto; /* Permettre aux éléments enfants de définir leur propre z-index */
}

/* Scrollbar personnalisée */
.suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}

.suggestions-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 1.6rem;
        margin: 0;
    }
    
    .event-expiration {
        font-size: 0.9rem;
    }
    
    .nav-item {
        font-size: 0.9rem;
        padding: 8px;
    }
    
    .nav-icon {
        font-size: 1.8rem;
        margin-bottom: 4px;
    }
    
    .main-content {
        max-width: 800px;
        margin: 2px auto 2px;
        padding: 0 1px;
    }
    
    .modal-content {
        max-width: 600px;
        max-height: 95vh;
    }
    
    .nav-item {
        font-size: 0.9rem;
    }
    
    .nav-icon {
        font-size: 1.8rem;
    }
    
    /* Desktop avec largeur normale - garantir le défilement */
    #list-view {
        height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #rides-container {
        min-height: calc(100vh - 150px);
        overflow: hidden;
    }
}

/* Mobile */
@media (max-width: 767px) {
    #list-view {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        padding-bottom: 60px; /* Espace pour la navigation mobile */
    }
    
    #rides-container {
        overflow: hidden;
    }
    
    .modal.active {
        padding: 0;
        align-items: stretch;
        width: 100%; /* Prendre toute la largeur */
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh; /* viewport height dynamique pour mobile */
        height: 100vh;
        height: 100dvh; /* viewport height dynamique pour mobile */
        width: 100%; /* Prendre toute la largeur */
        border-radius: 0;
        margin: 0;
        position: relative;
        transform: translateY(0);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
    }
    
    .modal-header {
        padding: 15px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
        touch-action: pan-y;
    }
    
    .modal-header.swiping {
        cursor: grabbing;
    }
    
    .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #d0d0d0;
        border-radius: 2px;
        transition: background 0.2s ease;
    }
    
    .modal-header:hover::before {
        background: #b0b0b0;
    }
    
    .modal-content.swipe-down {
        transform: translateY(100%);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease-out;
    }
    
    .modal-body {
        padding: 15px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-footer {
        padding: 15px;
        border-top: 1px solid #e0e0e0;
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 10;
    }
    
    .alert {
        top: 10px;
        min-width: 280px;
        max-width: 95%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    #alert-container {
        top: 10px !important;
        max-width: 95% !important;
    }

    .conversation-send-btn .send-label,
    #message-form button .send-label {
        display: none;
    }

    #send-message-btn .send-loading-label,
    .conversation-send-btn .send-loading-label,
    #message-form button .send-loading-label {
        display: none;
    }

    #send-message-btn .send-spinner-icon,
    .conversation-send-btn .send-spinner-icon,
    #message-form button .send-spinner-icon,
    #send-message-btn .fa-spinner.fa-spin,
    .conversation-send-btn .fa-spinner.fa-spin,
    #message-form button .fa-spinner.fa-spin {
        font-size: 0.85rem;
        line-height: 1;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 1000px;
    }
}

/* Utilitaires */
.text-center { text-align: center; }
.text-muted { color: #666; }
.mt-2 { margin-top: 10px; }
.text-important { color: #cf0e0e; }

/* Classes pour remplacer les styles inline */
.form-help {
    font-size: 0.875rem;
    color: #6c757d;
    display: block;
    margin-bottom: 0.5rem;
}

.form-help.margin-top {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.qr-code-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.qr-code-container > div {
    display: inline-block;
}


/* Styles pour le filtre par date */
#date-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    transition: border-color 0.3s ease;
    
}

#date-filter:focus {
    outline: none;
    border-color: #a65902;
    box-shadow: 0 0 0 2px rgba(166, 89, 2, 0.25);
}


.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
}

/* Responsive pour le filtre par date */
@media (max-width: 600px) {
    #date-filter {
        max-width: 100%;
        font-size: 13px;
        padding: 6px 10px;
        height: 38px;
    }
    
    .btn-sm {
        padding: 6px 8px;
        font-size: 12px;
    }
}
.mt-3 { margin-top: 15px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.hidden { display: none; }
