/**
 * style.css - Fiche de style Premium et Responsive pour la plateforme de QCM TSSR
 * Implémente un design sombre moderne (Dark Mode), des effets Glassmorphism, 
 * des typographies soignées et des micro-animations fluides.
 */

:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(22, 28, 45, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary-color: #4f46e5;      /* Indigo */
    --primary-hover: #6366f1;
    --accent-color: #f59e0b;       /* Amber */
    --accent-hover: #fbbf24;
    --success-color: #10b981;      /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger-color: #f43f5e;       /* Rose */
    --danger-bg: rgba(244, 63, 94, 0.15);
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Réinitialisations */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Orbes décoratives en arrière-plan (Effet de profondeur) */
.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #151a30 0%, #0b0f19 100%);
}

.glass-background::before,
.glass-background::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    pointer-events: none;
    animation: pulse 12s infinite alternate;
}

.glass-background::before {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    right: -100px;
}

.glass-background::after {
    width: 350px;
    height: 350px;
    background: var(--accent-color);
    bottom: -50px;
    left: -100px;
    animation-delay: -6s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(50px, 50px); }
}

/* Structure globale */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* En-tête */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(22, 28, 45, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-main);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast) ease-in-out;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, var(--primary-hover) 0%, #60a5fa 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, #f59e0b 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, var(--accent-hover) 0%, #fbbf24 100%);
}

.btn-large {
    padding: 16px 28px;
    font-size: 16px;
    width: 100%;
}

.btn-mini {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-mini:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-icon-only {
    padding: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.1) 50%, transparent 55%);
    transform: rotate(45deg);
    transition: none;
    animation: shine 6s infinite linear;
}

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

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Cartes Glassmorphism */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform var(--transition-normal), border var(--transition-fast);
}

/* Grille du tableau de bord */
.dashboard-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    flex-grow: 1;
}

.dashboard-section {
    padding: 24px;
}

.card-header {
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.text-accent { color: var(--accent-color); }
.text-primary { color: #3b82f6; }

/* Widgets de statistiques */
.stats-overview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.stat-gauge-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-weight: 800;
    text-align: center;
}

#stat-avg-score {
    font-size: 28px;
    color: #fff;
}

.gauge-value .max-val {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: -2px;
}

.gauge-label {
    position: absolute;
    bottom: -15px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.stat-numbers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    padding: 12px;
    text-align: center;
}

.stat-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.dashboard-details {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.detail-row span {
    color: var(--text-muted);
}

.detail-row strong {
    color: #fff;
}

/* Historique récent */
.history-container h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    font-size: 13px;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-category {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.history-date {
    font-size: 11px;
    color: var(--text-muted);
}

.history-score-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
}

.score-high {
    background: var(--success-bg);
    color: var(--success-color);
}

.score-medium {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.score-pass {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-color);
}

.score-low {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state i {
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Formulaire de configuration */
#form-quiz {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-label {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.selection-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Custom Scrollbar */
.categories-grid::-webkit-scrollbar {
    width: 6px;
}
.categories-grid::-webkit-scrollbar-track {
    background: transparent;
}
.categories-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.categories-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.category-item-card {
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast) ease;
}

.category-item-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.cat-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.cat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.extra-card .cat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-color);
}

.select-all-card .cat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.cat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* Hover & Selected card states */
.category-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.category-item-card.selected {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.1);
}

.category-item-card.selected .cat-icon {
    background: var(--primary-color);
    color: #fff;
}

.category-item-card.selected.extra-card {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
}
.category-item-card.selected.extra-card .cat-icon {
    background: var(--accent-color);
    color: #fff;
}

.category-item-card.selected.select-all-card {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
}
.category-item-card.selected.select-all-card .cat-icon {
    background: #3b82f6;
    color: #fff;
}

/* Paramètres (Toggle boutons radio) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.radio-toggle-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    padding: 6px;
}

.radio-toggle-item {
    position: relative;
    cursor: pointer;
}

.radio-toggle-item input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-toggle-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    text-align: center;
    transition: all var(--transition-fast);
}

.radio-toggle-item:hover span {
    color: var(--text-main);
}

.radio-toggle-item input[type="radio"]:checked + span {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* Pied de page */
.app-footer-bar {
    text-align: center;
    padding: 24px 0 8px;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: auto;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--primary-color);
    color: #fff;
    padding: 14px 28px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

.toast i {
    color: var(--success-color);
    font-size: 16px;
}

/* ==========================================================================
   INTERFACES DE QUIZ (quiz.php)
   ========================================================================== */
.quiz-page {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    margin-bottom: 20px;
}

.header-quiz-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-quiz-info h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.badge-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    width: fit-content;
}

