/* ==========================================================================
   FİLM GİBİ SINIF (DOJO-APP) - ANA STİL SİSTEMİ (style.css)
   Modern, Mobil Öncelikli, Canlı Dojo Renkleri (Indigo, Emerald, Amber, Rose, Sky)
   Hostinger & TWA/PWA Uyumlu Vanilla CSS3
   ========================================================================== */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --emerald: #10b981;
  --emerald-dark: #059669;
  --emerald-light: #d1fae5;

  --amber: #f59e0b;
  --amber-dark: #d97706;
  --amber-light: #fef3c7;

  --rose: #f43f5e;
  --rose-dark: #e11d48;
  --rose-light: #ffe4e6;

  --sky: #0ea5e9;
  --sky-dark: #0284c7;
  --sky-light: #e0f2fe;

  --purple: #8b5cf6;
  --purple-light: #ede9fe;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.85);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border: #e2e8f0;
  --border-focus: #6366f1;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Sayfa Kapsayıcı */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Üst Başlık & Navigasyon */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buton Stilleri */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-rose {
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.btn-amber {
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 13px 24px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Sınıf Seçim Çubuğu */
.class-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px 0;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.class-pill {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.class-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.class-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Hızlı İstatistik ve Aksiyon Şeridi */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-card .value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.stat-card.highlight {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, #fff, var(--primary-light));
}

.stat-card.highlight .value {
  color: var(--primary);
}

/* Öğrenci Kartları Izgarası (Dojo Grid) */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.student-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

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

.student-card:active {
  transform: scale(0.98);
}

.student-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

/* Öğrenci Rozetleri ve Puan Balonu */
.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.rank-badge.top-1 {
  background: #fef08a;
  color: #854d0e;
  border-color: #facc15;
}
.rank-badge.top-2 {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}
.rank-badge.top-3 {
  background: #fed7aa;
  color: #9a3412;
  border-color: #fdba74;
}

.points-bubble {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 32px;
  padding: 2px 8px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--emerald-light);
  color: var(--emerald-dark);
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.points-bubble.negative {
  background: var(--rose-light);
  color: var(--rose-dark);
  border-color: rgba(244, 63, 94, 0.3);
}

.monster-avatar {
  width: 80px;
  height: 80px;
  margin: 8px 0 10px 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.student-card:hover .monster-avatar {
  transform: scale(1.08) rotate(2deg);
}

.student-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.2;
}

.student-no {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Puan Verme Modalı / Alt Sayfası */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* Hızlı Gerekçe Butonları */
.quick-reasons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.reason-btn {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.reason-btn:hover {
  border-color: var(--primary);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.reason-btn .reason-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.reason-btn .reason-pts {
  font-weight: 800;
  font-size: 0.88rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.reason-btn.positive .reason-pts {
  background: var(--emerald-light);
  color: var(--emerald-dark);
}

.reason-btn.negative .reason-pts {
  background: var(--rose-light);
  color: var(--rose-dark);
}

/* Sayısal Puan Seçici (+1 .. +5, -1 .. -5) */
.points-selector-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.pt-btn {
  flex: 1;
  min-width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.pt-btn.pos {
  color: var(--emerald-dark);
  border-color: rgba(16, 185, 129, 0.3);
}
.pt-btn.pos:hover, .pt-btn.pos.active {
  background: var(--emerald);
  color: #fff;
  border-color: var(--emerald);
}

.pt-btn.neg {
  color: var(--rose-dark);
  border-color: rgba(244, 63, 94, 0.3);
}
.pt-btn.neg:hover, .pt-btn.neg.active {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose);
}

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

.toast {
  background: var(--text-main);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-width: 360px;
}

.toast.success {
  background: #065f46;
  border-left: 4px solid var(--emerald);
}

.toast.danger {
  background: #881337;
  border-left: 4px solid var(--rose);
}

.toast.info {
  background: #1e1b4b;
  border-left: 4px solid var(--primary);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Kiosk (Akıllı Tahta) Özel Tam Ekran Stili */
.kiosk-body {
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

.kiosk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.kiosk-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kiosk-badge {
  background: rgba(99, 102, 241, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.6);
  color: #a5b4fc;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.kiosk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.kiosk-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(8px);
}

.kiosk-card .monster-avatar {
  width: 100px;
  height: 100px;
  margin: 10px 0;
}

.kiosk-card .student-name {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
}

.kiosk-card .points-bubble {
  top: 14px;
  right: 14px;
  font-size: 1rem;
  padding: 4px 12px;
  height: 28px;
  font-weight: 900;
}

/* Kiosk Canlı Animasyon (Pop & Shake) */
@keyframes kioskPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22) rotate(-3deg); box-shadow: 0 0 35px var(--emerald); border-color: var(--emerald); }
  70% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1); }
}

.kiosk-card.just-awarded {
  animation: kioskPop 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.15);
}

/* Puan Uçuş Efekti */
.floating-award {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 20px var(--emerald);
  pointer-events: none;
  animation: floatUp 1.4s ease-out forwards;
  z-index: 100;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -40px) scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100px) scale(1);
  }
}

/* Sekmeler ve Filtreler */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tablo Stili (Sözlü Notu ve Geçmiş) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

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

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

/* Giriş Kartları (A4 Print Styles) */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .no-print {
    display: none !important;
  }
  .print-page {
    width: 210mm;
    margin: 0 auto;
    padding: 10mm;
    page-break-after: always;
  }
  .cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(4, 1fr) !important;
    gap: 8mm !important;
    height: 270mm !important;
  }
  .student-id-card {
    border: 1.5px dashed #64748b !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

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

.student-id-card {
  background: #fff;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  page-break-inside: avoid;
}

.cut-icon {
  position: absolute;
  top: -10px;
  right: 14px;
  background: #fff;
  padding: 0 4px;
  font-size: 14px;
  color: #64748b;
}

.card-top {
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-school {
  font-size: 0.75rem;
  font-weight: 800;
  color: #4f46e5;
  text-transform: uppercase;
}

.card-class {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.card-content {
  display: flex;
  gap: 12px;
  align-items: center;
}

.card-qr-box {
  width: 92px;
  height: 92px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.card-details {
  flex: 1;
}

.card-student-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.card-pin-box {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.pin-pill {
  background: #f1f5f9;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pin-pill strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 1px;
}

/* Mobil Duyarlılık */
@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions {
    justify-content: space-between;
  }
  .student-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .quick-reasons-grid {
    grid-template-columns: 1fr;
  }
}
