/* ================================================
   RTTB Planning Conducteur - Styles
   ================================================ */

/* Container principal */
.rttb-planning-container {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tableau du planning */
.rttb-planning-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 10px !important;
    background: transparent !important;
    table-layout: fixed !important;
    display: table !important;
}

/* En-têtes des jours */
.rttb-planning-table thead {
    display: table-header-group !important;
}

.rttb-planning-table thead tr {
    display: table-row !important;
}

.rttb-planning-table thead th {
    display: table-cell !important;
    background: #2c3e50 !important;
    color: white !important;
    padding: 15px 10px !important;
    text-align: center !important;
    font-weight: bold !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    width: 20% !important;
    min-width: 180px !important;
    vertical-align: top !important;
}

/* Cellules des jours */
.rttb-planning-table tbody {
    display: table-row-group !important;
}

.rttb-planning-table tbody tr {
    display: table-row !important;
}

.rttb-planning-table tbody td {
    display: table-cell !important;
    vertical-align: top !important;
    background: #ffffff !important;
    border-radius: 5px !important;
    padding: 10px !important;
    min-height: 400px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    width: 20% !important;
}

/* Conteneur de jour */
.rttb-planning-day {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Jour vide / repos */
.rttb-planning-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    color: #999;
    font-style: italic;
}

/* Bloc d'activité */
.rttb-activity {
    padding: 12px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 13px;
    line-height: 1.5;
}

.rttb-activity:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Classe spéciale pour repos */
.rttb-activity.repos {
    background-color: #eeeeee !important;
    color: #666666 !important;
    text-align: center;
    font-size: 16px;
    padding: 20px;
}

/* Description de l'activité (titre principal) */
.rttb-activity-description {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Service */
.rttb-activity-service {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 13px;
}

/* Horaires */
.rttb-activity-time {
    margin: 3px 0;
    font-size: 13px;
}

.rttb-activity-time strong {
    min-width: 50px;
    display: inline-block;
}

/* Ligne */
.rttb-activity-ligne {
    margin-top: 5px;
    font-size: 12px;
    font-style: italic;
    opacity: 0.9;
}

/* Lieux */
.rttb-activity-location {
    margin-top: 5px;
    font-size: 12px;
    opacity: 0.85;
}

/* Notice d'information */
.rttb-planning-notice {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    color: #856404;
    text-align: center;
    margin: 20px 0;
}

/* ========================================
   SYSTÈME D'ONGLETS POUR MOBILE
   ======================================== */

/* Conteneur des onglets - caché par défaut sur desktop */
.rttb-tabs-navigation {
    display: none;
}

.rttb-tabs-content {
    display: none;
}

/* Responsive design */
@media screen and (min-width: 769px) {
    /* Desktop : affichage normal du tableau */
    .rttb-tabs-navigation,
    .rttb-tabs-content {
        display: none !important;
    }
    
    .rttb-planning-table {
        display: table !important;
    }
}

@media screen and (max-width: 768px) {
    /* Mobile : système d'onglets */
    .rttb-tabs-navigation {
        display: flex !important;
        gap: 5px;
        margin-bottom: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }
    
    .rttb-tab-button {
        flex: 0 0 auto;
        min-width: 100px;
        padding: 12px 15px;
        background: #ffffff;
        border: 2px solid #2c3e50;
        border-radius: 5px;
        color: #2c3e50;
        font-weight: bold;
        font-size: 13px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s;
        white-space: nowrap;
    }
    
    .rttb-tab-button:hover {
        background: #ecf0f1;
    }
    
    .rttb-tab-button.active {
        background: #2c3e50;
        color: white;
    }
    
    /* Masquer le tableau classique */
    .rttb-planning-table {
        display: none !important;
    }
    
    /* Container des jours en mode onglet */
    .rttb-tabs-content {
        display: block !important;
    }
    
    .rttb-tab-panel {
        display: none;
    }
    
    .rttb-tab-panel.active {
        display: block;
        animation: fadeIn 0.3s ease-in;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Style du jour en mode onglet */
    .rttb-tab-panel {
        background: white;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .rttb-day-header {
        background: #2c3e50;
        color: white;
        padding: 15px;
        border-radius: 5px;
        margin-bottom: 15px;
        text-align: center;
        font-weight: bold;
        font-size: 16px;
    }
    
    .rttb-planning-container {
        padding: 5px;
    }
    
    .rttb-activity {
        padding: 10px;
        font-size: 12px;
    }
    
    .rttb-activity-description {
        font-size: 13px;
    }
}

/* Impression */
@media print {
    .rttb-planning-container {
        box-shadow: none;
        background: white;
    }
    
    .rttb-activity {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .rttb-planning-table thead th {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
