@import url('https://fonts.googleapis.com/css2?family=Goudy+Bookletter+1911&family=Patrick+Hand&display=swap');

:root {
  /* Palette base - Poetic/Watercolor */
  --color-bg: #F9F7F5;
  /* Warm textured white paper */
  --color-card: #FFFFFF;
  /* White watercolor paper */
  --color-text: #2C3333;
  /* Dark charcoal/ink instead of pure black */
  --color-text-muted: #6B7280;

  /* Soft saturated watercolor tones */
  --color-primary: #5D8AA8;
  /* Air Force Blue - watercolor sky */
  --color-primary-hover: #4A708B;
  --color-secondary: #8DA399;
  /* Sage/Seafoam */

  --color-accent: #E8A87C;
  /* Soft coral/peach for highlights */

  --color-answer-hover: #F0F9FF;
  /* Very light wash */
  --color-answer-selected: #E0F2FE;

  --color-success-bg: #E6F4EA;
  /* Soft wash green */
  --color-success-text: #2E7D32;

  --color-error-bg: #FEEBEB;
  /* Soft wash red */
  --color-error-text: #C62828;

  --radius-card: 24px;
  /* More organic/friendly roundedness */
  --radius-pill: 255px;
  /* Hand-drawn circle feel */

  /* Soft painterly shadow */
  --shadow-soft: 0 10px 40px -10px rgba(93, 138, 168, 0.2);
  --border-hand: 2px solid #E5E7EB;
  /* Default border */
}

/* Texture overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* Reset leggero */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Goudy Bookletter 1911', serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* ROOT LAYOUT */
.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.app-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: none;
  z-index: 100;
}

.app-header-left,
.app-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo */
.app-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.app-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 50% 45% 55% 40%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.1);
  transform: rotate(-3deg);
}

.app-logo-title {
  font-family: 'Goudy Bookletter 1911', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.app-logo-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: 'Patrick Hand', cursive;
}

/* Header controls */
.quiz-selector {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8rem;
}

.quiz-selector label {
  color: var(--color-text-muted);
  font-family: 'Patrick Hand', cursive;
}

.quiz-selector select {
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  border: 2px solid #d1d5db;
  padding: 0.35rem 1rem;
  font-size: 0.9rem;
  font-family: 'Goudy Bookletter 1911', serif;
  background: #f9fafb;
  cursor: pointer;
}

.quiz-timer {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  margin: 0rem 0.4rem;
  font-family: 'Patrick Hand', cursive;
}

.user-badge {
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  border: 2px solid transparent;
  background: #eef2ff;
  color: var(--color-primary);
  padding: 0.4rem 1.1rem;
  font-size: 0.95rem;
  font-family: 'Patrick Hand', cursive;
  cursor: pointer;
  transition: all 0.2s;
}

.user-badge:hover {
  background: #dbeafe;
  transform: rotate(1deg);
}

/* User menu dropdown */
.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 200px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.user-dropdown.hidden {
  display: none;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item-danger {
  color: #dc2626;
  border-top: 1px solid #e5e7eb;
}

.dropdown-item-danger:hover {
  background: #fef2f2;
}

/* MAIN LAYOUT */
.app-main {
  flex: 1;
  display: flex;
  gap: 1rem;
  padding: 1rem;
}

/* QUIZ PANEL */
.quiz-panel {
  flex: 2;
  max-width: 820px;
  margin: 0 auto;
}

.quiz-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  /* Organic corners */
  box-shadow: var(--shadow-soft);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.quiz-card::before {
  /* Faint inner border for "paper" feel */
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(0, 0, 0, 0.08);
  /* Stitched look */
  border-radius: 20px;
  pointer-events: none;
}

/* Progress bar */
.quiz-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.quiz-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-family: 'Patrick Hand', cursive;
  /* Handwritten feel */
}

.quiz-progress-counter {
  font-weight: 500;
  font-size: 1rem;
}

.quiz-progress-chapter {
  color: var(--color-secondary);
  font-weight: 500;
  margin-left: 0.4rem;
}

.quiz-progress-bar {
  width: 100%;
  height: 10px;
  /* Slightly thicker */
  border-radius: 999px;
  background: #E5E7EB;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Inner shadow for depth */
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg,
      var(--color-primary),
      var(--color-secondary));
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Watercolor effect via opacity/blend */
  opacity: 0.8;
  filter: contrast(110%);
}

