/*
 * ACACED Revision - Design System
 * Theme CSS avec variables, composants et utilitaires
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Palette principale - Theme nature/animaux */
    --acaced-primary: #2563eb;
    --acaced-primary-dark: #1e40af;
    --acaced-primary-light: #dbeafe;
    --acaced-secondary: #059669;
    --acaced-secondary-dark: #047857;
    --acaced-secondary-light: #d1fae5;
    --acaced-accent: #f59e0b;
    --acaced-accent-light: #fef3c7;
    --acaced-danger: #ef4444;
    --acaced-danger-light: #fee2e2;

    /* Gamification */
    --xp-color: #8b5cf6;
    --streak-color: #f97316;
    --combo-color: #ec4899;
    --level-color: #06b6d4;

    /* Surfaces */
    --bg-body: #f0fdf4;
    --bg-card: #ffffff;
    --bg-dark: #1f2937;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Design tokens */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===== */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== NAVBAR ===== */
.acaced-navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.acaced-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--acaced-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.acaced-navbar .nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.acaced-navbar .nav-link:hover,
.acaced-navbar .nav-link.active {
    color: var(--acaced-primary);
    background: var(--acaced-primary-light);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #059669 0%, #2563eb 50%, #1e40af 100%);
    color: white;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.2rem;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

/* ===== BOUTONS ===== */
.btn-acaced {
    background: linear-gradient(135deg, var(--acaced-primary), var(--acaced-primary-dark));
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-acaced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
    color: white;
}

.btn-acaced-secondary {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.3);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-acaced-secondary:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    transform: translateY(-2px);
}

.btn-acaced-green {
    background: linear-gradient(135deg, var(--acaced-secondary), var(--acaced-secondary-dark));
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    transition: var(--transition);
}

.btn-acaced-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.35);
    color: white;
}

/* ===== CARDS ===== */
.acaced-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    overflow: hidden;
}

.acaced-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.domain-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.domain-card:hover {
    border-color: var(--acaced-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.domain-card .domain-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

.domain-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.domain-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== STAT COUNTERS ===== */
.stat-counter {
    text-align: center;
    padding: 1.5rem;
}

.stat-counter .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--acaced-primary), var(--acaced-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-counter .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.3rem;
}

/* ===== QUIZ COMPONENTS ===== */
.quiz-container {
    max-width: 750px;
    margin: 0 auto;
}

.quiz-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: none;
    overflow: hidden;
}

.quiz-header {
    background: linear-gradient(135deg, var(--acaced-primary), var(--acaced-primary-dark));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-progress {
    height: 6px;
    background: var(--acaced-primary-light);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--acaced-secondary), var(--acaced-primary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.quiz-option {
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.quiz-option:hover {
    border-color: var(--acaced-primary);
    background: var(--acaced-primary-light);
}

.quiz-option input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 1rem;
    flex-shrink: 0;
    accent-color: var(--acaced-primary);
}

.quiz-option.correct {
    border-color: var(--acaced-secondary);
    background: var(--acaced-secondary-light);
}

.quiz-option.wrong {
    border-color: var(--acaced-danger);
    background: var(--acaced-danger-light);
}

.quiz-option.missed {
    border-color: var(--acaced-accent);
    background: var(--acaced-accent-light);
}

/* Timer */
.quiz-timer {
    background: var(--acaced-danger-light);
    color: var(--acaced-danger);
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.timer-critical {
    animation: timer-pulse 0.8s infinite;
    background: var(--acaced-danger) !important;
    color: white !important;
}

/* ===== SCORE CIRCLE ===== */
.score-ring {
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring .ring-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 10;
}

.score-ring .ring-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease;
}

.score-ring .ring-fill.success { stroke: var(--acaced-secondary); }
.score-ring .ring-fill.warning { stroke: var(--acaced-accent); }
.score-ring .ring-fill.danger { stroke: var(--acaced-danger); }

.score-ring .score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-ring .score-value {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.score-ring .score-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== EXPLANATION BOX ===== */
.explanation-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid var(--acaced-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1.2rem 1.5rem;
    margin-top: 1rem;
}

.explanation-box strong {
    color: var(--acaced-primary);
}

/* ===== SECTION STYLES ===== */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.05rem;
}

/* ===== FAQ ===== */
.faq-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 0.8rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}

.faq-item .accordion-button {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    padding: 1.2rem 1.5rem;
    box-shadow: none;
}

.faq-item .accordion-button:not(.collapsed) {
    color: var(--acaced-primary);
    background: var(--acaced-primary-light);
}

.faq-item .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232563eb'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.faq-item .accordion-body {
    color: var(--text-secondary);
    padding: 0 1.5rem 1.2rem;
    line-height: 1.7;
}

/* ===== FOOTER ===== */
.acaced-footer {
    background: var(--bg-dark);
    color: #d1d5db;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.acaced-footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}

.acaced-footer a:hover {
    color: white;
}

.acaced-footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* ===== HOW IT WORKS ===== */
.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--acaced-primary), var(--acaced-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin: 0 auto 1rem;
}

.step-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* ===== EXAM INFO CARDS ===== */
.exam-info-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    border: 2px solid #e5e7eb;
    transition: var(--transition);
}

.exam-info-card:hover {
    border-color: var(--acaced-primary);
}

.exam-info-card .exam-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--acaced-primary);
    line-height: 1;
}

.exam-info-card .exam-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

/* ===== SERIE CARD (quiz listing) ===== */
.serie-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.serie-card:hover {
    border-color: var(--acaced-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    color: inherit;
}

.serie-card .serie-icon {
    width: 55px;
    height: 55px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.serie-card .serie-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.serie-card .serie-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.serie-card .serie-arrow {
    margin-left: auto;
    color: var(--acaced-primary);
    font-size: 1.3rem;
    opacity: 0;
    transition: var(--transition);
}

.serie-card:hover .serie-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ===== PAGE CONTENT ===== */
.page-hero {
    background: linear-gradient(135deg, var(--acaced-primary) 0%, var(--acaced-primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.page-hero h1 {
    font-size: 2rem;
    font-weight: 800;
}

.page-hero p {
    opacity: 0.9;
    margin: 0;
}

.content-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--acaced-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-highlight {
    background: var(--acaced-primary-light);
    border-left: 4px solid var(--acaced-primary);
    padding: 1.2rem 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.5rem 0;
}

.info-highlight strong {
    color: var(--acaced-primary);
}

/* ===== KEYBOARD HINTS ===== */
.kbd-hint {
    background: #f3f4f6;
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #d1d5db;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes correctPulse {
    0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-shake { animation: shake 0.5s ease; }
.animate-correct { animation: correctPulse 0.6s ease; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero { padding: 3rem 0 2.5rem; }
    .hero h1 { font-size: 1.8rem; }
    .stat-counter .stat-number { font-size: 2rem; }
    .section-title { font-size: 1.5rem; }
    .quiz-option { padding: 0.9rem 1rem; }
    .acaced-footer { padding: 2rem 0 1rem; }
}

@media (max-width: 576px) {
    .hero { padding: 2rem 0; }
    .btn-acaced, .btn-acaced-secondary, .btn-acaced-green {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
    .quiz-option { min-height: 48px; }
}
