/* =====================================================
   QUIZZES.CSS
   Full stylesheet mirroring lessons.css
===================================================== */

/* =====================================================
   ROOT VARIABLES (THEME-AWARE)
===================================================== */
:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-header: rgba(255,255,255,0.85);
  --bg-nav: rgba(255,255,255,0.9);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border: #e5e7eb;
  --accent: #2563eb;

  --radius-lg: 1.25rem;
  --radius-md: 0.75rem;

  --shadow-sm: 0 8px 24px rgba(0,0,0,.08);
  --shadow-md: 0 18px 40px rgba(0,0,0,.14);
}

/* =====================================================
   BASE STYLES
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.no-copy {
  user-select: none;
  -webkit-user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.primary {
  color: var(--accent);
}

/* =====================================================
   HEADER + DESKTOP NAV
===================================================== */
.app-header {
  backdrop-filter: blur(18px);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.desktop-nav {
  display: none;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.header-actions button {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* =====================================================
   DARK / DIM MODES
===================================================== */
body.dim {
  --bg: #0f172a;
  --bg-card: #020617;
  --bg-header: rgba(2,6,23,0.8);
  --bg-nav: rgba(2,6,23,0.9);

  --text-primary: #e5e7eb;
  --text-secondary: #cbd5f5;
  --text-muted: #94a3b8;

  --border: #1e293b;
}

body.dark {
  --bg: #020617;
  --bg-card: #020617;
  --bg-header: rgba(2,6,23,0.9);
  --bg-nav: rgba(2,6,23,0.95);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5f5;
  --text-muted: #94a3b8;

  --border: #1e293b;
}

/* =====================================================
   SECTION HEADER
===================================================== */
.section-header {
  margin: 2.5rem 0 1.25rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* =====================================================
   QUIZ CARDS
===================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(.22,1,.36,1),
              box-shadow 0.35s ease;
}

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

/* =====================================================
   QUIZ TITLES & DESCRIPTIONS
===================================================== */
.quiz-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quiz-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

body.dark .quiz-title,
body.dim .quiz-title {
  color: var(--text-primary);
}

/* =====================================================
   LEVEL BADGE
===================================================== */
.level-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: #f3f4f6;
  color: #4b5563;
  font-weight: 500;
  white-space: nowrap;
}

body.dark .level-badge {
  background-color: #1f2937;
  color: #d1d5db;
}

body.dim .level-badge {
  background-color: #374151;
  color: #e5e7eb;
}

/* =====================================================
   QUIZ GRID (like lesson-grid)
===================================================== */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.quiz-card {
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.quiz-icon {
  font-size: 2.8rem;
  margin-bottom: 0.6rem;
  transition: transform 0.35s ease;
}

.quiz-card:hover .quiz-icon {
  transform: scale(1.1);
}

/* =====================================================
   MOBILE NAV (iOS STYLE)
===================================================== */
.mobile-nav {
  position: fixed;
  bottom: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(96%, 420px);

  background: var(--bg-nav);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 1.6rem;

  display: flex;
  justify-content: space-around;
  padding: 0.6rem 0.4rem;

  box-shadow: 0 18px 40px rgba(0,0,0,.18),
              inset 0 1px 0 rgba(255,255,255,.05);

  z-index: 50;
}

.mobile-nav .nav-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 1.1rem;
  transition: all 0.25s ease;
}

.mobile-nav .nav-item:hover {
  color: var(--accent);
}

.mobile-nav .nav-item:active {
  transform: scale(0.92);
}

.mobile-nav .nav-item.active {
  background: rgba(37,99,235,0.12);
  color: var(--accent);
}


/* -- Start filter Nav Blur -- */

.mobile-nav {
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0,0,0,.08);
}



body.dim .mobile-nav {
    backdrop-filter: blur(16px);
   border-top: 1px solid rgba(0,0,0,.08);
   background-color: #1f29374b;
}


body.dark .mobile-nav {
    backdrop-filter: blur(16px);
   border-top: 1px solid rgba(0,0,0,.08);
   background-color: #17202c4b;
}

/* -- End filter Nav Blur -- */


/* =====================================================
   RESPONSIVE BREAKPOINTS
===================================================== */
@media (min-width: 640px) {
  .quiz-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
  }

  .mobile-nav {
    display: none;
  }

  .quiz-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .card:hover {
    transform: translateY(-3px);
  }
}

/* =====================================================
   ACCESSIBILITY
===================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
