/* Consultation des réseaux de bus - Style RATP amélioré */

/* Style général */
.consultation-reseaux-bus {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ratp-title {
    color: #003366;
    text-align: center;
    margin-bottom: 30px;
}

.ratp-button {
    background-color: #003366;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
} 

.ratp-button:hover {
    background-color: #004080;
}

.ratp-button.small {
    padding: 5px 10px;
    font-size: 14px;
}

.ratp-button.primary {
    background-color: #e30613;
}

.ratp-button.secondary {
    background-color: #6c757d;
}

/* Onglets */
/* Version améliorée pour mobile */
.crb-tabs-container {
    position: relative;
    margin-bottom: 20px;
    z-index: 0; 
}

.crb-tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    display: flex;
    flex-wrap: wrap; /* Permet le retour à la ligne sur mobile */
    gap: 5px; /* Espacement entre les onglets */
    border-bottom: 2px solid #005baa; /* Couleur bleue RATP */
}

.crb-tabs li {
    margin: 0;
    flex: 1 1 auto; /* Permet aux onglets de s'adapter */
    min-width: 120px; /* Largeur minimale pour éviter un écrasement */
}

.crb-tabs li label {
    display: block;
    padding: 10px 8px; /* Padding réduit sur mobile */
    cursor: pointer;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    text-align: center;
    font-size: 14px; /* Taille de police réduite */
    white-space: nowrap; /* Empêche le retour à la ligne */
    overflow: hidden;
    text-overflow: ellipsis; /* Ajoute "..." si le texte est trop long */
    transition: all 0.3s ease;
}

.crb-tabs li label:hover {
    background: #e1e1e1;
}

.tab-content {
    display: none;
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
    background: #fff;
}

/* Style pour l'onglet actif */
.tab-radio:checked + label {
    background: #005baa; /* Bleu RATP */
    color: white;
    border-color: #005baa;
    position: relative;
    z-index: 1;
    margin-bottom: -1px;
}

.tab-radio:checked ~ .tab-content {
    display: block;
}