.badge-training {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-hover);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-exam {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.quiz-timer {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Barre de progression */
.progress-bar-container {
    padding: 16px 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.progress-info strong {
    color: #fff;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color) 0%, #3b82f6 100%);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

/* Fiche Question */
.question-card {
    padding: 28px;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 12px;
}

.category-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.difficulty-indicator {
    color: var(--accent-color);
    font-weight: 600;
}

.question-text {
    margin-bottom: 24px;
}

.question-text h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.option-button {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    transition: all var(--transition-fast) ease;
    width: 100%;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.option-text {
    flex-grow: 1;
}

/* États des Options */
.option-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.option-button:hover:not(:disabled) .option-letter {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.option-button.selected {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.5);
}

.option-button.selected .option-letter {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.option-button.correct {
    background: var(--success-bg) !important;
    border-color: var(--success-color) !important;
}

.option-button.correct .option-letter {
    background: var(--success-color) !important;
    color: #fff !important;
    border-color: var(--success-color) !important;
}

.option-button.incorrect {
    background: var(--danger-bg) !important;
    border-color: var(--danger-color) !important;
}

.option-button.incorrect .option-letter {
    background: var(--danger-color) !important;
    color: #fff !important;
    border-color: var(--danger-color) !important;
}

.option-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Carte Explication */
.explanation-card {
    padding: 24px;
    border-left: 4px solid var(--accent-color);
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.explanation-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.result-indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.badge-correct {
    background: var(--success-bg);
    color: var(--success-color);
}

.badge-incorrect {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.explanation-body {
    font-size: 14px;
    color: var(--text-muted);
}

.explanation-body p {
    margin-bottom: 12px;
}

.explanation-body p:last-child {
    margin-bottom: 0;
}

.explanation-body strong {
    color: #fff;
}

.explanation-body pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    overflow-x: auto;
    margin: 10px 0;
}

.explanation-body code {
    font-family: monospace;
    font-size: 13px;
    color: #ff9d00;
    padding: 2px 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

.explanation-body pre code {
    padding: 0;
    background: none;
    color: #a5b4fc;
}

.explanation-body ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.explanation-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.explanation-body th, 
.explanation-body td {
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    text-align: left;
}

.explanation-body tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

/* ==========================================================================
   ECRAN DE RÉSULTATS (quiz.php - FIN)
   ========================================================================== */
.results-card {
    padding: 40px 24px;
}

.text-center { text-align: center; }

.results-trophy {
    font-size: 60px;
    margin-bottom: 16px;
    animation: bounce 2s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.results-card h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.results-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.score-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, rgba(11, 15, 25, 0.4) 100%);
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.score-total {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 600;
}

.level-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.result-comment {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}

.result-stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    padding: 16px 8px;
}

.result-stat-box .num {
    display: block;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.result-stat-box .label {
    font-size: 11px;
    color: var(--text-muted);
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.results-actions .btn {
    min-width: 160px;
}

/* Revue des réponses */
.review-section {
    margin-top: 24px;
    padding: 24px;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 20px;
    border-left: 4px solid #fff;
    background: rgba(255, 255, 255, 0.01);
}

.review-correct {
    border-left-color: var(--success-color);
}

.review-incorrect {
    border-left-color: var(--danger-color);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.review-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-status-indicator i {
    font-size: 18px;
}

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

.review-status-indicator h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.review-question-text {
    font-weight: 500;
    font-size: 15px;
    color: #fff;
    margin-bottom: 16px;
}

.review-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.review-option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
}

.review-option-letter {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
}

.review-option-text {
    flex-grow: 1;
}

.opt-badge-correct {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
}
.opt-badge-correct .review-option-letter {
    background: var(--success-color);
    color: #fff;
}

.opt-badge-incorrect {
    background: rgba(244, 63, 94, 0.06);
    border-color: rgba(244, 63, 94, 0.2);
}
.opt-badge-incorrect .review-option-letter {
    background: var(--danger-color);
    color: #fff;
}

.review-option-status i {
    font-size: 14px;
}

.review-explanation-content {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-md);
    padding: 14px;
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.review-explanation-content h5 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.review-explanation-content p {
    margin-bottom: 8px;
}
.review-explanation-content p:last-child {
    margin-bottom: 0;
}

.review-explanation-content ul {
    margin-left: 20px;
    margin-bottom: 8px;
}

.review-explanation-content pre {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 8px 0;
}

.review-explanation-content code {
    font-family: monospace;
    color: #ff9d00;
    background: rgba(0,0,0,0.15);
    padding: 1px 3px;
    border-radius: 2px;
}

.review-explanation-content pre code {
    color: #a5b4fc;
    background: none;
    padding: 0;
}

.review-explanation-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.review-explanation-content th,
.review-explanation-content td {
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 8px;
}

/* ==========================================================================
   MEDIAS QUERIES - RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 12px 8px;
    }
    
    .app-header {
        padding: 12px 16px;
        margin-bottom: 16px;
    }
    
    h1 {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .btn-secondary span {
        display: none; /* Masquer le texte sur mobile pour libérer de l'espace */
    }
    
    .dashboard-section {
        padding: 16px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        max-height: 300px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .question-card {
        padding: 16px;
    }
    
    .question-text h3 {
        font-size: 16px;
    }
    
    .option-button {
        padding: 12px 16px;
        font-size: 14px;
        gap: 12px;
    }
    
    .option-letter {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .results-card {
        padding: 24px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions .btn {
        width: 100%;
    }
    
    .review-section {
        padding: 12px;
    }
    
    .review-item {
        padding: 12px;
    }
    
    .review-option-row {
        padding: 8px 10px;
        font-size: 12px;
    }
}