/* Question */
.quiz-question p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  min-height: 5rem;
}

/* Question Image */
.quiz-question-image {
  margin-top: 0.75rem;
  max-width: 100%;
  max-height: 400px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 76, 129, 0.08);
}

/* Answers */
.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  /* Hand-drawn look */
  border: 2px solid #E5E7EB;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-size: 1.05rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
}

.answer-letter {
  width: 28px;
  height: 28px;
  border-radius: 50% 45% 55% 40%;
  border: 2px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  background: #fff;
  flex-shrink: 0;
  font-family: 'Patrick Hand', cursive;
}

.answer-text {
  flex: 1;
}

.answer-option:hover {
  background: var(--color-answer-hover);
  border-color: #bfdbfe;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transform: rotate(-0.5deg);
}

.answer-option:active {
  transform: translateY(1px);
}

.answer-option.selected {
  background: var(--color-answer-selected);
  border-color: var(--color-primary);
  box-shadow: 0 4px 0 rgba(15, 76, 129, 0.1);
  transform: rotate(0.5deg);
}

.answer-option.selected .answer-letter {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.answer-option.correct {
  background: var(--color-success-bg);
  border-color: var(--color-success-text);
  box-shadow: 0 4px 0 rgba(22, 163, 74, 0.2);
}

.answer-option.correct .answer-letter {
  background: var(--color-success-text);
  color: #fff;
  border-color: var(--color-success-text);
}

.answer-option.wrong {
  background: var(--color-error-bg);
  border-color: var(--color-error-text);
}

.answer-option.wrong .answer-letter {
  background: var(--color-error-text);
  color: #fff;
  border-color: var(--color-error-text);
}

/* Feedback */
.quiz-feedback {
  min-height: 1.2rem;
  font-size: 0.85rem;
}

.quiz-feedback--success {
  color: var(--color-success-text);
}

.quiz-feedback--error {
  color: var(--color-error-text);
}

/* Buttons */
.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  /* Organic shape */
  padding: 0.6rem 1.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Patrick Hand', cursive;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:active {
  transform: scale(0.96) rotate(-1deg);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 0 rgba(74, 112, 139, 0.4);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px) rotate(1deg);
  box-shadow: 0 6px 0 rgba(74, 112, 139, 0.4);
}

.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border: 2px solid #e5e7eb;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  border-color: #d1d5db;
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.05);
}

.btn-danger {
  background: var(--color-error-text);
  color: #fff;
  box-shadow: 0 4px 0 rgba(180, 40, 40, 0.3);
}

.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(180, 40, 40, 0.3);
}

.btn-block {
  width: 100%;
}

/* SIDEBAR */
.sidebar-panel {
  flex: 1;
  max-width: 320px;
}

.sidebar-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.sidebar-title {
  margin: 0;
  font-size: 1.1rem;
  font-family: 'Goudy Bookletter 1911', serif;
  font-weight: 600;
  color: var(--color-primary);
}

.sidebar-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-chip {
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  display: inline-flex;
  flex-direction: column;
  font-size: 0.8rem;
  min-width: 80px;
  border: 1px solid transparent;
  font-family: 'Patrick Hand', cursive;
}

.stat-chip--success {
  background: #ecfdf5;
  color: var(--color-success-text);
  border-color: #d1fae5;
  transform: rotate(-1deg);
}

.stat-chip--error {
  background: #fef2f2;
  color: var(--color-error-text);
  border-color: #fee2e2;
  transform: rotate(1deg);
}

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

.stat-value {
  font-weight: 600;
  font-size: 1rem;
}

.sidebar-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-family: 'Patrick Hand', cursive;
  color: var(--color-text-muted);
}

.chapter-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.chapter-pill {
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  padding: 0.4rem 0.9rem;
  background: #eff6ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: transform 0.2s;
}

.chapter-pill:hover {
  transform: scale(1.02);
}

.chapter-pill.strong {
  background: #ecfdf5;
  color: var(--color-success-text);
}

