/*
  SICAKEP KIDS - STUDENT THEME
  Overrides and specific styles for the child-centered interface
*/

/* =========================================
   MODE OVERRIDES (Junior vs Explorer)
   ========================================= */

/* Junior Mode (Kelas 1-3) */
[data-mode='junior'] {
  --text-base-size: 18px;
  --btn-min-height: 60px;
  --card-padding: 24px;
  --icon-size: 32px;
  
  --text-base: var(--text-base-size);
  font-size: var(--text-base-size);
}

[data-mode='junior'] .card {
  padding: var(--card-padding);
  border-radius: var(--radius-2xl);
  border-width: 3px;
}

[data-mode='junior'] .btn {
  min-height: var(--btn-min-height);
  border-radius: var(--radius-2xl);
}

/* Explorer Mode (Kelas 4-6) */
[data-mode='explorer'] {
  --text-base-size: 16px;
  --btn-min-height: 52px;
  --card-padding: 20px;
  --icon-size: 24px;
  
  --text-base: var(--text-base-size);
}

[data-mode='explorer'] .card {
  padding: var(--card-padding);
}

[data-mode='explorer'] .btn {
  min-height: var(--btn-min-height);
}

/* =========================================
   HABIT SPECIFIC COLORS
   ========================================= */
.habit-color-bangun {
  --habit-bg: #fffbeb;
  --habit-border: #fde68a;
  --habit-icon-bg: #fef3c7;
  --habit-icon-color: #d97706;
}
.habit-color-ibadah {
  --habit-bg: #fff1f2;
  --habit-border: #fecdd3;
  --habit-icon-bg: #ffe4e6;
  --habit-icon-color: #e11d48;
}
.habit-color-belajar {
  --habit-bg: #eff6ff;
  --habit-border: #bfdbfe;
  --habit-icon-bg: #dbeafe;
  --habit-icon-color: #2563eb;
}
.habit-color-makan {
  --habit-bg: #f0fdf4;
  --habit-border: #bbf7d0;
  --habit-icon-bg: #dcfce7;
  --habit-icon-color: #16a34a;
}
.habit-color-olahraga {
  --habit-bg: #faf5ff;
  --habit-border: #e9d5ff;
  --habit-icon-bg: #f3e8ff;
  --habit-icon-color: #9333ea;
}
.habit-color-masyarakat {
  --habit-bg: #f0fdfa;
  --habit-border: #99f6e4;
  --habit-icon-bg: #ccfbf1;
  --habit-icon-color: #0d9488;
}
.habit-color-tidur {
  --habit-bg: #eef2ff;
  --habit-border: #c7d2fe;
  --habit-icon-bg: #e0e7ff;
  --habit-icon-color: #4f46e5;
}

.card-habit-themed {
  background-color: var(--habit-bg);
  border-color: var(--habit-border);
}
.card-habit-themed .icon-container {
  background-color: var(--habit-icon-bg);
  color: var(--habit-icon-color);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================
   CELEBRATION / SUCCESS STYLES
   ========================================= */
@keyframes starBurst {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.success-screen {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.success-icon-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-6);
  animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.success-icon-wrap .star {
  position: absolute;
  color: var(--color-sunshine-400);
  animation: starBurst 1s ease-out forwards;
}
.success-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-primary-600);
  margin-bottom: var(--space-2);
}

/* Confetti wrapper for canvas or DOM elements */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
}

/* =========================================
   ONBOARDING & GUIDED JOURNEY
   ========================================= */
.journey-slide {
  position: absolute;
  inset: 0;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}
.journey-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}
.journey-slide.slide-left {
  transform: translateX(-100%);
}
.journey-slide.slide-right {
  transform: translateX(100%);
}

.journey-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
}
.journey-image img {
  max-width: 80%;
  max-height: 300px;
  object-fit: contain;
}

.journey-controls {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* =========================================
   MASCOT CONTAINER
   ========================================= */
.mascot-container {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
.mascot-avatar {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.mascot-speech {
  background: var(--surface-card);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  border-bottom-left-radius: 4px; /* Speech bubble tail effect */
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-secondary-200);
  position: relative;
}
.mascot-speech::before {
  content: '';
  position: absolute;
  left: -10px;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 15px 15px;
  border-color: transparent transparent var(--color-secondary-200) transparent;
}
.mascot-speech::after {
  content: '';
  position: absolute;
  left: -6px;
  bottom: 2px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 12px 12px;
  border-color: transparent transparent var(--surface-card) transparent;
}
