/* ============================================================
   GENESIS — Dashboard premium d'auto-amélioration
   Design : dark glassmorphism, dégradés, animations légères
   ============================================================ */

:root {
  --bg-1: #0b0e1a;
  --bg-2: #121629;
  --accent-1: #7c5cff;
  --accent-2: #35d0ba;
  --accent-3: #ff5cab;
  --text-1: #f2f3f8;
  --text-2: #a7abc3;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 0%, #1b1f3a 0%, var(--bg-1) 55%),
              linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: var(--text-1);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(11, 14, 26, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  animation: pulseGlow 3.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.35); }
  50% { box-shadow: 0 0 0 12px rgba(124, 92, 255, 0); }
}

.brand-text h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.brand-text span {
  font-size: 0.8rem;
  color: var(--text-2);
}

.badge-premium {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #0b0e1a;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

.topbar-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  min-width: 70px;
}

.stat b {
  display: block;
  font-size: 1.1rem;
}

.stat small {
  color: var(--text-2);
  font-size: 0.7rem;
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
}

section {
  min-width: 0;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2 .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
}

/* ---------- Engine box ---------- */
.engine-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  transition: width 0.6s ease;
}

@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.engine-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 44px;
  color: #0b0e1a;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124,92,255,0.35); }
button:active { transform: translateY(0); }

button.secondary {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--glass-border);
}

/* ---------- Changelog / timeline ---------- */
#changelog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#changelog-list li {
  border-left: 3px solid var(--accent-1);
  padding: 0.6rem 0.9rem;
  background: rgba(255,255,255,0.04);
  border-radius: 0 12px 12px 0;
  font-size: 0.87rem;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

#changelog-list li .meta {
  color: var(--text-2);
  font-size: 0.72rem;
  display: block;
  margin-top: 0.2rem;
}

/* ---------- Modules grid ---------- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.module-chip {
  padding: 0.8rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  text-align: center;
  font-size: 0.8rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-chip.locked {
  opacity: 0.4;
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-2);
  font-size: 0.78rem;
  border-top: 1px solid var(--glass-border);
}

footer a { color: var(--accent-2); text-decoration: none; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 999px; }