/* Adaptation spécifique pour mobile */
@media (max-width: 768px) {
    .crb-tabs {
        flex-wrap: nowrap; /* Empêche le retour à la ligne */
        overflow-x: auto; /* Permet le défilement horizontal */
        -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
        padding-bottom: 5px; /* Espace pour le scroll */
    }
    
    .crb-tabs li {
        flex: 0 0 auto; /* Désactive le flex grow pour mobile */
    }
    
    .crb-tabs li label {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Cache les radios sur mobile pour gagner de la place */
    .tab-radio {
        position: absolute;
        opacity: 0;
    }
}

/* Formulaires */
.ratp-form {
    margin-bottom: 20px;
}

.ratp-form-group {
    margin-bottom: 15px;
}

.ratp-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.select2-container {
    width: 100% !important;
    margin-bottom: 10px;
}

/* Sélecteur de direction */
.direction-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.direction-radio-group {
    display: flex;
    gap: 15px;
}

/* Assurer que les labels radio s'adaptent au contenu */
.direction-radio-group label {
    min-height: 44px; /* Hauteur minimale pour la zone cliquable */
    align-items: flex-start;
    display: flex;
    gap: 5px;
    cursor: pointer;
}


/* Style pour l'affichage des terminus multiples */
.direction-radio-group label span {
    display: block;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

.terminus-item {
    display: inline-block;
    background-color: #f0f8ff;
    padding: 2px 6px;
    margin: 2px 0;
    border-radius: 3px;
    font-size: 0.9em;
    border: 1px solid #d1e7ff;
}

.loading-text {
    color: #666;
    font-style: italic;
}

.direction-button-wrapper {
    align-self: flex-start; /* Aligne le bouton à gauche */
    margin-bottom: 10px;
}

/* Version mobile */
@media (max-width: 768px) {
    .direction-selector {
        gap: 5px;
    }
    
    .direction-radio-group {
        gap: 10px;
        flex-wrap: wrap; /* Permet le retour à la ligne si nécessaire */
    }
    
    .direction-button-wrapper {
        width: 100%; /* Prend toute la largeur */
        margin-bottom: 10px;
    }
    
    #detect-direction-btn {
        width: 100%; /* Bouton pleine largeur */
        padding: 8px 12px; /* Ajustement du padding */
    }
    
    .direction-radio-group label {
        min-height: 50px; /* Un peu plus haut sur mobile */
    }
    
    .terminus-item {
        font-size: 0.85em;
        padding: 1px 4px;
    }
}

@media (max-width: 480px) {
    .direction-radio-group {
        flex-direction: column;
        gap: 5px;
    }
}
 
/* Résultats */
.crb-result {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.crb-stop-list {
    padding-left: 20px;
}

.crb-direction-badge {
    background-color: #003366;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}

/* Style pour les résultats des prochains passages */
.crb-direction-departures {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.crb-direction-departures h5 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.crb-direction-departures ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crb-direction-departures li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 15px;
}

.crb-direction-departures li:last-child {
    border-bottom: none;
}

/* Horaires */
.crb-schedule-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.crb-schedule-item {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
}

.crb-next-departures {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.crb-next-departures h4 {
    margin-top: 0;
}

/* Correspondances */
.crb-correspondance-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.crb-correspondance-item {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
}

/* Groupes de coordonnées */
.crb-coordinates-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.crb-coordinate-group {
    flex: 1;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
}

.crb-coordinate-group h4 {
    color: #003366;
    margin-bottom: 10px;
    font-size: 16px;
}

.crb-coordinate-group ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.crb-coordinate-group li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.crb-coordinate-group li:last-child {
    border-bottom: none;
}

/* Styles pour l'affichage des horaires par direction */
.crb-line-schedule {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.crb-line-schedule h5 {
    margin-top: 0;
    color: #1e73be;
    border-bottom: 2px solid #1e73be;
    padding-bottom: 8px;
    font-size: 16px;
}

.crb-schedule-direction {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 3px;
    border-left: 3px solid #1e73be;
}

.crb-schedule-direction h6 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.crb-time-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.crb-time-list li {
    background: #1e73be;
    color: white;
    padding: 5px 12px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 14px;
    min-width: 55px;
    text-align: center;
}

.crb-time-list li:empty {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .crb-time-list {
        flex-wrap: wrap;
    }
    
    .crb-line-schedule {
        padding: 10px;
    }
    
    .crb-schedule-direction {
        padding: 8px;
    }
}

.crb-map-links {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Liste des lignes */
.crb-line-list {
    list-style: none;
    padding: 0;
}

.crb-line-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
 
/* Responsive */
@media (max-width: 768px) {
    .crb-coordinates-section {
        flex-direction: column;
    }
    
    .crb-correspondance-list {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------
Style pour la carte
---------------------------*/

/* Conteneur principal */
.consultation-reseaux-bus {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
}

/* Formulaire de sélection */
#crb-select-reseau {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

#crb-select-reseau label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 10px;
}

#crb-select-reseau select {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 16px;
    transition: border-color 0.3s;
}

#crb-select-reseau select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

#crb-select-reseau button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

#crb-select-reseau button:hover {
    background-color: #2980b9;
}

/* Contrôles de la carte */
.crb-map-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.crb-map-controls h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.crb-filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.crb-filter-group {
    margin-bottom: 15px;
}

.crb-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
}

.crb-filter-group input[type="radio"] + label {
    display: inline;
    margin-left: 8px;
    cursor: pointer;
}

.crb-filter-group input[type="text"],
.crb-filter-group input[type="number"],
.crb-filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}

.crb-small-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.crb-small-button:hover {
    background-color: #27ae60;
}

/* Carte */
#crb-carte-reseau {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

/* Style des popups Leaflet */
.leaflet-popup-content {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.leaflet-popup-content h3 {
    margin-top: 0;
    color: #3498db;
}

/* Responsive */
@media (max-width: 768px) {
    #crb-select-reseau {
        flex-direction: column;
        align-items: stretch;
    }
    
    #crb-select-reseau select {
        width: 100%;
        margin-bottom: 10px;
    }
    
    #crb-carte-reseau {
        height: 400px;
    }
    
    .crb-filter-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #crb-carte-reseau {
        height: 300px;
    }
    
    .consultation-reseaux-bus {
        padding: 10px;
    }
}

/* Animation de chargement */
.crb-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* Bouton géolocalisation actif */
.crb-get-location-active {
    background-color: #e74c3c !important;
}

/* Style pour l'indication du sens */
.crb-direction-badge.large {
    padding: 4px 10px;
    font-size: 16px;
    border-radius: 20px;
}

.crb-direction-badge.aller {
    background-color: #005baa;
    color: white;
}

.crb-direction-badge.retour {
    background-color: #e30613;
    color: white;
}

.crb-direction-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.crb-direction-note .note-text {
  display: block;  /* force le texte à s'empiler */
}

.crb-direction-note .note-direction {
  margin: 8px 0 0;
  font-size: 0.95em;
  color: #555;
}

