/*easyrecrute-admin.css*/
.er-btn { border:1px solid #dcdcdc; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight:600; }
.er-btn-primary {border:1px solid #dcdcdc; background: #0b63d6; color:#fff !important; box-shadow:0 6px 18px rgba(11,99,214,0.12); }

.er-btn-ghost { background:transparent; border:1px solid #dcdcdc; color:#333; padding:2px 10px 2px 10px !important }
.er-btn-muted { background:#f5f5f6; color:#333; padding:2px 10px 2px 10px !important}
.easyrecrute-view-cv {
    background-color: #0b63d6; color: #fff !important;
}

select.easyrecrute-change-status {
    border: solid 1px #d7d7d7;
    background: #e6eeff;
    padding: 5px;
    color: #2563eb;
}


.easyrecrute-table thead th { font-weight:700; color:#222; }
.easyrecrute-table tbody tr:nth-child(odd) { background:#fff; }
.easyrecrute-table tbody tr:nth-child(even) { background:#fbfbfb; }
.easyrecrute-table td, .easyrecrute-table th { padding:10px; border-bottom:1px solid #eee; }

/* Modal */
#easyrecrute-modal { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:99999; }
#easyrecrute-modal::before { content:""; position:absolute; inset:0; background:rgba(0,0,0,0.45); }
#easyrecrute-modal .er-modal-inner { position:relative; z-index:2; width:90%; max-width:920px; background:#fff; border-radius:12px; box-shadow:0 20px 50px rgba(0,0,0,0.25); padding:18px; }
#easyrecrute-modal .er-modal-close {
    position: absolute;
    right: 12px;
    top: 10px;
    background: red;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #ffffff;
    border-radius: 50%;
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center;
    justify-content: center; 
}#easyrecrute-modal .er-modal-body { max-height:75vh; overflow:auto; }

/* Responsive tweaks */
@media (max-width: 800px) {
  .er-btn { padding:6px 8px; font-size:14px; }
  #easyrecrute-modal .er-modal-inner { padding:12px; }
}

/* small helper */
.er-internal-preview { font-size:13px; color:#444; }



/* Indicateur de tri plus visible */
th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

th[data-sort]:hover {
    background-color: #f5f5f5;
}

th[data-sort].sorted-asc,
th[data-sort].sorted-desc {
    background-color: #e3f2fd;
    font-weight: 600;
}

.sort-indicator {
    margin-left: 4px;
    color: #2196f3;
    font-weight: bold;
}



/* Transitions pour les lignes filtrées */
#easyrecrute-candidates-table tbody tr {
    transition: opacity 0.2s;
}

/* Amélioration de la recherche */
#easyrecrute-search {
    transition: border-color 0.2s;
}

#easyrecrute-search:focus {
    border-color: #2196f3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}



/* =========================
   EasyRecrute — Modern table
   ========================= */

:root{
  --er-bg: #fdfdfd;
  --er-surface: #f8fafc;
  --er-text: #111827;
  --er-subtext: #6b7280;
  --er-muted: #f3f4f6;
  --er-radius: 10px;
  --er-shadow: 0 4px 18px rgba(16,24,40,0.06);
}

/* Container */
#easyrecrute-candidates-table {
  width: 100%;
  border-collapse: separate;           /* permet l'espacement entre les lignes */
  border-spacing: 0 10px;              /* espace vertical entre les lignes */
  color: var(--er-text);
  background: transparent;
}

/* Override inline borders */
#easyrecrute-candidates-table th,
#easyrecrute-candidates-table td {
  border: none !important;
}

/* Header style */
#easyrecrute-candidates-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--er-subtext);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  background: transparent;
}

/* Rows — each row looks like a card (no dividing border) */
#easyrecrute-candidates-table tbody tr {
  background: var(--er-bg);
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
  transition: transform .10s ease, box-shadow .10s ease;
  height: 64px;
}

/* Hover effect */
#easyrecrute-candidates-table tbody tr:hover {
  transform: translateY(-3px);
  box-shadow: var(--er-shadow);
}

/* Cells */
#easyrecrute-candidates-table td,
#easyrecrute-candidates-table th {
  padding: 12px 16px;
  vertical-align: middle;
  background: transparent;
}

/* Rounded ends for the "card" row */
#easyrecrute-candidates-table tbody tr td:first-child {
  border-top-left-radius: var(--er-radius);
  border-bottom-left-radius: var(--er-radius);
}
#easyrecrute-candidates-table tbody tr td:last-child {
  border-top-right-radius: var(--er-radius);
  border-bottom-right-radius: var(--er-radius);
}

