/* ══ QUIZ PAGE — PLAY STORE STYLE ══
   Externalisé depuis pages/quiz.php
   ══════════════════════════════════ */

/* ── Variables ── */
:root {
  --qz-bg: #f5f3ff;
  --qz-card: #ffffff;
  --qz-primary: #7c3aed;
  --qz-primary-light: #ede9fe;
  --qz-accent: #8b5cf6;
  --qz-text: #2e1065;
  --qz-muted: #6b7280;
  --qz-border: #e5e7eb;
  --qz-shadow: 0 2px 12px rgba(124,58,237,.10);
  --qz-shadow-hover: 0 8px 32px rgba(124,58,237,.22);
  --qz-radius: 16px;
}
[data-theme="dark"] {
  --qz-bg: #1e1b4b;
  --qz-card: #2e1065;
  --qz-primary-light: #4c1d95;
  --qz-text: #f5f3ff;
  --qz-muted: #9ca3af;
  --qz-border: #4c1d95;
  --qz-shadow: 0 2px 12px rgba(0,0,0,.4);
  --qz-shadow-hover: 0 8px 32px rgba(124,58,237,.35);
}

/* ── Page ── */
.qz-page { background: var(--qz-bg); min-height: 100vh; padding-bottom: 60px; }

/* ── Hero Banner ── */
.qz-hero {
  background: linear-gradient(135deg, #2e1065 0%, #4c1d95 50%, #7c3aed 100%);
  padding: 48px 24px 56px; position: relative; overflow: hidden;
}
.qz-hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.qz-hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.qz-hero-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; }
.qz-hero h1 { font-family: "Nunito", sans-serif; font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.8rem); color: white; margin-bottom: 10px; line-height: 1.2; }
.qz-hero p { color: rgba(255,255,255,.75); font-size: 1.05rem; max-width: 560px; margin-bottom: 0; }
.qz-hero-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.qz-stat { background: rgba(255,255,255,.12); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 12px 20px; text-align: center; }
.qz-stat-num { font-family: "Nunito", sans-serif; font-weight: 900; font-size: 1.5rem; color: white; }
.qz-stat-lbl { font-size: .75rem; color: rgba(255,255,255,.65); margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

/* ── Stats accent color ── */
.qz-stat-num--accent { color: #A7F3D0; }

/* ── Search Bar ── */
.qz-search-wrap { max-width: 1200px; margin: -28px auto 0; padding: 0 24px; position: relative; z-index: 10; }
.qz-search-bar { background: var(--qz-card); border-radius: 20px; box-shadow: 0 8px 40px rgba(124,58,237,.18); padding: 16px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.qz-search-input-wrap { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; background: var(--qz-bg); border: 2px solid var(--qz-border); border-radius: 12px; padding: 10px 16px; transition: border-color .2s, box-shadow .2s; }
.qz-search-input-wrap--short { flex: 0.5; min-width: 150px; }
.qz-search-input-wrap:focus-within { border-color: var(--qz-primary); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.qz-search-input-wrap input,
.qz-search-input-wrap select { border: none; outline: none; background: transparent; font-family: "Space Grotesk", sans-serif; font-size: .95rem; color: var(--qz-text); width: 100%; }
.qz-search-input-wrap input::placeholder { color: var(--qz-muted); }
.qz-filter-btn { padding: 10px 20px; border-radius: 12px; border: none; background: var(--qz-primary); color: white; font-family: "Space Grotesk", sans-serif; font-weight: 700; cursor: pointer; transition: all .2s; display: flex; align-items: center; gap: 8px; }
.qz-filter-btn:hover { background: #6d28d9; transform: translateY(-1px); }

/* ── Icon helpers ── */
.qz-icon-muted { color: var(--qz-muted); }
.qz-icon-sm { width: 14px; height: 14px; }
.qz-icon-xs { width: 12px; height: 12px; }

/* ── Main Layout ── */
.qz-main { max-width: 1200px; margin: 32px auto 0; padding: 0 24px; }
.qz-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-bottom: 28px; }
.qz-cats::-webkit-scrollbar { display: none; }
.qz-cat-tab { display: flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--qz-border); background: var(--qz-card); font-family: "Space Grotesk", sans-serif; font-size: .85rem; font-weight: 700; color: var(--qz-muted); cursor: pointer; transition: all .2s; white-space: nowrap; box-shadow: var(--qz-shadow); text-decoration: none; }
.qz-cat-tab:hover { border-color: var(--qz-primary); color: var(--qz-primary); }
.qz-cat-tab.active { background: var(--qz-primary); border-color: var(--qz-primary); color: white; box-shadow: 0 4px 16px rgba(124,58,237,.35); }

/* ── Grid & Cards ── */
.qz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 40px; }
.qz-card { background: var(--qz-card); border-radius: var(--qz-radius); border: 2px solid var(--qz-border); overflow: hidden; box-shadow: var(--qz-shadow); transition: all .25s; display: flex; flex-direction: column; }
.qz-card:hover { transform: translateY(-4px); box-shadow: var(--qz-shadow-hover); border-color: var(--qz-primary); }
.qz-card-img { height: 140px; background: var(--qz-primary-light); overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.qz-card-img img { width: 100%; height: 100%; object-fit: cover; }
.qz-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.qz-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.qz-badge { font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.qz-badge-main { background: var(--qz-primary-light); color: var(--qz-primary); }

/* ── Badge variants (remplacent les style= inline) ── */
.qz-badge--popular  { background: #fef3c7; color: #d97706; }
.qz-badge--html     { background: #e0e7ff; color: #4f46e5; }
.qz-badge--new      { background: #fcd34d; color: #92400e; margin-left: 10px; }

/* ── Difficulty badges (data-diff attribute selector) ── */
.qz-badge[data-diff="facile"]   { background: rgba(16,185,129,.12);  color: #10b981; }
.qz-badge[data-diff="moyen"]    { background: rgba(245,158,11,.12);  color: #f59e0b; }
.qz-badge[data-diff="difficile"]{ background: rgba(239,68,68,.12);   color: #ef4444; }

.qz-title { font-family: "Nunito", sans-serif; font-weight: 800; font-size: 1.1rem; color: var(--qz-text); margin-bottom: 8px; }
.qz-desc { font-size: .85rem; color: var(--qz-muted); line-height: 1.5; flex: 1; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qz-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--qz-muted); margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.qz-meta span { display: flex; align-items: center; gap: 4px; }
.qz-actions { display: flex; gap: 8px; }
.qz-btn { padding: 10px 18px; border-radius: 12px; border: none; font-family: "Nunito", sans-serif; font-weight: 800; font-size: .85rem; cursor: pointer; transition: all .2s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--qz-primary); color: white; box-shadow: 0 3px 10px rgba(124,58,237,.3); flex: 1; }
.qz-btn:hover { background: #6d28d9; transform: translateY(-2px); color: white; }
.qz-btn--auto  { flex: none; width: auto; }
.qz-btn--lg    { padding: 12px 24px; font-size: .95rem; }
.qz-btn--dark  { background: var(--qz-text); }
.qz-btn-fav { background: var(--qz-bg); color: var(--qz-primary); border: 2px solid var(--qz-border); padding: 10px; border-radius: 12px; box-shadow: none; flex: 0 0 auto; transition: all .2s; display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.qz-btn-fav:hover { border-color: var(--qz-primary); color: var(--qz-primary); transform: translateY(-2px); }
.qz-btn-fav:disabled { opacity: .6; cursor: wait; }

/* ── Share code chip ── */
.qz-share-code {
  font-size: .75rem; background: var(--qz-bg); border-radius: 8px; padding: 6px 10px;
  color: var(--qz-primary); font-weight: 700; margin-bottom: 12px;
  font-family: monospace; text-align: center;
}

/* ── Empty state ── */
.qz-empty {
  text-align: center; padding: 60px; background: var(--qz-card);
  border-radius: var(--qz-radius); border: 2px solid var(--qz-border); margin-bottom: 40px;
}
.qz-empty__icon  { font-size: 3rem; margin-bottom: 16px; }
.qz-empty__title { font-family: "Nunito", sans-serif; font-weight: 800; color: var(--qz-text); margin-bottom: 8px; }
.qz-empty__text  { color: var(--qz-muted); }

/* ── CTA card variant ── */
.qz-card--cta {
  background: linear-gradient(135deg, var(--qz-primary-light), #fbcfe8);
  border: none; flex-direction: row; align-items: center;
  padding: 24px; gap: 20px; flex-wrap: wrap; margin-bottom: 40px;
}
.qz-card--cta__body { flex: 1; min-width: 250px; }
.qz-card--cta__title { font-family: "Nunito", sans-serif; font-weight: 900; font-size: 1.2rem; color: var(--qz-text); margin-bottom: 6px; }
.qz-card--cta__desc  { color: var(--qz-text); font-size: .9rem; opacity: .8; }

/* ── HTML Quiz section ── */
.qz-html-section { margin-top: 60px; }
.qz-section-title { font-family: "Nunito", sans-serif; font-weight: 900; font-size: 1.4rem; color: var(--qz-text); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.qz-html-card { text-decoration: none; color: inherit; transition: all .25s; display: block; }
.qz-html-icon { height: 100px; background: linear-gradient(135deg, #1e1b4b, #7c3aed); border-radius: var(--qz-radius); margin-bottom: 16px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: white; box-shadow: var(--qz-shadow); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .qz-hero { padding: 32px 16px 48px; }
  .qz-search-wrap { padding: 0 12px; }
  .qz-search-bar { padding: 12px; gap: 10px; }
  .qz-main { padding: 0 12px; }
  .qz-grid { grid-template-columns: 1fr; }
}
