/* ============================================================
   Éducation Crédit Québec — Styles personnalisés
   ============================================================ */

:root {
    --qc-bleu: #003087;
    --qc-rouge: #d4003b;
    --card-hover-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}

body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---- Navigation ---- */
.navbar-brand span {
    font-size: 1.4rem;
    font-weight: 700;
}

/* ---- Landing page hero ---- */
.hero-section {
    background: linear-gradient(135deg, var(--qc-bleu) 0%, #1a5276 50%, #0d6efd 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.hero-emoji {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

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

/* ---- Module cards ---- */
.module-card {
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
    border-radius: .75rem !important;
    overflow: hidden;
}

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

.module-card .card-emoji {
    font-size: 2.5rem;
}

.module-card .badge-duree {
    font-size: .75rem;
}

/* ---- Progression ---- */
.progress-ring {
    width: 80px;
    height: 80px;
}

/* ---- Module content ---- */
.module-content {
    background: white;
    border-radius: .75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 2rem;
}

.module-section h3 {
    color: var(--qc-bleu);
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.module-section h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* ---- Examen ---- */
.exam-question-card {
    border-radius: .75rem;
    border: 2px solid #dee2e6;
    transition: border-color .2s;
}

.exam-question-card.answered {
    border-color: #0d6efd;
}

.question-section-header {
    background: linear-gradient(90deg, var(--qc-bleu), #1a5276);
    color: white;
    padding: .75rem 1.5rem;
    border-radius: .5rem;
    margin-bottom: 1.5rem;
}

.choice-label {
    display: block;
    padding: .75rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: .5rem;
    cursor: pointer;
    transition: all .15s;
    margin-bottom: .5rem;
}

.choice-label:hover {
    background-color: #e8f0fe;
    border-color: #0d6efd;
}

input[type="radio"]:checked + .choice-label,
input[type="radio"]:checked ~ .choice-label {
    background-color: #e8f0fe;
    border-color: #0d6efd;
    font-weight: 600;
}

/* Hack pour Bootstrap 5 radio styling */
.form-check-input:checked ~ .choice-label {
    background-color: #e8f0fe;
    border-color: #0d6efd;
}

.choice-wrapper {
    position: relative;
}

.choice-wrapper input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.choice-wrapper input[type="radio"]:checked + label {
    background-color: #dbeafe;
    border-color: #2563eb;
    font-weight: 600;
}

/* ---- Résultats ---- */
.result-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto;
}

.result-circle.pass   { background: #d1e7dd; color: #0a3622; border: 5px solid #198754; }
.result-circle.fail   { background: #f8d7da; color: #58151c; border: 5px solid #dc3545; }
.result-circle.almost { background: #fff3cd; color: #664d03; border: 5px solid #ffc107; }

/* ---- Admin ---- */
.stat-card {
    border-radius: .75rem;
    text-align: center;
    padding: 1.5rem;
}

/* ---- Sidebar navigation ---- */
.module-nav .nav-link {
    border-radius: .5rem;
    padding: .6rem 1rem;
    color: #495057;
    transition: background .15s;
}

.module-nav .nav-link:hover { background: #e9ecef; }
.module-nav .nav-link.active { background: var(--qc-bleu); color: white; }
.module-nav .nav-link.completed { color: #198754; }

/* ---- Timer examen ---- */
#exam-timer {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
}

#exam-timer.warning { color: #ffc107; }
#exam-timer.danger  { color: #dc3545; animation: blink 1s step-end infinite; }

@keyframes blink {
    50% { opacity: .5; }
}

/* ---- Badges module ---- */
.badge-module-completed {
    background: #198754;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}

/* ---- Footer ---- */
footer {
    background: var(--qc-bleu);
    color: rgba(255,255,255,.8);
    padding: 2rem 0;
    margin-top: 4rem;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .hero-section {
        padding: 3rem 0;
        text-align: center;
    }
    .hero-emoji { font-size: 3rem; }
    .module-content { padding: 1rem; }
}

/* ---- Utilitaires ---- */
.cursor-pointer { cursor: pointer; }
.text-qc-bleu   { color: var(--qc-bleu); }
.bg-qc-bleu     { background-color: var(--qc-bleu); }
