/* ============================================================
   STYLE.CSS - MySkillMetric 
   Version unifiée - Design moderne et professionnel
   Compatible avec tous les modules JS
   ============================================================ */

/* ===== IMPORTS & RESET ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== VARIABLES ===== */
:root {
    /* Couleurs principales */
    --primary: #1e4a76;
    --primary-dark: #0f3b5c;
    --primary-light: #eef2ff;
    --primary-rgb: 30, 74, 118;
    
    /* Couleurs secondaires */
    --secondary: #4f46e5;
    --secondary-dark: #4338ca;
    --secondary-light: #e0e7ff;
    
    /* États */
    --success: #10b981;
    --success-dark: #059669;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-dark: #2563eb;
    --info-light: #dbeafe;
    
    /* Neutres */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Ombres */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Arrondis */
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    
    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s ease;
}

/* ===== BASE ===== */
body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== TYPOGRAPHIE ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-800);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== SCROLLBAR PERSONNALISÉE ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== LOADER ===== */
#app-loader {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.4s ease;
}

/* ===== LOGIN SCREEN MODERNE ===== */
.login-screen {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--gray-100) 0%, var(--gray-200) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    max-width: 1100px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.login-brand {
    background: linear-gradient(125deg, #0f2b3d 0%, var(--primary) 100%);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.logo-circle {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.brand span {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.brand p {
    margin-top: 1rem;
    opacity: 0.8;
    font-size: 0.85rem;
}

.login-form {
    padding: 2.5rem;
    background: white;
}

.login-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-800);
}

.login-header p {
    color: var(--gray-500);
    margin: 0.5rem 0 1.5rem 0;
}

.role-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--gray-100);
    padding: 0.3rem;
    border-radius: var(--radius-2xl);
    margin-bottom: 1.5rem;
}

.role-tab {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-2xl);
    font-weight: 600;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
}

.role-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ===== FORMULAIRES ===== */
.form-group {
    margin-bottom: 1.25rem;
    width: 100%;
}

.form-group label, .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.input-wrapper, .input-icon {
    position: relative;
}

.input-wrapper i, .input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
}

.input-wrapper input, .input-icon input,
.form-control, select.form-control, textarea.form-control {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background: #fefefe;
    font-family: inherit;
}

.input-wrapper input:focus, .input-icon input:focus,
.form-control:focus, select.form-control:focus, textarea.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

textarea.form-control {
    padding: 0.85rem;
    resize: vertical;
    min-height: 80px;
}

.btn-login {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-slow);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-header span {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu li a, .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu li a i, .nav-link i {
    width: 1.3rem;
    font-size: 1rem;
}

.sidebar-menu li:hover a, .nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.sidebar-menu li.active a, .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info p {
    font-weight: 600;
    font-size: 0.85rem;
}

.user-info small {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.logout-btn, .btn-logout {
    background: var(--gray-100);
    border: none;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--danger);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover, .btn-logout:hover {
    background: var(--danger-light);
    color: var(--danger-dark);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--gray-100);
}

.top-bar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h2, #page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ===== CARTES ===== */
.card, .card-pro, .card-modern {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.card:hover, .card-pro:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* ===== STATS GRID ===== */
.stats-grid, .stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* ===== TABLEAUX ===== */
.table-container {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-200);
}

.data-table, .custom-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead, .custom-table thead {
    background: var(--gray-50);
}

.data-table th, .custom-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td, .custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.9rem;
}

.data-table tbody tr:hover, .custom-table tbody tr:hover {
    background: var(--gray-50);
}

/* ===== BOUTONS ===== */
.btn, .btn-pro, .btn-modern {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
}

.btn-primary, .btn-pro.btn-primary, .btn-primary-modern {
    background: var(--primary);
    color: white;
}

.btn-primary:hover, .btn-pro.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: var(--warning-dark);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-icon {
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--gray-500);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-edit:hover {
    color: var(--info);
    background: var(--info-light);
}

.btn-delete:hover, .text-danger:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.btn-assign:hover, .btn-reset:hover {
    color: var(--success);
    background: var(--success-light);
}

/* ===== BADGES ===== */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success, .bg-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning, .bg-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-danger, .badge-error, .bg-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-dark);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

