/**
 * Enseignant Tables - Styles communs pour les tables de données
 *
 * Ce fichier centralise les styles des tables utilisées dans les pages enseignant
 * pour éviter la duplication de CSS inline dans chaque fichier blade.
 *
 * @author ProGRES Team
 * @version 1.0.0
 */

/* ============================================
   TABLE BASE STYLES
   ============================================ */

.enseignant-table {
    font-family: 'Roboto', Arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
    background-color: #fff;
}

.enseignant-table th,
.enseignant-table td {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 10px 12px;
    vertical-align: middle;
}

.enseignant-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom-width: 2px;
}

.enseignant-table tr:nth-child(even) {
    background-color: #f5f5f5;
}

.enseignant-table tr:hover {
    background-color: #e9ecef;
}

/* ============================================
   TABLE RESPONSIVE WRAPPER
   ============================================ */

.table-responsive-enseignant {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Auto-responsive pour toutes les tables dans bloc-resume */
.bloc-resume > div:not(.titre),
.bloc-resume .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   ACTION COLUMNS (Modifier/Supprimer)
   ============================================ */

.enseignant-table .col-actions,
.bloc-resume table .col-actions {
    width: 50px;
    text-align: center;
    white-space: nowrap;
}

.enseignant-table .col-actions .btn,
.bloc-resume table .col-actions .btn {
    padding: 4px 8px;
    font-size: 14px;
}

/* En-têtes d'action avec icônes */
.bloc-resume table th.col-action-edit,
.bloc-resume table th.col-action-delete {
    width: 45px;
    text-align: center;
    padding: 8px 4px;
}

/* Icônes dans les en-têtes */
.bloc-resume table th .fa {
    font-size: 14px;
}

/* Tooltip pour les en-têtes d'action */
.bloc-resume table th[title] {
    cursor: help;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.table-empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.table-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.table-empty-state p {
    margin: 0;
    font-style: italic;
}

/* ============================================
   LEGACY SUPPORT - Styles pour les anciennes tables
   Ces styles permettent la rétrocompatibilité avec
   les tables existantes qui n'utilisent pas encore
   les nouvelles classes.
   ============================================ */

.bloc-resume table {
    font-family: 'Roboto', Arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
    background-color: #fff;
}

.bloc-resume table th,
.bloc-resume table td {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 10px 12px;
    vertical-align: middle;
}

.bloc-resume table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom-width: 2px;
}

.bloc-resume table tr:nth-child(even) {
    background-color: #f5f5f5;
}

.bloc-resume table tr:hover {
    background-color: #e9ecef;
}

/* ============================================
   TAB LOADING STATES
   ============================================ */

.tab-loader {
    padding: 3rem 1rem;
}

.tab-loader .spinner-border {
    color: #28a745 !important; /* Vert - Design System */
}

/* ============================================
   SECTION TITLES
   ============================================ */

.bloc-resume .titre {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    /* J'ai commenté */
    /* border-bottom: 2px solid #28a745; */ /* Vert - Design System */
}

.bloc-resume .titre span {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.bloc-resume .btn-save {
    background-color: #28a745; /* Vert - Design System */
    border-color: #28a745;
    color: #fff;
}

.bloc-resume .btn-save:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #fff;
}

.bloc-resume .btn-danger {
    background-color: #dc3545; /* Rouge - Design System */
    border-color: #dc3545;
    color: #fff;
}

.bloc-resume .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #fff;
}

/* ============================================
   PAGINATION STYLES
   ============================================ */

.bloc-resume .pagination {
    justify-content: center;
    margin-top: 1rem;
}

.bloc-resume .page-link {
    color: #333;
    border-color: #ddd;
}

.bloc-resume .page-item.active .page-link {
    background-color: #28a745; /* Vert - Design System */
    border-color: #28a745;
    color: #fff;
}

.bloc-resume .page-link:hover {
    background-color: #e9ecef;
    border-color: #ddd;
    color: #333;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .enseignant-table th,
    .enseignant-table td,
    .bloc-resume table th,
    .bloc-resume table td {
        padding: 8px;
        font-size: 0.9rem;
    }

    .bloc-resume .titre span {
        font-size: 1rem;
    }

    /* Masquer certaines colonnes sur mobile si nécessaire */
    .hide-on-mobile {
        display: none;
    }
}

/* ============================================
   LINKS IN TABLES
   ============================================ */

.enseignant-table a,
.bloc-resume table a {
    color: #28a745; /* Vert - Design System */
    text-decoration: none;
}

.enseignant-table a:hover,
.bloc-resume table a:hover {
    color: #1e7e34;
    text-decoration: underline;
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.status-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

.status-badge.status-active {
    background-color: #28a745;
    color: #fff;
}

.status-badge.status-inactive {
    background-color: #6c757d;
    color: #fff;
}

.status-badge.status-pending {
    background-color: #ffc107;
    color: #333;
}
