/* =========================================
   VARIABLES & BASES
   ========================================= */
:root {
    --aleks-blue: #00A3C4;
    --aleks-dark-blue: #007A93;
    --aleks-bg: #F0F4F7;
    --aleks-orange: #e67e22;
    --aleks-green: #27ae60;
    --text-color: #333;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body { 
    margin: 0; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background: var(--aleks-bg); 
    color: var(--text-color);
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* =========================================
   HEADER (BARRE DU HAUT)
   ========================================= */
.aleks-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 25px; 
    height: 70px;
    background: white; 
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.aleks-logo { height: 40px; }
.course-title { font-weight: bold; color: #555; font-size: 1.1rem; border-left: 1px solid #ccc; padding-left: 15px; }

/* Statistiques de Maîtrise (Centre du Header) */
.header-center { flex: 1; max-width: 500px; padding: 0 20px; }
.bar-stats { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 5px; }
.progress-bar-bg { background: #eee; height: 10px; border-radius: 5px; overflow: hidden; }
.progress-bar-fill { 
    background: var(--aleks-blue); 
    height: 100%; 
    width: 0%; 
    transition: width 0.8s ease; 
}

.header-right { display: flex; align-items: center; gap: 20px; }
.btn-diag-nav {
    background: var(--aleks-orange); 
    color: white; 
    border: none; 
    padding: 10px 18px;
    border-radius: 20px; 
    cursor: pointer; 
    font-weight: bold;
    transition: 0.3s;
}
.btn-diag-nav:hover { background: #d35400; transform: translateY(-2px); }

.btn-logout-small { background: #95a5a6; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; }

/* =========================================
   LAYOUT PRINCIPAL (STUDENT)
   ========================================= */
.aleks-layout { display: flex; height: calc(100vh - 70px); }

/* Sidebar Bleue */
.aleks-sidebar { 
    width: 320px; 
    background: var(--aleks-blue); 
    color: white; 
    padding: 25px; 
    display: flex; 
    flex-direction: column;
    gap: 30px;
}

.next-up-card { 
    background: rgba(255, 255, 255, 0.15); 
    padding: 20px; 
    border-radius: 12px; 
    text-align: center;
}
.next-up-card .label { font-size: 0.75rem; letter-spacing: 1px; margin-bottom: 10px; opacity: 0.9; }
.next-up-card h3 { margin: 10px 0 20px; font-size: 1.2rem; line-height: 1.4; }

.btn-continue { 
    width: 100%; 
    padding: 14px; 
    border-radius: 30px; 
    border: none; 
    background: white; 
    color: var(--aleks-blue); 
    font-weight: bold; 
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}
.btn-continue:hover { background: #f0f0f0; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* Stepper Vertical */
.stepper-vertical { display: flex; flex-direction: column; gap: 15px; }
.step { 
    padding: 10px 15px; 
    border-radius: 6px; 
    font-size: 0.9rem; 
    background: rgba(0,0,0,0.1);
    opacity: 0.7;
}
.step.active { background: white; color: var(--aleks-blue); opacity: 1; font-weight: bold; }
.step.done { background: var(--aleks-green); color: white; opacity: 1; }

/* =========================================
   ZONE CENTRALE & GRAPHES
   ========================================= */
.aleks-main-content { 
    flex: 1; 
    padding: 40px; 
    overflow-y: auto; 
    background: white;
}

.view-toggle { margin-bottom: 30px; display: flex; gap: 10px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.toggle-btn { 
    background: none; border: none; padding: 10px 20px; cursor: pointer; 
    font-weight: bold; color: #7f8c8d; border-radius: 20px;
}
.toggle-btn.active { background: #e1f5fe; color: var(--aleks-blue); }

.pie-flex-container { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 50px; 
    flex-wrap: wrap;
    margin-top: 20px;
}

.chart-wrapper { 
    position: relative; 
    width: 400px; 
    height: 400px; 
    background: white;
}

.chart-center-label {
    position: absolute; 
    top: 50%; left: 50%; 
    transform: translate(-50%, -50%);
    text-align: center;
}
#total-topics-num { font-size: 4rem; color: #444; font-weight: bold; display: block; }

/* Légende ALEKS */
.aleks-legend { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 12px; 
    min-width: 250px; 
}
.legend-item { 
    display: flex; 
    align-items: center; 
    font-size: 0.95rem; 
    color: #555;
    padding: 5px;
}
.dot { 
    width: 14px; 
    height: 14px; 
    border-radius: 50%; 
    margin-right: 12px; 
    flex-shrink: 0;
}

/* =========================================
   COMPOSANTS GÉNÉRIQUES (AUTH, CARDS)
   ========================================= */
.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

input, select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-dark {
    background: var(--aleks-dark-blue);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-stud {
    background: var(--aleks-green);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
}

/* Quiz Diagnostic */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.option-btn {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
}

.option-btn:hover {
    background: #e3f2fd;
    border-color: var(--aleks-blue);
}

/* Responsive */
@media (max-width: 900px) {
    .aleks-layout { flex-direction: column; }
    .aleks-sidebar { width: 100%; height: auto; }
    .chart-wrapper { width: 300px; height: 300px; }
}

/* DESIGN DASHBOARD ENSEIGNANT */
.teacher-dashboard {
    padding: 20px;
    background: #f4f7f9;
}

.teacher-nav {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 10px 20px;
    border-bottom: 2px solid #007A93;
    margin-bottom: 20px;
}

.nav-links a {
    margin-right: 20px;
    text-decoration: none;
    color: #555;
    font-weight: bold;
}

.nav-links a.active { color: #007A93; border-bottom: 3px solid #007A93; }

/* Grid System */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.aleks-card {
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.aleks-card.wide { grid-column: span 3; }

.card-header {
    background: #4A6E78; /* Couleur grise-bleue de l'image */
    color: white;
    padding: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 4px 4px 0 0;
}

.card-body { padding: 20px; }
.card-body.center { text-align: center; }

.chart-container-small { height: 200px; position: relative; }

/* Table Style */
.aleks-table {
    width: 100%;
    border-collapse: collapse;
}

.aleks-table th { background: #f8f9fa; text-align: left; padding: 12px; border-bottom: 2px solid #eee; }
.aleks-table td { padding: 12px; border-bottom: 1px solid #eee; }

.btn-small {
    background: #007A93;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.aleks-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.aleks-modal-card {
    background: white; padding: 30px; border-radius: 8px; width: 90%; max-width: 900px;
    max-height: 90vh; overflow-y: auto;
}
.add-student-box {
    background: #f0f4f7; padding: 15px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #ddd;
}
.input-row { display: flex; gap: 10px; margin-top: 10px; }
.input-row input { flex: 1; padding: 10px; }

.btn-continue:disabled {
    background: #bdc3c7 !important;
    color: #7f8c8d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Responsive : sur mobile, on empile les colonnes */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    div[style*="flex: 1.2"], div[style*="flex: 0.8"] {
        flex: none !important;
        width: 100%;
    }
}

/* Style pour votre formulaire actuel pour qu'il s'intègre bien */
#auth-container {
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 30px;
    border-radius: 10px;
}

.stat-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    color: white;
    text-align: center;
}
.diag { background: #2980b9; }
.eval { background: #8e44ad; }
.final { background: #e74c3c; }
.card-analytique {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.btn-analyser {
    background: #002147;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-analyser:hover { background: #00a3c4; }

.hover-row:hover { background-color: #f8f9fa; }
.kpi-box { 
    background: #fff; 
    padding: 15px; 
    border-radius: 10px; 
    text-align: center; 
    border: 1px solid #eee; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.kpi-box small { color: #888; font-weight: bold; font-size: 0.7em; }
.kpi-box div { font-size: 1.2em; font-weight: bold; margin-top: 5px; }
.btn-action {
    background: #f1f3f5;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}
.btn-action:hover { background: #e9ecef; }

.badge-diag {
    background: #2980b9;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

.aleks-table th {
    text-align: center;
    background-color: #f8f9fa;
    color: #1f4060;
    padding: 12px;
}

.aleks-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.analysis-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.analysis-card h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #1f4060;
    border-bottom: 2px solid #f0f7f8;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Modale plein écran pour une meilleure visibilité */
.aleks-modal-card {
    width: 95% !important;
    max-width: 1200px !important;
    height: 90vh;
    overflow-y: auto;
}

.cv-qcm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colonnes */
    gap: 20px;
    margin-top: 20px;
  }
  .cv-option-large {
    min-height: 80px; /* Plus grand */
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    border: 2px solid var(--cv-brand);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
  }
  .cv-option-large:hover {
    background: #f0f7ff;
    transform: translateY(-2px);
  }
  /* Style pour le champ mathématique */
  math-field {
    font-size: 1.5rem;
    padding: 8px;
    border-radius: 8px;
    border: 2px solid var(--cv-brand);
    width: 100%;
    background: white;
  }


  /* Style du texte à l'intérieur de la pyramide */
.bloom-text {
  font-family: 'Arial', sans-serif;
  font-size: 14px;
  font-weight: bold;
  fill: white;
  text-anchor: middle;
  pointer-events: none;
}

/* Conteneur pour centrer la pyramide */
.bloom-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Animation de clignotement (illumination) */
@keyframes bloom-glow {
  0%, 15%, 100% { 
    filter: brightness(1); 
    opacity: 0.8; 
  }
  7% { 
    filter: brightness(1.6); 
    opacity: 1; 
    drop-shadow: 0 0 10px white;
  }
}

/* Application de l'animation avec délai pour chaque niveau */
.bloom-pyramid path {
  transition: all 0.3s;
  opacity: 0.8;
  animation: bloom-glow 6s infinite; /* 6 secondes pour un cycle complet */
}

/* On décale l'animation de 1 seconde pour chaque étage */
#level-remember   { animation-delay: 0s; }
#level-understand { animation-delay: 1s; }
#level-apply      { animation-delay: 2s; }
#level-analyze    { animation-delay: 3s; }
#level-create     { animation-delay: 4s; }
#level-evaluate   { animation-delay: 5s; }

/* Optionnel: effet de survol à la souris */
.bloom-pyramid path:hover {
  filter: brightness(1.2);
  opacity: 1;
  cursor: pointer;
}


:root {
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --accent: #8b5cf6;
}

.cv5-fade-in { animation: fadeIn 0.8s ease-out; }

/* Hero Ultra-moderne */
.cv5-hero-premium {
  text-align: center;
  padding: 60px 20px;
  background: radial-gradient(circle at center, rgba(139,92,246,0.15) 0%, transparent 70%);
}

.cv5-title-ultra {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(to right, #fff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 10px 0;
}

/* Carte Cognitive en Réseau */
.cv5-map-canvas {
  height: 400px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv5-center-core {
  width: 80px;
  height: 80px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.cv5-node-item {
  position: absolute;
  transform: rotate(var(--angle)) translateY(-150px) rotate(calc(-1 * var(--angle)));
  animation: orbit 1s ease-out backwards;
  animation-delay: var(--delay);
}

/* Dashboard Adaptatif Layout */
.cv5-adaptive-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  padding: 20px;
  min-height: 80vh;
}

.cv5-card-glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 25px;
  transition: transform 0.3s ease;
}

.cv5-card-glass:hover { transform: translateY(-5px); border-color: var(--accent); }

/* Ring Progress */
.cv5-ring { width: 120px; height: 120px; }
.cv5-ring-bg { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 3; }
.cv5-ring-fill { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.cv5-ring-text { fill: #fff; font-size: 0.5rem; text-anchor: middle; font-weight: bold; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbit { from { transform: rotate(var(--angle)) translateY(0px); opacity: 0; } }