/* Column alignment helpers */
#easyrecrute-candidates-table td[data-col="name"] { text-align: left; width: 40%; }
#easyrecrute-candidates-table td[data-col="email"] { width: 22%; color: var(--er-subtext); font-size: 14px; }
#easyrecrute-candidates-table td[data-col="score"],
#easyrecrute-candidates-table th[data-sort="score"] { text-align: center; width: 90px; }
#easyrecrute-candidates-table td[data-col="date"],
#easyrecrute-candidates-table th[data-sort="created_at"] { text-align: center; width: 110px; color: var(--er-subtext); }

/* Candidate cell (avatar + name) */
.candidate-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.candidate-cell .avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--er-muted);
  flex: 0 0 44px;
}

/* Status badge styles */
.status-badge {
  display: inline-block;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  min-width: 82px;
  text-align: center;
  font-weight: 600;
  box-shadow: none;
}
.status-pending { background:#f59e0b; color:#111827; }
.status-selected { background:#10b981; color:#ffffff; }
.status-rejected { background:#ef4444; color:#ffffff; }
.status-interview { background:#6366f1; color:#ffffff; }
.status-hiring { background:#06b6d4; color:#042a2b; }

/* Actions */
.actions { text-align: right; }
.actions button {
  background: transparent;
  border: none;
  padding: 8px;
  margin-left: 6px;
  border-radius: 8px;
  cursor: pointer;
}
.actions button:hover { background: rgba(15,23,42,0.04); }

/* Sort indicator */
.sort-indicator {
  font-size: 12px;
  margin-left: 6px;
  opacity: 0.75;
}

/* Empty state */
#easyrecrute-candidates-table tbody tr td[colspan] {
  background: transparent;
  box-shadow: none;
  color: var(--er-subtext);
  padding: 28px;
}

/* Responsive: cache la colonne email sur petits écrans et réduit padding */
@media (max-width: 860px) {
  #easyrecrute-candidates-table thead th:nth-child(2),
  #easyrecrute-candidates-table tbody td[data-col="email"] {
    display: none;
  }
  #easyrecrute-candidates-table td,
  #easyrecrute-candidates-table th { padding: 10px 12px; }
  .candidate-cell .avatar { width:40px; height:40px; }
}



















/* ---------- Responsive table -> cards (mobile) ---------- */
@media (max-width: 860px) {
  /* masquer l'entête table sur mobile */
  #easyrecrute-candidates-table thead { display: none; }

  /* afficher les lignes comme des "cartes" */
  #easyrecrute-candidates-table,
  #easyrecrute-candidates-table tbody,
  #easyrecrute-candidates-table tr {
    display: block;
    width: 100%;
  }

  #easyrecrute-candidates-table tbody tr {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--er-bg);
    box-shadow: 0 2px 10px rgba(16,24,40,0.04);
    border-radius: 10px;
    overflow: hidden;
    height: auto;
  }

  /* Chaque cellule devient une ligne flexible : label (avant) + valeur (après) */
  #easyrecrute-candidates-table td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px !important;
    border-bottom: none !important;
  }

  /* étiquette générée depuis data-label */
  #easyrecrute-candidates-table td:before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--er-subtext);
    margin-right: 12px;
    flex: 0 0 42%;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* valeur (le contenu réel) */
  #easyrecrute-candidates-table td > * {
    flex: 1 1 auto;
  }

  /* actions doivent rester visibles et bien alignées */
  #easyrecrute-candidates-table td.er-actions-cell,
  #easyrecrute-candidates-table td[data-label="Actions"] {
    display:flex !important;
    flex-direction:column;
    align-items:flex-end;
    gap:8px;
  }
  #easyrecrute-candidates-table td.er-actions-cell .er-btn,
  #easyrecrute-candidates-table td[data-label="Actions"] .er-btn {
    padding:6px 10px;
    font-size:13px;
  }

  /* réduire padding et avatar */
  .candidate-cell .avatar { width:36px; height:36px; }

  /* cacher la colonne email si tu préfères (optionnel) */
  /* #easyrecrute-candidates-table td[data-label="Email"] { display: none; } */

  /* ajuster recherche / header */
  .easyrecrute-job-header { align-items:flex-start; gap:10px; }
  .easyrecrute-job-header > div:last-child { width:100%; min-width:0; }
}

/* Small tweaks for very small screens */
@media (max-width: 420px) {
  #easyrecrute-candidates-table td:before { flex-basis: 45%; font-size:12px; }
  #easyrecrute-candidates-table td { padding: 8px; }
  #easyrecrute-candidates-table td.er-actions-cell { align-items:flex-start; }
}



/* ============================================
   PAGINATION
   ============================================ */
.pagination-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
    min-width: 36px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #2196f3;
    color: #2196f3;
}

.pagination-btn.active {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
    font-weight: 600;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-info strong {
    color: #2196f3;
}

/* ============================================
   MODAL AMÉLIORÉ
   ============================================ */
#easyrecrute-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#easyrecrute-modal.open {
    display: flex;
    opacity: 1;
}

