/* Tableaux temps réel */
.transport-live-departures-board,
.transport-live-arrivals-board,
.transport-live-combined-board {
    background: #1a1a1a;
    color: #ffffff;
    border-radius: 10px;
    padding: 15px; /* Ajusté pour mobile */
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    overflow: hidden; /* Empêche le débordement */
}

.live-board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.live-board-header h2,
.live-board-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.3em; /* Ajusté */
}

.live-board-time {
    background: #0056b3;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1em; /* Ajusté */
}

/* Table styles */
.transport-live-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1em;
}

.transport-live-table th {
    background: #333;
    color: #fff;
    padding: 15px 10px;
    text-align: left;
    border-bottom: 2px solid #555;
    font-weight: bold;
}

.transport-live-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #333;
    vertical-align: middle;
}

/* Status colors */
.status-on-time { background: rgba(40, 167, 69, 0.1); }
.status-delayed { background: rgba(255, 193, 7, 0.1); }
.status-cancelled { background: rgba(220, 53, 69, 0.1); }
.status-boarding { background: rgba(0, 123, 255, 0.1); }
.status-departed { background: rgba(108, 117, 125, 0.1); }
.status-arrived { background: rgba(40, 167, 69, 0.2); }

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

tr.status-on-time .status-indicator { background: #28a745; }
tr.status-delayed .status-indicator { background: #ffc107; }
tr.status-cancelled .status-indicator { background: #dc3545; }
tr.status-boarding .status-indicator { background: #007bff; }
tr.status-departed .status-indicator { background: #6c757d; }
tr.status-arrived .status-indicator { background: #28a745; }

/* Time display */
.time-main {
    font-size: 1.3em;
    font-weight: bold;
}

.time-delay {
    color: #ffc107;
    font-size: 0.9em;
    font-weight: bold;
}

.time-cancelled {
    color: #dc3545;
    font-size: 0.9em;
    font-weight: bold;
}

/* Company logo */
.company-logo {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
}

.company-name {
    display: inline-block;
    vertical-align: middle;
}

/* Destination/Origin */
.city {
    font-weight: bold;
    font-size: 1.1em;
}

.station {
    color: #ccc;
    font-size: 0.9em;
}

/* Status reason */
.status-reason {
    color: #ffc107;
    font-size: 0.8em;
    margin-top: 5px;
    font-style: italic;
}

/* Footer */
.live-board-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    flex-wrap: wrap; /* Pour le responsive */
    gap: 10px;
}

.update-info {
    color: #6c757d;
}

.legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Pour le responsive */
}

.legend-item {
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Combined board */
.combined-board-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.departures-section,
.arrivals-section {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 8px;
}

.departures-section h3,
.arrivals-section h3 {
    color: #fff;
    margin: 0 0 15px 0;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
}

.departures-section h3 { background: #007bff; }
.arrivals-section h3 { background: #28a745; }

/* ⭐ AJOUT : Onglets pour la vue combinée (Mobile) */
.combined-tabs-nav {
    display: none; /* Caché sur desktop */
    width: 100%;
    margin-bottom: 15px;
}
.combined-tabs-nav .tab-link {
    flex: 1;
    padding: 12px;
    background: #333;
    color: #fff;
    border: none;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
}
.combined-tabs-nav .tab-link:first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}
.combined-tabs-nav .tab-link:last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}
.combined-tabs-nav .tab-link.active {
    background: #007bff;
}
.combined-tabs-nav .tab-link[data-tab="arrivals"].active {
    background: #28a745;
}

/* No results */
.no-departures,
.no-arrivals {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* ⭐ AJOUT : Bouton plein écran */
.fullscreen-toggle {
    background: #444;
    color: white;
    border: none;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    cursor: pointer;
    margin-right: 10px;
}
.fullscreen-toggle:hover {
    background: #007bff;
}

/* Fullscreen mode */
.transport-live-departures-board.fullscreen,
.transport-live-arrivals-board.fullscreen,
.transport-live-combined-board.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    overflow: auto;
    padding: 20px;
}

/* Styles pour les gares */
.departure-station,
.arrival-station {
    text-align: left;
}
.station-name {
    font-weight: bold;
    font-size: 1em;
}
.station-city {
    color: #ccc;
    font-size: 0.9em;
}


/*
========================================
⭐ SECTION RESPONSIVE AMÉLIORÉE ⭐
========================================
*/
@media (max-width: 992px) {
    /* Tablette */
    .transport-live-table {
        font-size: 0.9em;
    }
    .time-main {
        font-size: 1.1em;
    }
}

@media (max-width: 768px) {
    /* Mobile */
    
    .live-board-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .live-board-header h2,
    .live-board-header h3 {
        text-align: center;
    }
    
    .live-board-footer {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    .legend {
        justify-content: center;
    }

    /* Vue combinée en mode onglets */
    .combined-board-layout {
        grid-template-columns: 1fr; /* Passage en une colonne */
    }
    .combined-tabs-nav {
        display: flex; /* Afficher les onglets */
    }
    .departures-section h3,
    .arrivals-section h3 {
        display: none; /* Cacher les titres h3 (remplacés par les onglets) */
    }
    #combined-arrivals-section {
        display: none; /* Cacher la section arrivée par défaut */
    }

    /* ⭐ Transformation des tableaux en "fiches" */
    .transport-live-table {
        font-size: 0.9em;
    }
    
    .transport-live-table thead {
        display: none; /* Cacher les en-têtes */
    }
    
    .transport-live-table tr {
        display: block;
        border-bottom: 2px solid #555;
        margin-bottom: 15px;
        padding: 10px;
        background: rgba(255,255,255,0.02);
        border-radius: 5px;
    }
    
    .transport-live-table td {
        display: flex; /* Utiliser flex pour aligner label et contenu */
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px dotted #444;
        text-align: right;
    }
    
    .transport-live-table td:last-child {
        border-bottom: none;
    }

    .transport-live-table td::before {
        content: attr(data-label); /* Sera défini ci-dessous */
        font-weight: bold;
        color: #ccc;
        text-align: left;
        padding-right: 10px;
    }
    
    /* Définition des labels pour chaque tableau */
    
    /* 1. Tableau Départs (Combiné) */
    #combined-departures-content .transport-live-table td:nth-of-type(1)::before { content: 'Heure'; }
    #combined-departures-content .transport-live-table td:nth-of-type(2)::before { content: 'Destination'; }
    #combined-departures-content .transport-live-table td:nth-of-type(3)::before { content: 'Compagnie'; }
    #combined-departures-content .transport-live-table td:nth-of-type(4)::before { content: 'Statut'; }
    #combined-departures-content .transport-live-table td:nth-of-type(5)::before { content: 'Gare Départ'; }
    
    /* 2. Tableau Arrivées (Combiné) */
    #combined-arrivals-content .transport-live-table td:nth-of-type(1)::before { content: 'Heure'; }
    #combined-arrivals-content .transport-live-table td:nth-of-type(2)::before { content: 'Provenance'; }
    #combined-arrivals-content .transport-live-table td:nth-of-type(3)::before { content: 'Compagnie'; }
    #combined-arrivals-content .transport-live-table td:nth-of-type(4)::before { content: 'Statut'; }
    #combined-arrivals-content .transport-live-table td:nth-of-type(5)::before { content: 'Gare Arrivée'; }

    /* 3. Tableau Départs (Seul) */
    #transport-live-departures .transport-live-table td:nth-of-type(1)::before { content: 'Heure'; }
    #transport-live-departures .transport-live-table td:nth-of-type(2)::before { content: 'Destination'; }
    #transport-live-departures .transport-live-table td:nth-of-type(3)::before { content: 'Compagnie'; }
    #transport-live-departures .transport-live-table td:nth-of-type(4)::before { content: 'Statut'; }
    #transport-live-departures .transport-live-table td:nth-of-type(5)::before { content: 'Gare Départ'; }

    /* 4. Tableau Arrivées (Seul) */
    #transport-live-arrivals .transport-live-table td:nth-of-type(1)::before { content: 'Heure'; }
    #transport-live-arrivals .transport-live-table td:nth-of-type(2)::before { content: 'Provenance'; }
    #transport-live-arrivals .transport-live-table td:nth-of-type(3)::before { content: 'Compagnie'; }
    #transport-live-arrivals .transport-live-table td:nth-of-type(4)::before { content: 'Statut'; }
    #transport-live-arrivals .transport-live-table td:nth-of-type(5)::before { content: 'Gare Arrivée'; }

    /* Ajustements de style pour les "fiches" */
    .time-main { font-size: 1.1em; }
    .city { font-size: 1em; }
    .company-logo { display: none; } /* Cacher le logo pour gagner de la place */
}