.badge-light {
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ===== PAGES SPÉCIFIQUES ===== */
.categories-page, .questions-page {
    animation: fadeIn 0.3s ease;
}

.page-header, .page-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-filter-bar, .search-container {
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.actions-btns {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ===== PAGINATION ===== */
.pagination-bar, .pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.pagination-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ===== MODALS ===== */
.modal, .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active, .modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.modal-header h2, .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
    line-height: 1;
}

.btn-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--gray-50);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-in {
    animation: slideIn 0.3s ease;
}

.animate-scale-up {
    animation: scaleUp 0.2s ease;
}

/* ===== EXAMEN / PASSAGE DE TEST ===== */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.exam-header {
    background: var(--gray-800);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-info h2 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

#question-counter {
    font-size: 0.85rem;
    opacity: 0.8;
}

.exam-timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.exam-card {
    padding: 2rem;
    min-height: 400px;
}

.question-body {
    margin-bottom: 2rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.answer-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.answer-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.checkbox {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.25rem;
    transition: var(--transition);
}

.checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
    position: relative;
}

.checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.answer-text {
    flex: 1;
}

.exam-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    background: var(--gray-50);
}

.nav-btns {
    display: flex;
    gap: 1rem;
}

/* ===== CORRECTION ===== */
.correction-container {
    max-width: 900px;
    margin: 0 auto;
}

.correction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.correction-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.correction-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
}

.options-list {
    margin: 1rem 0;
}

.option-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.option-item.correct-answer {
    background: var(--success-light);
    color: var(--success-dark);
    border-left: 3px solid var(--success);
}

.option-item.wrong-answer {
    background: var(--danger-light);
    color: var(--danger-dark);
    border-left: 3px solid var(--danger);
}

.explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* ===== STATISTIQUES ===== */
.bi-candidat-item {
    transition: var(--transition);
    cursor: pointer;
}

.bi-candidat-item:hover {
    transform: translateX(4px);
}

.selected-row {
    background: var(--primary-light) !important;
    border-left: 3px solid var(--primary) !important;
}

/* ===== TUTORIELS ===== */
.dashboard-wrapper {
    padding: 1.5rem;
}

.test-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}

.test-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* ===== DIVERS ===== */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error, .alert-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
    border-left: 4px solid var(--success);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

.text-primary {
    color: var(--primary);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .login-card {
        grid-template-columns: 1fr;
    }
    
    .login-brand {
        display: none;
    }
}

