/* ==============================================================
   Skoldetektiven - Skolplus AB Theme Stylesheet
   Grade Level: Åk 4–6 (10–12 years)
   ============================================================== */

:root {
  --sd-primary: #3b82f6;
  --sd-primary-dark: #1d4ed8;
  --sd-primary-light: #dbeafe;
  --sd-secondary: #f59e0b;
  --sd-accent: #8b5cf6;
  --sd-success: #10b981;
  --sd-danger: #ef4444;
  --sd-dark: #0f172a;
  --sd-surface: #ffffff;
  --sd-bg: #f8fafc;
  --sd-border: #e2e8f0;
  --sd-text: #1e293b;
  --sd-text-muted: #64748b;
  --sd-radius: 16px;
  --sd-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --sd-shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 10px 10px -5px rgba(15, 23, 42, 0.06);
}

body.skoldetektiven-page {
  background-color: #f1f5f9;
  color: var(--sd-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* Header & Detective Status Bar */
.detective-navbar {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 14px 20px;
  border-bottom: 3px solid var(--sd-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.detective-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
}

.detective-brand:hover {
  color: #fbbf24;
  text-decoration: none;
}

.detective-badge-pill {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.rank-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

/* Case Intro Hero Box */
.case-hero-card {
  background: #ffffff;
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
  border: 2px solid #e2e8f0;
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.case-hero-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  padding: 24px;
  position: relative;
}

.case-hero-header::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.stamp-badge {
  position: absolute;
  top: 20px;
  right: 24px;
  border: 3px dashed #fbbf24;
  color: #fbbf24;
  font-weight: 800;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  transform: rotate(4deg);
}

/* Main Layout Grid */
.game-workspace {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 991px) {
  .game-workspace {
    grid-template-columns: 1fr;
  }
}

/* Map & Room View */
.map-container-card {
  background: #ffffff;
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
  border: 2px solid var(--sd-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.school-map-svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
}

.map-room-zone {
  cursor: pointer;
  transition: all 0.25s ease;
  fill-opacity: 0.85;
}

.map-room-zone:hover {
  fill-opacity: 1;
  stroke: #fbbf24 !important;
  stroke-width: 4 !important;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.map-room-zone.active-room {
  stroke: #2563eb !important;
  stroke-width: 4 !important;
  fill-opacity: 1;
}

.room-hotspot {
  cursor: pointer;
  transition: transform 0.2s;
}

.room-hotspot:hover {
  transform: scale(1.15);
}

/* Room Investigation Scene */
.room-scene-box {
  background: #f8fafc;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
}

.inspectable-item-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.inspectable-item-card:hover {
  border-color: var(--sd-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

/* Detective Notebook (Anteckningsblock) */
.notebook-card {
  background: #ffffff;
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
  border: 2px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notebook-header {
  background: #334155;
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--sd-radius) var(--sd-radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notebook-tabs {
  display: flex;
  background: #e2e8f0;
  padding: 4px;
  gap: 4px;
}

.notebook-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

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

.notebook-content {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
}

/* Suspect Cards & Elimination */
.suspect-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.suspect-card.eliminated {
  opacity: 0.65;
  background: #fef2f2;
  border-color: #fca5a5;
}

.eliminated-overlay-stamp {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  border: 3px solid #dc2626;
  color: #dc2626;
  font-weight: 900;
  font-size: 1.2rem;
  padding: 4px 16px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  pointer-events: none;
  z-index: 5;
}

.suspect-card.eliminated .eliminated-overlay-stamp {
  display: block;
}

.char-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
}

/* Clue Items */
.clue-list-item {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.clue-list-item.locked {
  background: #f8fafc;
  border-style: dashed;
  opacity: 0.7;
}

.clue-icon {
  width: 24px;
  height: 24px;
}

/* Question / Riddle Cards */
.question-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.question-card.solved {
  border-color: #10b981;
  background: #f0fdf4;
}

.question-option-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
}

.question-option-btn:hover:not(:disabled) {
  border-color: var(--sd-primary);
  background: #eff6ff;
}

.question-option-btn.correct {
  border-color: #10b981;
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

.question-option-btn.incorrect {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

/* Solution Modal */
.celebration-confetti {
  font-size: 3rem;
  text-align: center;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

/* Buttons & Controls */
.btn-skolplus {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
  cursor: pointer;
}

.btn-skolplus:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.btn-accuse {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 800;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 1rem;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
