/* ================================
   ZITPLANMAKER — zitplan.css
================================ */

:root {
  --bg:         #f0f4ff;
  --sidebar-bg: #1e1e2e;
  --sidebar-w:  280px;
  --board-bg:   #2d6a4f;
  --accent:     #4f8ef7;
  --text:       #1a1a2e;
  --muted:      #8892b0;
  --border:     #dde3f5;
  --seat-empty: #eef1fc;
  --seat-hover: #dce8ff;
  --radius-lg:  1.2rem;
  --radius-md:  0.9rem;
  --radius-sm:  0.5rem;
  --shadow:     0 4px 20px rgba(79,142,247,0.12);
  --shadow-lg:  0 8px 32px rgba(79,142,247,0.22);

  /* Bankkleuren — 8 zachte pastels */
  --seat-c0: #5b9cf6;
  --seat-c1: #6ec6f5;
  --seat-c2: #7b8ef7;
  --seat-c3: #60c9b0;
  --seat-c4: #76b8f7;
  --seat-c5: #8ab4fa;
  --seat-c6: #5eb8e8;
  --seat-c7: #6fa8e8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ================================
   APP LAYOUT
================================ */
.app { display: flex; height: 100vh; }

/* ================================
   SIDEBAR
================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #cdd6f4;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #313244 transparent;
}

.sidebar-header {
  padding: 1.4rem 1.2rem 1rem;
  border-bottom: 1px solid #313244;
}

.logo {
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  color: #cba6f7;
  letter-spacing: 0.5px;
}

.panel {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #313244;
}

.panel-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #6c7086;
  margin-bottom: 0.8rem;
}

/* Input + add */
.add-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.add-row input {
  flex: 1;
  background: #313244;
  border: 1.5px solid #45475a;
  border-radius: var(--radius-sm);
  color: #cdd6f4;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  transition: border-color 0.2s;
}
.add-row input:focus { outline: none; border-color: var(--accent); }

.btn-add {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  width: 36px; height: 36px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.btn-add:hover { background: #6fa3ff; transform: scale(1.1); }

/* ================================
   DRAG & DROP IMPORTZONE
================================ */
.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: #252537;
  border: 2px dashed #45475a;
  border-radius: var(--radius-md);
  padding: 0.9rem 0.6rem;
  margin-bottom: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.drop-zone:hover,
.drop-zone.drag-active {
  border-color: #cba6f7;
  background: #2e2a45;
}

.drop-zone.drag-active {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(203,166,247,0.25);
}

.drop-icon  { font-size: 1.4rem; line-height: 1; }
.drop-text  { font-size: 0.8rem; font-weight: 700; color: #cdd6f4; }
.drop-sub   { font-size: 0.68rem; color: #6c7086; }

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Name list */
.name-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 160px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #45475a transparent;
  margin-bottom: 0.5rem;
}

.name-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #313244;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem 0.35rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cdd6f4;
  cursor: grab;
  transition: background 0.15s;
  user-select: none;
}
.name-list li:hover   { background: #45475a; }
.name-list li.placed  { opacity: 0.4; cursor: default; }

.name-list li .del-btn {
  background: none;
  border: none;
  color: #6c7086;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
  transition: color 0.15s;
}
.name-list li .del-btn:hover { color: #f38ba8; }

.name-stats {
  font-size: 0.72rem;
  color: #6c7086;
  font-weight: 600;
}

/* Grid controls */
.grid-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.grid-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6c7086;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.grid-controls input[type="number"] {
  width: 64px;
  background: #313244;
  border: 1.5px solid #45475a;
  border-radius: var(--radius-sm);
  color: #cdd6f4;
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  text-align: center;
  padding: 0.3rem;
  -moz-appearance: textfield;
  appearance: textfield;
}
.grid-controls input[type="number"]::-webkit-inner-spin-button { display: none; }
.grid-controls input[type="number"]:focus { outline: none; border-color: var(--accent); }

/* Buttons */
.btn-full {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.4rem;
  text-align: left;
}
.btn-full:last-child { margin-bottom: 0; }

#applyGridBtn          { background: var(--accent); color: #fff; }
#applyGridBtn:hover    { background: #6fa3ff; }
.btn-shuffle           { background: #cba6f7; color: #1e1e2e; }
.btn-shuffle:hover     { background: #d8b4fe; transform: translateY(-1px); }
.btn-clear-seats       { background: #313244; color: #fab387; }
.btn-clear-seats:hover { background: #45475a; }
.btn-clear             { background: #313244; color: #f38ba8; }
.btn-clear:hover       { background: #45475a; }
.btn-print             { background: #313244; color: #a6e3a1; }
.btn-print:hover       { background: #45475a; }

/* ================================
   MODAL
================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 1.5rem;
  padding: 2rem 2rem 1.6rem;
  width: 320px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  transform: scale(0.88) translateY(16px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.4), opacity 0.2s ease;
  opacity: 0;
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-icon {
  font-size: 2.8rem;
  margin-bottom: 0.6rem;
  line-height: 1;
}

.modal-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  color: #cdd6f4;
  margin-bottom: 0.5rem;
}

.modal-text {
  font-size: 0.88rem;
  color: #6c7086;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.modal-btns {
  display: flex;
  gap: 0.7rem;
}

.modal-btn {
  flex: 1;
  border: none;
  border-radius: 0.8rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.modal-cancel {
  background: #313244;
  color: #cdd6f4;
}
.modal-cancel:hover {
  background: #45475a;
}

.modal-confirm {
  background: #f38ba8;
  color: #1e0010;
}
.modal-confirm:hover {
  background: #f7a8bc;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(243,139,168,0.35);
}



/* ================================
   CLASSROOM AREA
================================ */
.classroom-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem 2rem;
  gap: 1.2rem;
  position: relative;
}

.classroom-header { display: flex; justify-content: center; }

.board {
  background: var(--board-bg);
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  letter-spacing: 2px;
  padding: 0.6rem 3rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(45,106,79,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  border-bottom: 4px solid #1b4332;
}

.classroom-scroll {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 1rem;
}

/* ================================
   CLASS GRID
================================ */
.class-grid { display: grid; gap: 0.9rem; }

/* ================================
   SEAT — kleurcodering
================================ */
.seat {
  width: 128px;
  height: 108px;
  background: var(--seat-empty);
  border: 2.5px dashed #c5cee8;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
  user-select: none;
  padding: 0.4rem 0.3rem;
}

.seat:hover {
  border-color: var(--accent);
  background: var(--seat-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* Kleurvarianten voor bezette stoelen */
.seat.filled { border: none; box-shadow: var(--shadow); cursor: grab; }
.seat.filled:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); filter: brightness(1.08); }
.seat.filled:active { cursor: grabbing; }

.seat.color-0 { background: var(--seat-c0); }
.seat.color-1 { background: var(--seat-c1); }
.seat.color-2 { background: var(--seat-c2); }
.seat.color-3 { background: var(--seat-c3); }
.seat.color-4 { background: var(--seat-c4); }
.seat.color-5 { background: var(--seat-c5); }
.seat.color-6 { background: var(--seat-c6); }
.seat.color-7 { background: var(--seat-c7); }

.seat.drag-over {
  border: 2.5px solid #cba6f7 !important;
  background: #ede9fe !important;
  transform: scale(1.06);
}

/* Shuffle animatie */
@keyframes seat-pop {
  0%   { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  65%  { transform: scale(1.14) rotate(4deg);  opacity: 1; }
  82%  { transform: scale(0.96) rotate(-1deg); }
  100% { transform: scale(1)    rotate(0deg);  opacity: 1; }
}

.seat.shuffling {
  animation: seat-pop 0.48s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Emoji */
.seat-icon { font-size: 2rem; line-height: 1; }

/* Naam — groot & leesbaar */
.seat-name {
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
  width: 116px;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.22);
}

.seat:not(.filled) .seat-name { display: none; }
.seat:not(.filled) .seat-icon { color: #b8c1e8; }

/* Remove knop */
.seat-remove {
  position: absolute;
  top: 4px; right: 5px;
  background: rgba(255,255,255,0.25);
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 0.7rem;
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.seat.filled:hover .seat-remove { display: flex; }
.seat-remove:hover { background: rgba(247,111,111,0.85); }

/* ================================
   CONFETTI CANVAS
================================ */
#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ================================
   TOAST
================================ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1e2e;
  color: #cdd6f4;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================================
   PRINT
================================ */
@media print {
  body { background: #fff; overflow: auto; }
  .sidebar, .classroom-header, .toast, #confettiCanvas { display: none !important; }
  .app { display: block; }
  .classroom-area { padding: 1rem; overflow: visible; }
  .classroom-scroll { overflow: visible; }
  .seat { width: 110px; height: 90px; break-inside: avoid; }
  .seat.filled {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .seat-name { font-size: 0.9rem !important; width: 100px !important; color: #fff !important; }
  .seat-remove { display: none !important; }
  .class-grid { gap: 0.5rem; }
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 700px) {
  .sidebar { width: 220px; min-width: 220px; }
  .seat { width: 96px; height: 84px; }
  .seat-icon { font-size: 1.5rem; }
  .seat-name { font-size: 0.85rem; width: 86px; }
  .classroom-area { padding: 1rem; }
}