/* style pour direction info */
.crb-direction-info {
  display: flex;
  align-items: flex-start;   /* aligne icône et texte */
  gap: 10px;                 /* espace entre icône et texte */
  background: #f0f8ff;       /* fond bleu très clair */
  border: 1px solid #b3d9ff; /* bordure légère */
  border-left: 5px solid #3399ff; /* barre colorée côté gauche */
  padding: 15px;
  border-radius: 8px;
  max-width: 95%;
  margin: 15px auto;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.crb-direction-info span {
  color: #0073aa;      /* couleur bleue pour l’icône */
  font-size: 20px;
  flex-shrink: 0;      /* empêche l’icône de rétrécir */
  margin-top: 3px;     /* ajuste l’alignement vertical */
}

.crb-direction-info p {
  white-space: normal;
  margin: 0;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .crb-direction-info {
    max-width: 300px;
    padding: 12px;
  }
}

/* Style résultats planification - inspiré RATP */
.crb-itineraire-bloc {
    border: 1px solid #ccc;
    padding: 1em;
    margin-bottom: 1.5em;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.crb-route-header {
    background-color: #003e72; /* Bleu RATP */
    color: white;
    padding: 12px 15px;
    border-radius: 4px 4px 0 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 0;
}

.crb-route-type {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.crb-route-steps {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}

.crb-route-steps li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 5px;
}

.crb-step-icon {
    margin-right: 8px;
    color: #003366;
}

.crb-step-label {
    font-weight: bold;
    color: #003366;
}

.crb-ligne-name {
    font-weight: bold;
    color: #003366;
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
}

.crb-arret-name {
    font-weight: bold;
    color: #d52b1e; /* Rouge RATP */
}

.crb-direction-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin: 0 5px;
}

.crb-direction-aller {
    background-color: #4CAF50; /* Vert pour Aller */
    color: white;
}

.crb-direction-retour {
    background-color: #2196F3; /* Bleu pour Retour */
    color: white;
}

.ratp-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #d52b1e; /* Rouge RATP */
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 15px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.ratp-button:hover {
    background-color: #b22222;
    color: white;
}

.ratp-button.small {
    font-size: 0.9em;
    padding: 6px 12px;
}


/* Mise en valeur des noms importants */
.crb-route-steps li strong {
    color: #003e72;
}

/* Message aucun résultat */
.crb-no-results {
    background-color: #fff8e1;
    padding: 15px;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
}

.crb-no-results p:first-child {
    font-weight: bold;
    margin-bottom: 10px;
}

.crb-no-results ul {
    margin-left: 20px;
    list-style-type: disc;
}

/* Détails du temps de trajet */
.crb-time-breakdown {
    margin: 10px 0 0 20px;
    list-style-type: none;
}

.crb-time-breakdown li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.crb-time-breakdown li:last-child {
    border-bottom: none;
}

.crb-time-estimation {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #0073aa;
}

.crb-time-estimation p {
    margin: 0;
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

.crb-time-details {
    margin-top: 10px;
}

.crb-time-details summary {
    color: #0073aa;
    cursor: pointer;
    font-weight: 500;
    outline: none;
}

.crb-time-details[open] summary {
    margin-bottom: 10px;
}

/* Styles pour l'affichage des départs par direction */
.crb-direction-group {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.crb-direction-group:hover {
    background-color: #e9ecef
    
    /* Style pour le badge "Départ de cet arrêt" */
.crb-direction-badge.departure {
    background-color: #27ae60;
    color: white;
    padding: 1px 4px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Style pour les départs terminus */
.crb-direction-group.terminus {
    border-left-color: #27ae60;
}

.crb-direction-group.terminus .crb-direction-title {
    color: #27ae60;
}

.crb-direction-group.terminus .crb-direction-title .dashicons {
    color: #27ae60;
}

/* Styles pour l'affichage unifié des terminus */
.crb-coordinate-group.terminus-single {
    background-color: #e8f5e8;
    border-left: 4px solid #27ae60;
}

.crb-line-directions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.crb-direction-details {
    margin-left: 20px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.crb-direction-subitem {
    display: block;
    padding: 4px 0;
    color: #555;
    font-size: 14px;
}

.crb-line-list li {
    padding: 15px;
    margin-bottom: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.crb-line-list li:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Style pour les badges de direction */
.crb-direction-badge {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 5px;
}

.crb-direction-badge.departure {
    background-color: #27ae60;
}

/* Animation pour les détails */
.crb-direction-details {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .crb-line-list li {
        padding: 12px;
    }
    
    .crb-line-directions {
        flex-direction: column;
    }
    
    .crb-direction-badge {
        margin-bottom: 5px;
    }
}

/* Styles pour l'affichage des départs par ligne */
.crb-ligne-departures {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.crb-ligne-departures:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.crb-ligne-title {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.crb-ligne-title .dashicons {
    color: #3498db;
    font-size: 24px;
}

.crb-departures-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crb-departures-list li {
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 6px;
    border-left: 3px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px; /* AJOUTER CETTE LIGNE POUR ESPACER LES ÉLÉMENTS */
    transition: all 0.2s ease;
}

.crb-departures-list li:hover {
    background-color: #e3f2fd;
    transform: translateX(5px);
}

.crb-departure-time {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
    min-width: 60px;
    flex-shrink: 0; /* EMPÊCHER LE RÉTRÉCISSEMENT */
}

.crb-departure-direction {
    color: #666;
    font-size: 14px;
    text-align: right;
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .crb-ligne-departures {
        padding: 12px;
    }
    
    .crb-ligne-title {
        font-size: 16px;
    }
    
        .crb-departures-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px; /* ESPACEMENT EN COLONNE */
        padding: 10px;
    }
    
    .crb-departure-direction {
        text-align: left;
        margin-left: 0;
        font-size: 13px;
    }
    
    .crb-departure-time {
        font-size: 15px;
    }
}

/* Animation */
.crb-ligne-departures {
    animation: slideInUp 0.4s ease;
}

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

/* Styles pour les directions des terminus */
.crb-terminus-directions {
    margin-bottom: 15px;
    padding: 12px;
    background-color: #e8f5e8;
    border-radius: 6px;
    border-left: 3px solid #27ae60;
}

.crb-terminus-directions h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.crb-terminus-directions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crb-terminus-directions li {
    padding: 6px 0;
    border-bottom: 1px solid #d4edda;
    font-size: 13px;
}

.crb-terminus-directions li:last-child {
    border-bottom: none;
}

/* Style pour la direction mixte (départ + direction) */
.crb-direction-mixed {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crb-direction-arrow {
    color: #666;
    font-size: 14px;
}

/* Amélioration responsive */
@media (max-width: 768px) {
    .crb-terminus-directions {
        padding: 10px;
    }
    
    .crb-direction-mixed {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* --- Style pour la fenêtre Popup (Modale) --- */

.crb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Caché par défaut */
    justify-content: center;
    align-items: flex-start; /* Alignement en haut pour le scroll */
    z-index: 99999; /* Z-index très élevé */
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Permettre le scroll */
}

.crb-modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    width: 100%;
    max-width: 750px;
    margin: 20px auto; /* Centrage avec marge */
    animation: modalFadeIn 0.3s ease;
}

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

.crb-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 100001;
}

.crb-modal-close:hover {
    color: #000;
}

/* Style pour l'indicateur de chargement */
.crb-modal-loading {
    position: relative;
}

.crb-modal-loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 8px;
}

.crb-modal-loading::after {
    content: "🔄 Veuillez patienter - recherche en cours...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #003366;
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 1001;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Empêcher le scroll du body quand la modale est ouverte */
body.crb-modal-open {
    overflow: hidden;
}

/* Style amélioré pour le contenu des résultats */
.crb-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px 5px;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .crb-modal-overlay {
        padding: 10px;
        align-items: flex-start;
    }
    
    .crb-modal-content {
        margin: 10px auto;
        padding: 20px 15px;
        max-width: 95%;
    }
    
    .crb-modal-body {
        max-height: 80vh;
    }
}

/* Améliorations UX générales */
.crb-error {
    background: #ffeaa7;
    border-left: 4px solid #e17055;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.crb-success {
    background: #55efc4;
    border-left: 4px solid #00b894;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

/* Animation pour les boutons en cours de chargement */
.ratp-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ratp-button.loading {
    position: relative;
    color: transparent;
}

.ratp-button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

/* Amélioration de l'accessibilité */
.crb-modal-content:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* États de hover pour les éléments interactifs */
.crb-departures-list li:hover,
.crb-line-list li:hover,
.crb-correspondance-item:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* style simple pour le texte de chargement */
.crb-loader-text {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2em;
    font-weight: bold;
    color: #003366;
}

/* style pour temps de trajet indisponible*/
.crb-time-unavailable {
    color: #e74c3c;
    font-weight: bold;
}

.crb-time-explanation {
    color: #7f8c8d;
    font-size: 0.9em;
    font-style: italic;
}

