/* Enseignants Liste Page - Modern UI/UX */

/* ========== PAGE HEADER ========== */
.enseignants-liste-header {
    background: #fff;
    padding: 10px 0 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
}

/* ========== FILTRES SECTION MODERNE ========== */
.filtres-container {
    background: #fff;
    padding: 5px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.filtre-statut-select {
    margin-top: 5px;
    background-color: #24b365 !important;
    color: white !important;
    font-weight: bold !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 15px !important;
    transition: all 0.3s ease !important;
}

.filtre-statut-select:hover {
    background-color: #218838 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3) !important;
}

.filtre-statut-select:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(40,167,69,0.2) !important;
}

.filtre-box {
    margin-top: 20px;
    display: flex;
    align-items: stretch;
}

.filtre-box > div {
    padding-left: 0;
    padding-right: 15px;
}

.filtre-box > div:last-child {
    padding-right: 0;
}

.filtre-box .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
    transition: all 0.3s ease;
    font-size: 14px;
    height: 42px;
    width: 100%;
}

.filtre-box .form-control:focus {
    border-color: #d9534f;
    box-shadow: 0 0 0 3px rgba(217,83,79,0.1);
    outline: none;
}

.filtre-box .select2-container--default .select2-selection--single {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    height: 42px;
    padding: 5px 15px;
}

.filtre-box .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px;
    color: #495057;
}

.filtre-box .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #d9534f;
}

.btn-search {
    background: #d9534f !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    color: white !important;
    height: 42px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search:hover {
    background: #c82333 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220,53,69,0.3) !important;
}

.btn-search i {
    margin-right: 8px;
}

/* ========== RESULTATS TOOLBAR ========== */
.filtre-search-tools {
    background: rgba(220,53,69,0.05);
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 15px;
}

/* ========== CARDS ENSEIGNANTS - DESIGN MODERNE ========== */
.enseignant-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.enseignant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: #d9534f;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.enseignant-card:hover::before {
    transform: scaleX(1);
}

.enseignant-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(220,53,69,0.12);
    border-color: rgba(220,53,69,0.2);
}

.enseignant-card-inner {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    gap: 12px;
    flex: 1;
}

/* Photo enseignant */
.enseignant-photo-wrapper {
    flex-shrink: 0;
    position: relative;
}

.enseignant-photo-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.enseignant-card:hover .enseignant-photo-circle {
    border-color: #d9534f;
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
    transform: scale(1.05);
}

.enseignant-photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.enseignant-card:hover .enseignant-photo-circle img {
    transform: scale(1.1);
}

/* Info enseignant */
.enseignant-info {
    flex: 1;
    min-width: 0;
}

.enseignant-title {
    margin-bottom: 4px;
    font-weight: 600;
    margin-top: 0;
}

.enseignant-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.enseignant-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #d9534f;
    transition: width 0.3s ease;
}

.enseignant-card:hover .enseignant-title a {
    color: #d9534f;
}

.enseignant-card:hover .enseignant-title a::after {
    width: 100%;
}

.enseignant-grade-label {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-block;
    flex-shrink: 0;
}

.enseignant-grade-label.label-danger {
    background: #d9534f;
    color: white;
}

.enseignant-grade-label.label-default {
    background: #6c757d;
    color: white;
}

.enseignant-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.enseignant-grade-full {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
    display: block;
}

.enseignant-detail {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.enseignant-detail i {
    width: 14px;
    text-align: center;
    color: #28a745;
    font-size: 11px;
}

.enseignant-detail.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlight pour recherche */
.enseignant-name mark {
    background: rgba(217,83,79,0.2);
    color: #d9534f;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* ========== PAGINATION MODERNE ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination > li > a,
.pagination > li > span {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 8px 14px;
    color: #6c757d;
    transition: all 0.3s ease;
    font-weight: 600;
}

.pagination > li > a:hover {
    background: #d9534f;
    border-color: #d9534f;
    color: white;
    transform: translateY(-2px);
}

.pagination > .active > a,
.pagination > .active > span {
    background: #d9534f;
    border-color: #d9534f;
    color: white;
}

.pagination > .disabled > a,
.pagination > .disabled > span {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 40px 0;
}

.empty-state i {
    font-size: 64px;
    color: #adb5bd;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 10px;
}

.empty-state p {
    color: #6c757d;
    font-size: 16px;
}

/* ========== CARDS ROW ALIGNMENT ========== */
/* Forcer la row parente à utiliser flexbox avec wrap */
.row.clearfix {
    display: flex;
    flex-wrap: wrap;
}

.enseignant-card-col {
    display: flex;
    margin-bottom: 15px;
}

/* La card prend toute la hauteur disponible dans sa colonne */
.enseignant-card-col > .enseignant-card {
    width: 100%;
    margin-bottom: 0;
}

/* ========== RESPONSIVE DESIGN ========== */
@media only screen and (max-width: 768px) {
    .filtre-box {
        flex-direction: column;
    }

    .filtre-box > div {
        width: 100%;
        padding-right: 0;
        margin-bottom: 10px;
    }

    .filtre-box > div:last-child {
        margin-bottom: 0;
    }

    /* Forcer une carte par ligne sur mobile */
    .enseignant-card-col {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .enseignant-card-inner {
        flex-direction: row;
        text-align: left;
        padding: 15px;
    }

    .enseignant-photo-circle {
        width: 70px;
        height: 70px;
    }

    .enseignant-card:hover {
        transform: translateY(-2px);
    }

    .filtres-container {
        padding: 20px 15px;
    }

    .filtre-search-tools {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* Pagination responsive sur mobile */
    .pagination {
        gap: 4px;
    }

    .pagination > li > a,
    .pagination > li > span {
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 6px;
    }
}

@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .enseignant-card-inner {
        padding: 18px;
        gap: 15px;
    }

    .enseignant-photo-circle {
        width: 95px;
        height: 95px;
    }
}

/* ========== LOADING STATE ========== */
.enseignant-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.enseignant-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #d9534f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========== SELECT2 CUSTOM STYLING ========== */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #d9534f !important;
}

.select2-container--default .select2-selection--single:focus {
    outline: none;
}

.select2-dropdown {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.select2-search--dropdown .select2-search__field {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #d9534f;
    outline: none;
}