#easyrecrute-modal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

#easyrecrute-modal .er-modal-inner {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 920px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#easyrecrute-modal .er-modal-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    gap: 8px;
}

#easyrecrute-modal .er-modal-close {
    position: static;
    background: #ef4444;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ffffff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

#easyrecrute-modal .er-modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

#easyrecrute-modal .er-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ============================================
   BOUTONS D'ACTION
   ============================================ */
#easyrecrute-export-table,
#easyrecrute-print-table,
.easyrecrute-print-cv {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

#easyrecrute-export-table:hover,
#easyrecrute-print-table:hover,
.easyrecrute-print-cv:hover {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
    transform: translateY(-1px);
}

/* ============================================
   LOADER AMÉLIORÉ
   ============================================ */
#easyrecrute-loader {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

#easyrecrute-loader > div {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   CONTRÔLES RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .easyrecrute-controls {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .easyrecrute-controls > div {
        width: 100%;
    }
    
    .easyrecrute-controls > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .easyrecrute-controls button {
        flex: 1;
        min-width: 0;
    }
    
    .easyrecrute-pagination-wrap {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    #easyrecrute-modal .er-modal-inner {
        width: 95%;
        max-height: 95vh;
    }
    
    #easyrecrute-modal .er-modal-body {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .pagination-info {
        font-size: 13px;
    }
    
    .pagination-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }
    
    #easyrecrute-export-table span,
    #easyrecrute-print-table span {
        display: none;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#easyrecrute-candidates-table tbody tr {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   IMPRESSION
   ============================================ */
@media print {
    body * {
        visibility: hidden;
    }
    
    #easyrecrute-candidates-table,
    #easyrecrute-candidates-table * {
        visibility: visible;
    }
    
    #easyrecrute-candidates-table {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .easyrecrute-controls,
    .easyrecrute-pagination-wrap,
    .er-actions-cell,
    button,
    .er-btn {
        display: none !important;
    }
    
    #easyrecrute-candidates-table {
        box-shadow: none;
    }
    
    #easyrecrute-candidates-table tbody tr {
        page-break-inside: avoid;
    }
}

/* ============================================
   ÉTATS DE CHARGEMENT
   ============================================ */
.easyrecrute-candidates-wrap {
    position: relative;
}

.easyrecrute-candidates-wrap.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 5;
}

/* ============================================
   SÉLECTEUR PAR PAGE
   ============================================ */
#easyrecrute-per-page {
    background: white;
    cursor: pointer;
    font-weight: 500;
}

#easyrecrute-per-page:hover {
    border-color: #2196f3;
}

/* ============================================
   AMÉLIORATION VISUELLE DES BADGES DE STATUT
   ============================================ */
.easyrecrute-status-badge {
    transition: transform 0.2s ease;
}

.easyrecrute-status-badge:hover {
    transform: scale(1.05);
}

/* ============================================
   ÉTAT VIDE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    color: #374151;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}


/* ==================== STATS CARDS ==================== */
.easyrecrute-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* ==================== MATCH BADGES ==================== */
.er-match-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    margin-top: 6px;
}

.er-match-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Couleurs spécifiques par catégorie */
.match-fort {
    background: #10b981;
    color: #fff;
}

.match-moyen {
    background: #f59e0b;
    color: #fff;
}

.match-faible {
    background: #94a3b8;
    color: #fff;
}

.match-rejete {
    background: #ef4444;
    color: #fff;
}

/* ==================== VERSION BADGE ==================== */
.er-version-badge {
    font-size: 9px;
    background: #2563eb;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
    display: inline-block;
}

/* ==================== SCORE AMÉLIORÉ ==================== */
.er-score-wrapper {
    text-align: center;
}

.er-score-wrapper .er-score {
    font-weight: 700;
    font-size: 18px;
    color: #1a202c;
    line-height: 1.2;
    margin-bottom: 4px;
}

.er-score-wrapper small {
    color: #999;
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

/* ==================== FILTRE PAR CATÉGORIE ==================== */
#easyrecrute-filter-match {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#easyrecrute-filter-match:hover,
#easyrecrute-filter-match:focus {
    border-color: #2196f3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* ==================== RESPONSIVE STATS ==================== */
@media (max-width: 860px) {
    .easyrecrute-stats {
        grid-template-columns: 1fr !important;
    }
    
    .stat-card {
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .er-match-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .er-version-badge {
        display: block;
        margin: 4px 0 0 0;
        width: fit-content;
    }
}

/* ==================== PRINT - CATÉGORIES ==================== */
@media print {
    .easyrecrute-stats {
        display: none !important;
    }
    
    .er-match-badge,
    .easyrecrute-status-badge {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}