/* ========================================================
   MOTJE - Vrolijke & Rustige Styling voor Kinderen
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --font-display: 'Fredoka', cursive, sans-serif;
  --font-body: 'Nunito', sans-serif;

  /* Vriendelijke & rustige kinderkleuren */
  --bg-gradient-start: #f0f7ff;
  --bg-gradient-end: #eaf4fd;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;

  /* Accentkleuren */
  --color-primary: #5c6ac4;
  --color-primary-hover: #4b58ad;
  --color-primary-light: #eff2fe;

  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;

  --color-error: #f43f5e;
  --color-error-bg: #fff1f2;
  --color-error-border: #fecdd3;

  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;

  --color-sky: #0ea5e9;
  --color-purple: #8b5cf6;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 16px rgba(79, 93, 149, 0.08);
  --shadow-lg: 0 12px 28px rgba(79, 93, 149, 0.12);
  --shadow-btn: 0 4px 0 #3b4588;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

/* ================= HEADER & NAVIGATIE ================= */

.header {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-top {
  display: contents;
}

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

.logo-icon {
  font-size: 2.2rem;
  display: inline-block;
  animation: floatIcon 3s ease-in-out infinite;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.logo-tag {
  background: #fef3c7;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  margin-left: 0.3rem;
}

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

.nav-btn {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-btn.active {
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 4px 10px rgba(92, 106, 196, 0.3);
}

.nav-btn-admin {
  color: #d97706;
  background: #fef3c7;
}

.nav-btn-admin:hover {
  color: #b45309;
  background: #fde68a;
}

.nav-btn-admin.active {
  color: #ffffff;
  background: #d97706;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

/* ================= HOOFDCONTAINER ================= */

.main-content {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

/* ================= BEDIENING & INSTELLINGENBALK ================= */

.controls-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 2px solid #f1f5f9;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Segmented Buttons */
.segmented-control {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  padding: 0.25rem;
  gap: 0.25rem;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.seg-btn.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.select-dropdown {
  appearance: none;
  background: #f8fafc url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6ac4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 0.75rem center/16px 16px;
  border: 2px solid #e2e8f0;
  padding: 0.45rem 2.2rem 0.45rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.select-dropdown:hover, .select-dropdown:focus {
  border-color: var(--color-primary);
  background-color: #ffffff;
}

/* ================= PRAKTIJKKAART (OEFENEN) ================= */

.card-container {
  perspective: 1000px;
}

.practice-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 3px solid #e8effe;
  position: relative;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.category-tag {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stats-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.streak-pill {
  background: #fef3c7;
  color: #d97706;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15);
}

.flame-icon {
  animation: pulseFlame 1.5s infinite;
}

/* Prompt */
.prompt-section {
  margin: 1.5rem 0 2rem 0;
  position: relative;
}

.prompt-direction-hint {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.prompt-word-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.prompt-word {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.audio-btn {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 2px solid transparent;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.2s ease;
}

.audio-btn:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: scale(1.1);
}

.audio-btn-inline {
  background: #eff2fe;
  color: var(--color-primary);
  border: 1.5px solid #c7d2fe;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.audio-btn-inline:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  transform: scale(1.15);
}

/* ================= TYPEN MODUS ================= */

.typing-form {
  max-width: 540px;
  margin: 0 auto;
}

.input-group {
  position: relative;
  margin-bottom: 1rem;
}

.answer-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 3px solid #cbd5e1;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.answer-input:focus {
  border-color: var(--color-primary);
  background: #ffffff;
  box-shadow: 0 0 0 5px rgba(92, 106, 196, 0.15);
}

/* Knoppen voor speciale Franse tekens */
.accent-shortcuts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.accent-btn {
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  color: #334155;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.accent-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* ================= QUIZ MODUS (MEERKEUZE) ================= */

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 620px;
  margin: 1.5rem auto;
}

.quiz-option-btn {
  background: #f8fafc;
  border: 3px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.1rem 1rem;
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.quiz-option-btn:hover:not(:disabled) {
  background: #ffffff;
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.quiz-option-btn.correct {
  background: var(--color-success-bg) !important;
  border-color: var(--color-success) !important;
  color: #065f46 !important;
  animation: bounceCorrect 0.5s ease;
}

.quiz-option-btn.wrong {
  background: var(--color-error-bg) !important;
  border-color: var(--color-error) !important;
  color: #9f1239 !important;
  animation: shakeWrong 0.5s ease;
}

.quiz-option-btn:disabled {
  cursor: default;
}

/* ================= ACTIEKNOPPEN ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 0 #434e96, 0 8px 16px rgba(92, 106, 196, 0.3);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #434e96, 0 10px 20px rgba(92, 106, 196, 0.4);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #434e96;
}

.btn-success {
  background: var(--color-success);
  color: #ffffff;
  box-shadow: 0 4px 0 #059669, 0 8px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
}

.btn-outline {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: var(--text-main);
  box-shadow: 0 3px 0 #cbd5e1;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-2px);
}

/* ================= FEEDBACKKAART ================= */

.feedback-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  animation: slideUp 0.3s ease-out;
  display: none;
}

.feedback-card.correct {
  display: block;
  background: var(--color-success-bg);
  border: 3px solid var(--color-success-border);
}

.feedback-card.wrong {
  display: block;
  background: var(--color-error-bg);
  border: 3px solid var(--color-error-border);
}

.feedback-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.feedback-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feedback-card.correct .feedback-title {
  color: #065f46;
}

.feedback-card.wrong .feedback-title {
  color: #9f1239;
}

.feedback-solution {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.75rem 0;
  color: #1e293b;
}

.accent-tip-box {
  background: #fef3c7;
  border: 2px dashed #f59e0b;
  color: #92400e;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* ================= STATISTIEKEN PAGINA ================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow-md);
  border: 2px solid #f1f5f9;
  text-align: center;
  transition: transform 0.2s ease;
}

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

.stat-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.table-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 2px solid #f1f5f9;
}

.table-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-input {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  outline: none;
  min-width: 240px;
}

.search-input:focus {
  border-color: var(--color-primary);
}

.table-wrapper {
  overflow-x: auto;
}

.words-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.words-table th {
  background: #f8fafc;
  padding: 0.9rem 1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid #e2e8f0;
}

.words-table td {
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
}

.words-table tr:hover td {
  background: #f8fafc;
}

.badge-mastered {
  background: #ecfdf5;
  color: #065f46;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-practice {
  background: #fff1f2;
  color: #9f1239;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-new {
  background: #f1f5f9;
  color: #64748b;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 800;
}

/* ================= CONFETTI CANVAS ================= */

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ================= FOOTER ================= */

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ================= ANIMATIES ================= */

@keyframes floatIcon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

@keyframes pulseFlame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes bounceCorrect {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
  .header {
    padding: 0.5rem 0.75rem;
  }
  .header-container {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: stretch;
  }
  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .logo {
    gap: 0.4rem;
  }
  .logo-icon {
    font-size: 1.8rem;
  }
  .logo-text {
    font-size: 1.45rem;
  }
  .logo-tag {
    display: none;
  }
  .user-pill-container {
    padding: 0.25rem 0.6rem;
    gap: 0.4rem;
  }
  .user-pill {
    font-size: 0.85rem;
  }
  .user-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }
  .switch-link {
    font-size: 0.8rem;
  }
  .nav-links {
    width: 100%;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: var(--radius-full);
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-btn {
    flex: 1 0 auto;
    justify-content: center;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    white-space: nowrap;
    background: transparent;
  }
  .nav-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(92, 106, 196, 0.35);
  }
  .nav-btn-admin.active {
    background: #d97706;
    color: #ffffff;
  }
  .quiz-grid {
    grid-template-columns: 1fr;
  }
  .prompt-word {
    font-size: 2rem;
  }
  .controls-card {
    flex-direction: column;
    align-items: stretch;
  }
  .practice-card {
    padding: 1.5rem 1rem;
  }
  .main-content {
    padding: 1rem 0.75rem 2.5rem 0.75rem;
  }
}

/* ================= GEBRUIKER-HEADER & SWITCHER ================= */

.user-pill-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.user-role-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.switch-link {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.switch-link:hover {
  text-decoration: underline;
}

/* ================= LIJSTEN GRID & KAARTEN ================= */

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

.list-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
  border: 2px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

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

.active-list-border {
  border: 3px solid var(--color-primary);
  background: #fafbff;
}

.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.list-badge {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
}

.current-badge {
  background: #fef3c7;
  color: #d97706;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.list-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.list-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 1.5rem;
}

.list-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.list-action-btn {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
}


/* ================= MODAL DIALOGEN ================= */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
  border: 2px solid #e2e8f0;
  animation: slideUp 0.2s ease-out;
  box-sizing: border-box;
  margin: auto;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0.75rem 0.5rem;
    align-items: flex-start;
  }

  .modal-content {
    padding: 1.25rem 1rem;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
}

/* ================= SCHOOLVAKKEN & CATEGORIEËN ================= */

.subject-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.subject-tabs-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.subject-tab-btn {
  background: #ffffff;
  color: #475569;
  border: 2px solid #e2e8f0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.subject-tab-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

.subject-tab-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(92, 106, 196, 0.35);
}

/* ================= TOPOGRAFIE & MEDIA ================= */

.prompt-image-container {
  margin: 1rem auto;
  text-align: center;
  max-width: 100%;
}

.prompt-image-container img {
  max-height: 260px;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prompt-image-container img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* ================= ADMIN DASHBOARD SIDEBAR & TABS ================= */

.admin-header-bar {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header-title h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: #1e293b;
  margin-bottom: 0.3rem;
}

.admin-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-layout-wrapper {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-top: 1.25rem;
}

.admin-sidebar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 10;
}

.admin-mobile-bar {
  display: none;
}

.admin-sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-sidebar-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  padding: 0 0.6rem 0.3rem 0.6rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #334155;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.admin-nav-item:hover {
  background: #f1f5f9;
  color: var(--color-primary);
}

.admin-nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: #c7d2fe;
}

.admin-nav-icon {
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.admin-nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-nav-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: #475569;
}

.admin-nav-item.active .admin-nav-badge {
  background: var(--color-primary);
  color: #ffffff;
}

/* RESPONSIVE LAYOUT VOOR MOBIEL & TABLET */
@media (max-width: 960px) {
  .admin-header-bar {
    margin-bottom: 1rem;
    gap: 0.75rem;
  }

  .admin-header-title h1 {
    font-size: 1.5rem;
  }

  .admin-header-title p {
    font-size: 0.9rem !important;
  }

  .admin-header-actions {
    width: 100%;
    gap: 0.5rem;
  }

  .admin-header-actions .btn {
    flex: 1 1 auto;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    justify-content: center;
  }

  .admin-layout-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
  }

  /* CRUCIAAL: sidebar mag op mobiel NOOIT sticky zijn zodat inhoud er niet achter verdwijnt */
  .admin-sidebar {
    position: relative !important;
    top: auto !important;
    padding: 0.75rem 0.85rem !important;
    gap: 0 !important;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 5;
  }

  /* Compacte mobiele navigatiebalk */
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    user-select: none;
    gap: 0.75rem;
    padding: 0.1rem 0;
  }

  .admin-mobile-active-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
  }

  .admin-mobile-tag {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f1f5f9;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
  }

  .admin-mobile-active-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .admin-mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-primary-light, #eef2ff);
    color: var(--color-primary);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-full);
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
  }

  .admin-mobile-chevron {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
    display: inline-block;
  }

  .admin-sidebar.is-open .admin-mobile-chevron {
    transform: rotate(180deg);
  }

  /* Sidebar inhoud is standaard ingeklapt op mobiel, uitgeklapt bij .is-open */
  .admin-sidebar-body {
    display: none;
    padding-top: 1rem;
    margin-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    gap: 1rem;
    animation: fadeInMenu 0.18s ease-out;
  }

  .admin-sidebar.is-open .admin-sidebar-body {
    display: flex;
  }

  .admin-nav-item {
    padding: 0.75rem 0.85rem;
    font-size: 1rem;
  }

  .admin-subject-header-card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    gap: 1rem !important;
  }

  @keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.admin-tab-pane {
  display: none;
}