/* MODAL AUTH */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  /* Blur behind modal */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 380px;
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  padding: 2rem;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  0% {
    transform: scale(0.9) translateY(10px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  font-family: 'Patrick Hand', cursive;
  line-height: 1;
}

.modal-title {
  margin: 0.5rem 0 0.2rem;
  font-size: 1.4rem;
  font-family: 'Goudy Bookletter 1911', serif;
  color: var(--color-primary);
}

.modal-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-family: 'Patrick Hand', cursive;
}

/* Tabs login/signup */
.tabs {
  display: inline-flex;
  border-radius: 99px;
  background: #f3f4f6;
  padding: 0.3rem;
  margin: 1.5rem 0;
  width: 100%;
}

.tab {
  flex: 1;
  border-radius: 99px;
  padding: 0.4rem 0.9rem;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text-muted);
  font-family: 'Patrick Hand', cursive;
}

.tab.active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(15, 76, 129, 0.1);
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form.hidden {
  display: none;
}

.auth-form label {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: 'Patrick Hand', cursive;
  color: var(--color-text-muted);
}

.auth-form input {
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  font-family: 'Goudy Bookletter 1911', serif;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fcfdfe;
}

/* UTILS */
.hidden {
  display: none !important;
}

/* ---------------- MOBILE FIRST / RESPONSIVE ---------------- */

@media (max-width: 900px) {
  .app-main {
    flex-direction: column;
    padding: 0.75rem;
  }

  .sidebar-panel {
    max-width: 100%;
    order: -1;
  }

  .sidebar-card {
    margin-bottom: 0.75rem;
  }

  .quiz-panel {
    width: 100%;
    max-width: 100%;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .app-header-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .quiz-actions {
    flex-direction: row-reverse;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 0.6rem 0.75rem;
  }

  .quiz-card {
    padding: 0.85rem 0.9rem 1rem;
  }

  .answer-option {
    padding: 0.6rem 0.75rem;
  }

  .quiz-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .btn {
    width: 100%;
  }

  .sidebar-card {
    padding: 0.85rem;
  }

  .app-logo-title {
    font-size: 1rem;
  }

  .app-logo-subtitle {
    display: none;
  }
}

/* ============================================================
   NAVIGAZIONE & PAGINE (NUOVI COMPONENTI, STESSO LOOK & FEEL)
   ============================================================ */

/* Nav sotto l'header */
.app-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.25rem;
  background: transparent;
  overflow-x: auto;
  /* Ensure scroll on small screens */
}

/* Tab di navigazione */
.nav-tab {
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  padding: 0.45rem 1.1rem;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  font-family: 'Patrick Hand', cursive;
  white-space: nowrap;
}

.nav-tab:hover {
  background: rgba(229, 231, 235, 0.5);
  /* lighter hover */
  transform: rotate(-1deg);
}

.nav-tab-active {
  background: var(--color-card);
  color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(15, 76, 129, 0.08);
  border-color: rgba(0, 0, 0, 0.05);
  transform: rotate(1deg);
}

