/* assets/css/recrutement.css */

/* Style de l'en-tête de page */
.page-header-section {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 280px;
    padding: 0;
}

.header-overlay {
    width: 100%;
    min-height: 280px;
    background: linear-gradient(45deg, rgba(13, 33, 73, 0.9), rgba(20, 40, 80, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 60px 20px 40px 20px;
}

.page-header-section .container {
    position: static;
    z-index: 3;
}

.page-title {
    color: #fff;
    font-size: clamp(2.5rem, 5vw, 3.2rem);
    font-family: var(--font-secondary, 'Lora', serif);
    font-weight: 700;
    margin-bottom: 0.5em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 400;
    margin-bottom: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 5px rgba(0,0,0,0.15);
}

/* Conteneur du tableau de recrutement */
.recrutement-table-container {
    overflow-x: auto;
    margin: var(--spacing-xl, 3rem) 0;
    background: var(--color-background, #fff);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.12));
    padding: var(--spacing-l, 2rem);
    border: 1px solid var(--color-border, #eee);
}

/* Tableau de recrutement */
.recrutement-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--font-body, 'Poppins', sans-serif);
    background: transparent;
}

.recrutement-table th, 
.recrutement-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.95rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border, #eee);
}

/* En-tête du tableau */
.recrutement-table thead {
    background-color: var(--color-background-alt, #f8f9fa);
}

.recrutement-table th {
    color: var(--color-primary, #0d2149);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.8rem;
    border-top: 1px solid var(--color-border, #eee);
}

.recrutement-table th:first-child {
    border-top-left-radius: var(--radius-md, 12px);
}

.recrutement-table th:last-child {
    border-top-right-radius: var(--radius-md, 12px);
}

/* Corps du tableau */
.recrutement-table tbody tr {
    transition: background-color var(--transition-base, 300ms), transform var(--transition-base, 300ms);
}

.recrutement-table tbody tr:hover {
    background-color: rgba(212, 160, 23, 0.05); /* --color-accent with low opacity */
    transform: scale(1.01);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
    z-index: 10;
    position: relative;
}

.recrutement-table tbody tr:last-child td {
    border-bottom: none;
}

.recrutement-table tbody td {
    color: var(--color-text-secondary, #4a5568);
}

.recrutement-table tbody td:first-child {
    font-weight: 500;
    color: var(--color-text-primary, #1a1a1a);
}

/* Style pour les liens "Avis" */
.recrutement-table a.avis-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--color-primary, #0d2149);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm, 8px);
    font-weight: 500;
    transition: background-color var(--transition-base, 300ms), transform var(--transition-base, 300ms);
    text-align: center;
}

.recrutement-table a.avis-link:hover {
    background-color: var(--color-accent, #d4a017);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.06));
}

/* Style pour les badges "Étape" */
.etape-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full, 9999px);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.etape-badge.ouvert {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.etape-badge.ferme {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.etape-badge.en-cours {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

/* Centrage pour certaines colonnes */
.recrutement-table th.center-text,
.recrutement-table td.center-text {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .recrutement-table th, 
    .recrutement-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .header-overlay {
        min-height: 220px;
    }
}

@media (max-width: 480px) {
    .recrutement-table-container {
        padding: var(--spacing-s, 1rem);
    }

    .recrutement-table a.avis-link {
        padding: 0.4rem 0.8rem;
    }
}

/* ===================================
   CONTRÔLES DE RECHERCHE ET FILTRES
   =================================== */

.controls-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
}

.controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.controls-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary, #0d2149);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-title::before {
    content: "🔍";
    font-size: 1.5rem;
}

.results-count {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
}

.search-filter-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
    font-family: var(--font-body, 'Poppins', sans-serif);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent, #d4a017);
    box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.2rem;
    pointer-events: none;
}

.filter-select {
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 0.95rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body, 'Poppins', sans-serif);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-accent, #d4a017);
    box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.1);
}

.clear-filters-btn {
    padding: 0.875rem 1.5rem;
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body, 'Poppins', sans-serif);
}

.clear-filters-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===================================
   PAGINATION
   =================================== */

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.95rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.625rem 1rem;
    border: 2px solid #e9ecef;
    background-color: #fff;
    color: var(--color-primary, #0d2149);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: var(--font-body, 'Poppins', sans-serif);
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--color-accent, #d4a017);
    border-color: var(--color-accent, #d4a017);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-number {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e9ecef;
    background-color: #fff;
    color: var(--color-text-primary, #1a1a1a);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-number:hover {
    background-color: rgba(212, 160, 23, 0.1);
    border-color: var(--color-accent, #d4a017);
}

.page-number.active {
    background-color: var(--color-accent, #d4a017);
    border-color: var(--color-accent, #d4a017);
    color: #fff;
    font-weight: 600;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-size-selector label {
    font-size: 0.9rem;
    color: #6c757d;
}

.page-size-selector select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

/* ===================================
   BADGES AMÉLIORÉS
   =================================== */

.etape-badge.résultat-définitif {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.etape-badge.liste-des-candidats-admis-à-passer-l-épreuve-orale,
.etape-badge.liste-des-candidats-admis-à-passer-l-épreuve-écrite {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.etape-badge.avis-de-concours-de-recrutement {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* ===================================
   MESSAGE VIDE
   =================================== */

.no-results-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.no-results-message::before {
    content: "📋";
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-results-message p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 992px) {
    .search-filter-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .search-box {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .controls-section {
        padding: 1.5rem;
    }
    
    .search-filter-container {
        grid-template-columns: 1fr;
    }
    
    .controls-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pagination-container {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .controls-title {
        font-size: 1.1rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .page-number {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}