@media (max-width: 768px) {
    .content-body {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .exam-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .exam-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-btns {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .pagination-bar {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .actions-btns {
        flex-wrap: wrap;
    }
}

/* ===== UTILITAIRES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar, .top-bar, .btn, .modal-footer, .header-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .content-body {
        overflow: visible;
    }
    
    .card, .table-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
/* ===== NOTIFICATIONS ===== */

/* Conteneur de notifications flottantes */
#notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Animation d'entrée pour les notifications */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation de sortie */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Style de base pour chaque notification */
.notification-item {
    animation: slideInRight 0.3s ease forwards;
}

.notification-item.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

/* Bouton de fermeture personnalisé */
.notification-item .fa-times {
    transition: color 0.2s;
}

/* ===== STYLES MANQUANTS POUR CERTAINS COMPOSANTS ===== */

/* Style pour les badges de comptage */
.badge-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--gray-600);
    margin-top: 5px;
}

/* Style pour les éléments de recherche */
.search-item {
    transition: background 0.2s;
}

.search-item:hover {
    background: var(--primary-light) !important;
}

/* Style pour les lignes sélectionnées dans les tableaux */
tr.selected-row,
tr.selected {
    background: var(--primary-light) !important;
}

/* Style pour les boutons de danger en outline */
.btn-danger-outline {
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

/* Style pour les badges de catégorie */
.badge-category {
    background: var(--info-light);
    color: var(--info-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Style pour les indicateurs de progression */
.progress-bar-container {
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    height: 6px;
}

.progress-bar-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Style pour les cartes de dashboard */
.dashboard-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Style pour les messages d'erreur dans les formulaires */
.form-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Style pour les champs de formulaire en erreur */
.form-control.error,
.input-wrapper input.error,
.input-icon input.error {
    border-color: var(--danger);
    background: var(--danger-light);
}

/* Style pour les tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

/* ===== RESPONSIVE POUR NOTIFICATIONS ===== */
@media (max-width: 480px) {
    #notification-toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .notification-item {
        width: calc(100% - 20px);
        max-width: none;
    }
}
/* ===== STYLES POUR LES CITATIONS DÉFILANTES ===== */

/* Conteneur des citations */
.quote-slider-container {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Icône de citation */
.quote-icon {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

/* Proverbe */
.quote-proverb {
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.5rem;
    font-weight: 500;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Histoire / Explication */
.quote-story {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Indicateur de défilement */
.quote-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.quote-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quote-dot.active {
    width: 20px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.9);
}

.quote-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}
/* ============================================================
   SECTION RESPONSIVE UNIFIÉE - MySkillMetric 4.0
   Optimisée pour l'expérience tactile et visuelle
   ============================================================ */

/* --- 1. BOUTON BURGER MODERNE (PC & MOBILE) --- */
.mobile-menu-btn {
    display: none; /* Masqué sur PC */
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 1.1rem;
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 12px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.mobile-menu-btn:active {
    transform: scale(0.92);
    background: rgba(var(--primary-rgb), 0.15);
}

/* --- 2. OVERLAY AVEC EFFET FLOU (GLASSMORPHISM) --- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 59, 92, 0.4); /* Bleu nuit transparent */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --- 3. TABLETTES & MOBILES LARGES (max-width: 992px) --- */
@media (max-width: 992px) {
    #app-container {
        flex-direction: column;
    }

    .mobile-menu-btn {
        display: flex; /* Activation du burger */
    }

    /* Sidebar : Mode Drawer avec ombre portée douce */
    .sidebar {
        position: fixed !important;
        left: -290px; /* Légèrement plus loin pour cacher l'ombre */
        top: 0;
        bottom: 0;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1000;
        background: var(--primary-dark) !important;
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.2);
        padding: 24px 18px !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex !important;
        flex-direction: column;
    }

    /* Utilisation de translate pour plus de fluidité matérielle */
    .sidebar.active {
        transform: translateX(290px);
    }

    /* Top Bar Mobile */
    .top-bar {
        padding: 0 16px;
        height: 65px;
        background: #ffffff;
        border-bottom: 1px solid #edf2f7;
        justify-content: flex-start;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 900;
    }

    #page-title {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--primary-dark);
    }

    /* Grilles adaptatives */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
}

/* --- 4. SMARTPHONES (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Optimisation des tableaux (Scroll horizontal propre) */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        box-shadow: inset 0 0 0 1px #edf2f7;
    }

    /* Player d'Examen Mobile */
    .content-body {
        padding: 12px !important;
    }

    .exam-card-main {
        padding: 20px 15px !important;
        border-radius: 16px !important;
    }

    .question-text {
        font-size: 1.1rem !important;
        font-weight: 600;
    }

    /* Actions en bas d'écran (UX Mobile First) */
    .exam-footer {
        flex-direction: column-reverse;
        gap: 12px;
        padding-top: 15px;
    }

    .exam-footer button {
        width: 100% !important;
        height: 52px;
        font-size: 1rem;
        border-radius: 12px;
    }

    /* Login & Citations */
    .login-card {
        padding: 25px 20px !important;
        border-radius: 20px;
    }

    .quote-slider-container {
        min-height: 160px;
        background: rgba(255, 255, 255, 0.12);
        margin-top: 1.5rem;
    }
}

/* --- 5. OPTIMISATION TACTILE (FAT FINGERS) --- */
@media (pointer: coarse) {
    /* Agrandit les cibles de clic sans changer le design */
    .sidebar-menu li a, 
    .btn, 
    .icon-btn, 
    .option-item {
        min-height: 52px;
        padding: 10px 15px;
    }

    input[type="checkbox"], 
    input[type="radio"] {
        width: 24px;
        height: 24px;
    }
    
    /* Scrollbar invisible mais fonctionnelle pour un look épuré */
    .sidebar-nav::-webkit-scrollbar {
        width: 0px;
    }
}

/* ============================================================
   EXTENSIONS POUR LA GESTION DES MÉDIAS (TUTORIELS)
   ============================================================ */

/* Bouton d'assignation spécifique (Teal/Emeraude) */
.btn-assign {
    color: #0d9488 !important;
    background: rgba(13, 148, 136, 0.05);
    margin-right: 4px;
}
.code-badge {
    background: #f1f5f9;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}

.btn-assign:hover {
    background: rgba(13, 148, 136, 0.15) !important;
    color: #0b7a6f !important;
    transform: translateY(-2px);
}

/* Badge de compteur pour les candidats assignés */
.badge-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Style pour l'aperçu rapide de la vidéo */
.btn-link-preview {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 0;
    font-weight: 600;
    text-align: left;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-link-preview:hover {
    color: var(--secondary-dark);
    text-decoration: underline;
}

/* --- OPTIMISATION MODALE D'ASSIGNATION --- */
#assignment-modal-overlay .modal-content {
    border-top: 5px solid #0d9488; /* Rappel de la couleur d'assignation */
}

.assign-row:hover {
    background-color: #f8fafc;
}

/* Switch de sélection rapide (si utilisé à la place des checkbox) */
.switch-sm {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch-sm input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px; 
    width: 14px;
    left: 3px; 
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%; /* Vérifiez que '50%;' est bien présent */
}

input:checked + .slider {
    background-color: #0d9488;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.btn-assign { color: #0d9488 !important; }
.btn-assign:hover { background: rgba(13, 148, 136, 0.1) !important; }
.badge-outline { 
    border: 1px solid #e2e8f0; 
    color: #64748b; 
    font-size: 0.75rem; /* Augmenté légèrement */
    padding: 2px 8px; 
    border-radius: 12px;
    font-weight: 500;
    display: inline-block;
}
.btn-link-preview { 
    background: none !important; 
    border: none;
    color: var(--secondary);
    text-decoration: none;
    cursor: pointer;
}
/* ============================================================
ANIMATIONS DE CHARGEMENT & TRANSITIONS (V5.0)
============================================================ */

/* Transition fluide pour le conteneur principal */
#main-content {
    transition: opacity 0.3s ease-in-out;
    /* Ajoutez ceci pour éviter les sauts de page */
    min-height: 100vh; 
    overflow-x: hidden;
}

/* Animation d'entrée des composants */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(12px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Loader Style Managem */
.loader-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    width: 100%;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(30, 74, 118, 0.1); /* Fond léger bleu */
    border-top: 4px solid var(--primary);    /* Bleu Managem officiel */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 

/* ============================================================
   STYLES SPÉCIFIQUES PAGES QUESTIONS (cohérents avec candidats)
   ============================================================ */

   .questions-page .data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.questions-page .data-table th {
    background: #f8fafc;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.questions-page .data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.questions-page .data-table tr:hover {
    background: #f8fafc;
}

/* Badges spécifiques questions */
.questions-page .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.questions-page .badge-primary { background: #dbeafe; color: #1e40af; }
.questions-page .badge-warning { background: #fed7aa; color: #9a3412; }
.questions-page .badge-success { background: #dcfce7; color: #166534; }
.questions-page .badge-error { background: #fee2e2; color: #991b1b; }
.questions-page .badge-info { background: #e0f2fe; color: #075985; }
.questions-page .badge-outline { background: #f1f5f9; color: #475569; }

.questions-page .code-badge {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    color: #1e293b;
}

/* Actions buttons questions */
.questions-page .actions-btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.questions-page .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: opacity 0.2s;
}

.questions-page .btn-icon:hover {
    opacity: 0.7;
}

.questions-page .btn-edit {
    color: #4f46e5;
}

.questions-page .btn-delete {
    color: #ef4444;
}

/* Barre de recherche questions */
.questions-page .search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.questions-page .search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.questions-page .search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.questions-page .search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Sélecteur nombre d'éléments */
.questions-page .per-page-selector select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

/* Pagination questions */
.questions-page .pagination-info {
    color: #64748b;
    font-size: 0.9em;
}

.questions-page .btn-page {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.questions-page .btn-page:hover:not(:disabled) {
    opacity: 0.8;
    transform: translateY(-1px);
}

.questions-page .btn-page:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ===== STYLES POUR LE RENDU LATEX ===== */

/* Conteneur général pour le LaTeX */
.latex-rendered,
.mjx-chtml {
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Style pour les questions contenant du LaTeX */
.latex-question {
    font-family: monospace;
}

/* Forcer le rendu MathJax et les grandes formules */
.MathJax,
.mjx-full-width {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    display: inline-block;
}
/* À ajouter dans votre fichier style.css ou dans une balise <style> */
.explication-content {
    white-space: pre-wrap; /* Préserve les sauts de ligne et les espaces */
    word-wrap: break-word;
    line-height: 1.6;
}


.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.loader-spinner {
    border: 3px solid var(--slate-100);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}