/* Contenitore centrale delle pagine (al posto del solo quiz-panel) */
.page-container {
  flex: 2;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Sezioni pagina (Menu / Quiz / Statistiche / Account) */
.page-section {
  width: 100%;
}

/* Card generica di pagina (stesso stile della quiz-card) */
.page-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.page-card::before {
  /* Faint inner border for "paper" feel */
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(0, 0, 0, 0.08);
  /* Stitched look */
  border-radius: 20px;
  pointer-events: none;
}

/* Titoli e sottotitoli delle pagine */
.page-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.page-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Testo attenuato riusabile */
.muted {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Variante bottone small (per i bottoni nel menu) */
.btn-small {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  margin: 0.25rem;
}

/* ======================
   PAGINA MENU ALLENAMENTO
   ====================== */

.quiz-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.quiz-menu-card {
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quiz-menu-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.quiz-menu-card p {
  margin: 0;
  font-size: 0.8rem;
}

/* ======================
   PAGINA STATISTICHE
   ====================== */

.stats-overview {
  font-size: 0.9rem;
}

.stats-overview p {
  margin: 0;
}

.stats-by-type {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.stats-type-card {
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
}

.stats-type-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.stats-last-attempts {
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

.attempt-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.attempt-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.attempt-item:last-child {
  border-bottom: none;
}

/* ======================
   PAGINA ACCOUNT
   ====================== */

.account-info {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

/* ======================
   RESPONSIVE PER NUOVE PARTI
   ====================== */

@media (max-width: 900px) {
  .app-nav {
    padding: 0.5rem 0.75rem 0.25rem;
    overflow-x: auto;
  }

  .page-container {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .page-card {
    padding: 0.85rem 0.9rem 1rem;
  }

  .nav-tab {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
  }
}

/* ======================
   TRAINING IMAGES
   ====================== */

.image-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.image-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(15, 76, 129, 0.12);
}

.image-card-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
}

.image-card-info {
  padding: 0.75rem 1rem;
  background: var(--color-card);
}

.image-card-badge {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 0.35rem 0.9rem;
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'Patrick Hand', cursive;
}

.loading-message,
.empty-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* Modal for image questions */
.modal-dialog-large {
  max-width: 800px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-header {
  padding: 0;
  margin-bottom: 1.5rem;
}

.modal-image-preview {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius-card);
}

.image-questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.image-question-item {
  padding: 1rem;
  background: #F9FAFB;
  border-radius: 12px;
  border-left: 4px solid var(--color-primary);
}

.image-question-header {
  margin-bottom: 1rem;
}

.question-number {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.image-question-text {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
}

.image-answers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.image-answer-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  border: 2px solid transparent;
}

.image-answer-item.correct-answer {
  border-color: var(--color-success-text);
  background: var(--color-success-bg);
}

.image-answer-item .answer-letter {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.9rem;
}

.image-answer-item.correct-answer .answer-letter {
  background: var(--color-success-text);
}

.image-answer-item .answer-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--color-text);
}

@media (max-width: 600px) {
  .image-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .image-card-img {
    height: 200px;
  }

  .modal-dialog-large {
    max-width: 95%;
    max-height: 85vh;
    padding: 1rem;
    width: 95%;
  }

  .modal-header {
    margin-bottom: 1rem;
  }

  .image-question-item {
    padding: 0.75rem;
  }

  .image-questions-list {
    gap: 1rem;
  }
}

/* Detailed stats simple styles */
.stats-by-theme {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.theme-card {
  background: var(--color-card);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  padding: 12px;
  font-size: 0.9rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  box-shadow: var(--shadow-soft);
  border-radius: 12px;
  overflow: hidden;
}

.stats-table th,
.stats-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

.stats-table thead th {
  background: #f3f4f6;
  font-weight: 600;
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

/* Keyboard hint for quiz */
.quiz-keyboard-hint {
  text-align: center;
  margin-top: 1rem;
  padding: 0.6rem;
  background: #f0f9ff;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-left: 3px solid var(--color-primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background: white;
  color: #333;
  font-size: 0.95rem;
  min-width: 300px;
  animation: slideInRight 0.3s ease-out;
  pointer-events: auto;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-family: 'Patrick Hand', cursive;
}

.toast-icon {
  font-weight: 600;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.toast-message {
  flex: 1;
}

.toast-success {
  background: #ecfdf5;
  color: #166534;
  border-left: none;
  /* Removed heavy border */
  border: 1px solid #d1fae5;
}

.toast-success .toast-icon {
  color: #16a34a;
}

.toast-error {
  background: #fef2f2;
  color: #7f1d1d;
  border-left: none;
  border: 1px solid #fee2e2;
}

.toast-error .toast-icon {
  color: #dc2626;
}

.toast-warning {
  background: #fffbeb;
  color: #92400e;
  border-left: none;
  border: 1px solid #fde68a;
}

.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-info {
  background: #eff6ff;
  color: #1e40af;
  border-left: none;
  border: 1px solid #dbeafe;
}

.toast-info .toast-icon {
  color: #3b82f6;
}

.toast-exit {
  animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Admin Panel Styles */
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  box-shadow: var(--shadow-soft);
  border-radius: 12px;
  overflow: hidden;
}

.admin-users-table th,
.admin-users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.95rem;
  text-align: left;
}

.admin-users-table thead th {
  background: #f3f4f6;
  font-weight: 600;
  color: #374151;
}

.admin-users-table tbody tr:hover {
  background: #f9fafb;
}

.admin-users-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-action-btn {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.admin-action-btn:hover {
  background: #bfdbfe;
  border-color: #60a5fa;
}

.modal-dialog-large {
  max-width: 600px;
}