.admin-tab-pane.active {
  display: block;
  animation: fadeInPane 0.2s ease;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-subject-header-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* ================= AI HUISWERK ASSISTENT CHAT CONSOLE ================= */

.agent-console-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 720px;
  max-height: 85vh;
  overflow: hidden;
}

.agent-console-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.agent-chat-window {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #fafafa;
}

.agent-message {
  display: flex;
  gap: 0.85rem;
  max-width: 85%;
  animation: fadeInPane 0.2s ease;
}

.agent-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.agent-message.assistant {
  align-self: flex-start;
}

.agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.agent-avatar.assistant {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.agent-avatar.user {
  background: #ede9fe;
  border: 1px solid #ddd6fe;
}

.agent-bubble {
  padding: 1rem 1.25rem;
  border-radius: 18px;
  font-size: 0.98rem;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
}

.agent-bubble.user {
  background: var(--color-primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.agent-bubble.assistant {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.agent-attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.import-proposal-card {
  margin-top: 1rem;
  background: #f8fafc;
  border: 2px solid #bae6fd;
  border-radius: 14px;
  padding: 1.15rem;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.import-proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.import-items-table-scroll {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 1rem;
}

.import-items-table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.import-items-table-scroll th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.8rem;
  color: #475569;
  border-bottom: 1px solid #cbd5e1;
}

.import-items-table-scroll td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.agent-input-container {
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.agent-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.agent-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #334155;
}

.agent-file-chip-remove {
  cursor: pointer;
  color: #94a3b8;
  font-weight: 700;
  margin-left: 0.2rem;
}

.agent-file-chip-remove:hover {
  color: #e11d48;
}

.agent-quick-prompts {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.agent-quick-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.agent-quick-chip:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: #c7d2fe;
}

/* ================= PWA INSTALL BANNER & STANDALONE SUPPORT ================= */

.pwa-install-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 520px;
  background: #ffffff;
  border: 2px solid #c7d2fe;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.15rem;
  box-shadow: 0 10px 30px rgba(92, 106, 196, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  z-index: 999;
  animation: slideUpBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpBanner {
  from { opacity: 0; transform: translate(-50%, 25px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.pwa-install-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.pwa-install-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.pwa-install-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pwa-install-text strong {
  font-size: 0.95rem;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-text span {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pwa-btn-sm {
  padding: 0.5rem 0.95rem !important;
  font-size: 0.88rem !important;
  white-space: nowrap;
  box-shadow: none !important;
}

.pwa-close-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pwa-close-btn:hover {
  color: #1e293b;
  background: #f1f5f9;
}

@media (max-width: 480px) {
  .pwa-install-banner {
    bottom: 0.75rem;
    padding: 0.75rem 0.85rem;
  }
  .pwa-install-text span {
    display: none;
  }
}

/* Standalone PWA ondersteuning (volledig scherm op telefoon met veilige marges) */
@media all and (display-mode: standalone) {
  .header {
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }
  body {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  /* Geen install banner tonen wanneer app reeds als standalone draait */
  #pwa-install-banner {
    display: none !important;
  }
}

/* ==============================================================================
   CHALLENGES HUB & CARDS STYLING
   ============================================================================== */
.challenges-hub-header {
  margin-bottom: 2rem;
}

.challenge-rules-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.challenge-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.challenge-rule-icon {
  font-size: 1.75rem;
  line-height: 1;
  background: #f1f5f9;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.challenge-rule-item strong {
  display: block;
  color: #1e293b;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.challenge-rule-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.challenge-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.challenge-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.challenge-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.challenge-badge-subject {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.challenge-badge-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fdf2f8;
  color: #be185d;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.challenge-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.challenge-card-desc {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 1rem 0;
  flex: 1;
}

.challenge-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1rem;
}

.challenge-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
}

.challenge-leader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #854d0e;
}

.challenge-leader-name {
  color: #a16207;
  font-weight: 600;
}

.challenge-start-btn {
  width: 100%;
  justify-content: space-between;
  padding: 0.75rem 1.15rem;
  font-size: 1rem;
  border-radius: 12px;
  text-decoration: none;
}




