/* ========================================================
   MODERN DESIGN SYSTEM & THEME
   BAB 3: もちもの (MOCHIMONO) - SMK NEGERI 1 MUNDU CIREBON
   ======================================================== */

:root {
  /* Color Palette - Japanese Modern & Maritime Navy (SMKN 1 Mundu) */
  --primary: #1e5f74;        /* Deep Maritime Teal / Navy */
  --primary-dark: #133b5c;   /* Dark Indigo */
  --primary-light: #2b7a94;  /* Bright Teal */
  --primary-soft: #eaf4f7;   /* Pale Ocean Tint */

  --accent-pink: #ff6b81;    /* Sakura Blossom */
  --accent-pink-soft: #fff0f3;
  --accent-gold: #f59e0b;    /* Golden Sun */
  --accent-gold-soft: #fef3c7;
  --accent-green: #10b981;   /* Emerald Green */
  --accent-green-soft: #d1fae5;
  --accent-red: #ef4444;     /* Red Coral */
  --accent-red-soft: #fee2e2;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  --border-light: #e2e8f0;
  --border-focus: #38bdf8;
  
  --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 -4px rgba(15, 23, 42, 0.12);
  --shadow-hover: 0 16px 36px -6px rgba(30, 95, 116, 0.18);

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

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-jp: 'Noto Sans JP', 'M PLUS Rounded 1c', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Japanese Typography Utilities */
.jp-txt, .jp-bubble, .jp-target, .jp-item-name, .brand-title, .formula-syntax {
  font-family: var(--font-jp);
}

/* ========================================================
   TOP HEADER & NAVIGATION
   ======================================================== */
.app-header {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(30, 95, 116, 0.25);
}

.brand-title-wrap .brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.2;
}

.brand-title .brand-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-main);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.student-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-pink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border: 2px solid var(--accent-pink);
}

.student-meta {
  display: flex;
  flex-direction: column;
}

.student-name-display {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.student-level {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-change-user {
  background: transparent;
  border: none;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-change-user:hover {
  background: var(--primary-soft);
}

/* Nav Tabs */
.main-nav {
  background: #f1f5f9;
  border-top: 1px solid var(--border-light);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 16px;
  gap: 4px;
}

.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab:hover {
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.7);
}

.nav-tab.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 95, 116, 0.3);
}

/* Global Progress Bar */
.global-progress-bar-wrap {
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 6px 20px;
}

.progress-bar-track {
  max-width: 1200px;
  margin: 0 auto;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pink) 0%, var(--primary) 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-info-text {
  max-width: 1200px;
  margin: 4px auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================================================
   MAIN CONTENT & PAGE SECTIONS
   ======================================================== */
.main-content {
  flex: 1;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-section {
  display: none;
  animation: fadeIn 0.35s ease;
}

.page-section.active {
  display: block;
}

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

/* Common Page Banner */
.page-header-banner {
  background: linear-gradient(135deg, #1e5f74 0%, #133b5c 100%);
  color: white;
  padding: 26px 30px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.page-header-banner::after {
  content: "もちもの";
  position: absolute;
  right: 20px;
  bottom: -15px;
  font-size: 5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.06);
  font-family: var(--font-jp);
  pointer-events: none;
}

.banner-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.page-banner-title {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.page-banner-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 780px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(30, 95, 116, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(30, 95, 116, 0.35);
}

.btn-secondary {
  background: white;
  color: var(--primary-dark);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-soft);
}

.btn-audio-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-pink-soft);
  color: #c0264b;
  border: 1px solid rgba(255, 107, 129, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 6px;
}

.btn-audio-mini:hover {
  background: #ffe0e6;
  transform: scale(1.03);
}

.page-footer-nav {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* ========================================================
   PAGE 1: BERANDA STYLES
   ======================================================== */
.hero-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.hero-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.sakura-badge {
  background: var(--accent-pink-soft);
  color: #be123c;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.kurikulum-badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.25;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.japanese-character-circle {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(30, 95, 116, 0.15);
  border: 4px solid white;
}

.floating-item {
  position: absolute;
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  animation: floatAnim 4s ease-in-out infinite alternate;
}

.item-1 { top: -10px; left: 30px; animation-delay: 0s; }
.item-2 { top: 30px; right: -12px; animation-delay: 1s; }
.item-3 { bottom: 10px; right: 20px; animation-delay: 2s; }
.item-4 { bottom: 20px; left: -10px; animation-delay: 3s; }

@keyframes floatAnim {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(5deg); }
}

.circle-illustration {
  text-align: center;
}

.speech-bubble {
  background: white;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
}

.jp-bubble {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.id-bubble {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.illustration-art {
  font-size: 3.5rem;
}

/* Feature Grid */
.section-title-wrap {
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.feature-step-num {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #e2e8f0;
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.feature-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.feature-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.card-link-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

/* Characters Card */
.characters-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px 30px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.characters-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.characters-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.characters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.char-item {
  background: var(--bg-page);
  padding: 14px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-light);
}

.char-face {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.char-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary-dark);
}

.char-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================================
   PAGE 2: TUJUAN PEMBELAJARAN STYLES
   ======================================================== */
.can-do-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.can-do-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 26px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.can-do-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.can-do-pill {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.can-do-level {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.can-do-body {
  display: flex;
  gap: 20px;
}

.can-do-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-pink-soft) 0%, var(--primary-soft) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.can-do-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.can-do-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.target-phrase-box {
  background: #f8fafc;
  border-left: 4px solid var(--accent-pink);
  padding: 12px 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 14px;
}

.jp-target {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.rm-target {
  display: block;
  font-size: 0.85rem;
  color: var(--accent-pink);
  font-weight: 600;
}

.id-target {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.can-do-checkpoints {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-main);
}

.can-do-checkpoints li {
  color: #334155;
}

/* Vocational Relevance Card */
.vocational-relevance-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.vocation-badge {
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e40af;
  margin-bottom: 14px;
}

.vocation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.vocation-col h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.vocation-col p {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.6;
}

/* ========================================================
   PAGE 3: MATERI STYLES
   ======================================================== */
.submateri-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.sub-tab {
  padding: 10px 18px;
  border: 1px solid var(--border-light);
  background: white;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.sub-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30, 95, 116, 0.2);
}

.submateri-content {
  display: none;
}

.submateri-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Vocab Toolbar */
.vocab-toolbar {
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-title h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.vocab-count-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-toggle-flashcard {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-pink);
  background: var(--accent-pink-soft);
  color: #c0264b;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-flashcard.active {
  background: #e11d48;
  color: white;
}

.vocab-instruction-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Vocab Cards Grid */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

/* 3D Flip Card Container */
.vocab-card {
  perspective: 1000px;
  height: 230px;
  cursor: pointer;
}

.vocab-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.vocab-card.flipped .vocab-card-inner {
  transform: rotateY(180deg);
}

.vocab-card-front, .vocab-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-light);
  background: white;
}

.vocab-card-front:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-hover);
}

.vocab-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-color: #93c5fd;
}

.vocab-card-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  align-self: flex-start;
}

.vocab-card-illustration {
  font-size: 3rem;
  margin: 4px 0;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.06));
}

.jp-item-name {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.rm-item-name {
  font-size: 0.82rem;
  color: var(--accent-pink);
  font-weight: 600;
}

.id-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 4px;
}

.card-flip-cue {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 6px;
}

.card-audio-btn {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(30, 95, 116, 0.2);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-audio-btn:hover {
  background: var(--primary);
  color: white;
}

/* Callout Box */
.callout {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  margin-top: 20px;
}

.callout-tip {
  background: #fefce8;
  border-left: 4px solid #eab308;
  color: #713f12;
}

.callout-icon {
  font-size: 1.4rem;
}

.callout-body strong {
  display: block;
  margin-bottom: 4px;
}

.callout-body p {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Grammar Card & Formulas */
.grammar-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 30px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.grammar-header {
  margin-bottom: 20px;
}

.grammar-tag {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.grammar-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 8px;
}

.grammar-formula-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.formula-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 10px;
}

.formula-syntax {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.token {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.token-kore { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.token-person { background: rgba(244, 114, 182, 0.2); color: #f472b6; }
.token-particle { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.token-item { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.token-verb { background: rgba(167, 139, 250, 0.2); color: #a78bfa; }
.token-desuka { background: rgba(248, 113, 113, 0.2); color: #f87171; }

.formula-romaji {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.formula-meaning {
  font-size: 0.95rem;
  font-weight: 600;
  color: #facc15;
}

.grammar-explanation h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.grammar-explanation ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: #334155;
  margin-bottom: 24px;
}

/* Responses Grid */
.response-patterns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.pattern-box {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #f8fafc;
}

.pattern-yes { border-left: 4px solid var(--accent-green); }
.pattern-no { border-left: 4px solid var(--accent-red); }
.pattern-redirect { border-left: 4px solid var(--accent-gold); }
.pattern-wait { border-left: 4px solid #38bdf8; }
.pattern-refuse { border-left: 4px solid #e11d48; }
.pattern-acknowledgment { border-left: 4px solid #6366f1; }

.pattern-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.pattern-content .jp-txt {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.pattern-content .rm-txt {
  font-size: 0.8rem;
  color: var(--accent-pink);
  font-weight: 600;
}

.pattern-content .id-txt {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.vocab-subnote {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* ========================================================
   PAGE 4: LATIHAN PENGUCAPAN & PERCAKAPAN
   ======================================================== */
.practice-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.practice-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.practice-card-header {
  margin-bottom: 20px;
}

.badge-pill {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.practice-card-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.practice-card-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.audio-speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  background: var(--bg-page);
  padding: 8px 14px;
  border-radius: var(--radius-md);
}

.btn-speed {
  background: white;
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-speed.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Pronunciation Drills */
.pronunciation-drills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.drill-item {
  background: var(--bg-page);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.drill-item:hover {
  background: white;
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.drill-text-group .drill-jp {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.drill-text-group .drill-rm {
  font-size: 0.78rem;
  color: var(--accent-pink);
  font-weight: 600;
}

.drill-text-group .drill-id {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drill-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-drill-audio {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(30, 95, 116, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.btn-drill-audio:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.08);
}

/* Roleplay Simulator */
.roleplay-scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.scenario-tab {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

.roleplay-chat-box {
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.chat-bubble-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: messageIn 0.3s ease;
}

.chat-bubble-wrap.char-user {
  flex-direction: row-reverse;
}

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

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.chat-bubble {
  max-width: 75%;
  background: white;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.chat-bubble-wrap.char-user .chat-bubble {
  background: var(--primary);
  color: white;
  border: none;
}

.chat-sender-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.chat-bubble-wrap.char-user .chat-sender-name {
  color: #bae6fd;
}

.chat-bubble .bubble-jp {
  font-size: 1.05rem;
  font-weight: 700;
  display: block;
}

.chat-bubble .bubble-rm {
  font-size: 0.8rem;
  color: var(--accent-pink);
  display: block;
}

.chat-bubble-wrap.char-user .chat-bubble .bubble-rm {
  color: #fde047;
}

.chat-bubble .bubble-id {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.chat-bubble-wrap.char-user .chat-bubble .bubble-id {
  color: #e2e8f0;
}

.btn-bubble-listen {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 6px;
  color: var(--primary);
}

.chat-bubble-wrap.char-user .btn-bubble-listen {
  color: white;
}

.roleplay-interactive-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-choice-reply {
  background: white;
  border: 1.5px solid var(--primary-light);
  color: var(--primary-dark);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.btn-choice-reply:hover {
  background: var(--primary-soft);
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* ========================================================
   PAGE 5: KUIS EVALUASI STYLES
   ======================================================== */
.quiz-container {
  max-width: 860px;
  margin: 0 auto;
}

.quiz-topbar {
  background: white;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.quiz-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.quiz-live-score {
  color: var(--accent-gold);
  font-weight: 700;
}

.quiz-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pink) 0%, var(--primary) 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.quiz-question-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 30px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.question-category-badge {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.btn-quiz-audio {
  background: var(--accent-pink-soft);
  color: #be123c;
  border: 1px solid rgba(255, 107, 129, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quiz-audio:hover {
  background: #fecdd3;
}

.question-title {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 8px;
  line-height: 1.4;
}

.question-context {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* Options */
.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-opt-btn {
  background: #f8fafc;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.quiz-opt-btn:hover:not(:disabled) {
  background: white;
  border-color: var(--primary-light);
  transform: translateX(4px);
}

.opt-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.opt-text-wrap {
  flex: 1;
}

.opt-jp {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: block;
}

.opt-id {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
}

/* Option States */
.quiz-opt-btn.correct {
  background: var(--accent-green-soft) !important;
  border-color: var(--accent-green) !important;
}

.quiz-opt-btn.correct .opt-letter {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

.quiz-opt-btn.wrong {
  background: var(--accent-red-soft) !important;
  border-color: var(--accent-red) !important;
}

.quiz-opt-btn.wrong .opt-letter {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

/* Feedback Box */
.quiz-feedback-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  border-left: 4px solid var(--primary);
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

.feedback-icon {
  font-size: 1.8rem;
}

.feedback-text-wrap h4 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.feedback-text-wrap p {
  font-size: 0.88rem;
  color: #334155;
}

.quiz-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ========================================================
   PAGE 6: HASIL & SERTIFIKAT STYLES
   ======================================================== */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.score-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 30px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: center;
}

.score-metric-circle {
  width: 160px;
  height: 160px;
  position: relative;
  margin: 0 auto;
}

.circle-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
}

.circle-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.circle-inner-data {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}

.score-max {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.grade-badge {
  display: inline-block;
  background: var(--accent-gold-soft);
  color: #b45309;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.student-result-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.result-feedback-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.score-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.mini-stat {
  background: var(--bg-page);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Competency Breakdown */
.competency-breakdown-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.card-subtitle {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 18px;
}

.competency-item {
  margin-bottom: 16px;
}

.comp-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.comp-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.comp-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

/* OFFICIAL DIGITAL CERTIFICATE */
.certificate-wrap {
  background: #fdfbf7;
  padding: 20px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid #e7dfd5;
}

.certificate-border {
  border: 4px double #1e5f74;
  border-radius: var(--radius-lg);
  padding: 12px;
  background: white;
}

.cert-inner-frame {
  border: 1px solid #d4c5b3;
  padding: 30px;
  text-align: center;
  background: radial-gradient(circle at center, #ffffff 0%, #faf8f5 100%);
  position: relative;
}

.cert-emblem {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.12em;
}

.cert-sub-emblem {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.cert-main-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #92400e;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.cert-course-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.cert-statement {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cert-student-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 6px;
  margin-bottom: 8px;
}

.cert-class-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 16px;
}

.cert-achievement-text {
  font-size: 0.9rem;
  color: #334155;
  max-width: 600px;
  margin: 0 auto 16px;
  line-height: 1.5;
}

.cert-score-display {
  display: inline-block;
  background: linear-gradient(135deg, #1e5f74 0%, #133b5c 100%);
  color: white;
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(30, 95, 116, 0.3);
  margin-bottom: 24px;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.cert-sign-col {
  text-align: left;
}

.cert-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.digital-stamp {
  display: inline-block;
  padding: 2px 8px;
  border: 1px dashed #10b981;
  color: #059669;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 4px;
  margin-bottom: 4px;
}

.sensei-name {
  display: block;
  font-size: 0.88rem;
  color: var(--primary-dark);
}

.school-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cert-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-light);
}

.qr-box {
  width: 50px;
  height: 50px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.cert-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ========================================================
   PAGE 7: REFLEKSI (ふりかえり) STYLES
   ======================================================== */
.reflection-container {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.reflection-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.ref-card-header {
  margin-bottom: 18px;
}

.ref-badge {
  display: inline-block;
  background: var(--accent-green-soft);
  color: #047857;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.ref-card-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.ref-card-header p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-page);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.summary-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.summary-content strong {
  font-size: 0.95rem;
  color: var(--primary-dark);
  display: block;
  margin-bottom: 4px;
}

.summary-content p {
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.5;
}

.summary-content code {
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  color: #be123c;
  font-weight: 600;
}

/* Self-Eval List */
.self-eval-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.self-eval-row {
  background: var(--bg-page);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.eval-statement {
  display: flex;
  gap: 10px;
  max-width: 550px;
}

.eval-num {
  font-weight: 700;
  color: var(--primary);
}

.eval-desc {
  font-size: 0.9rem;
  color: #1e293b;
  font-weight: 500;
}

.star-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.star-btn {
  font-size: 1.8rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  transition: all 0.2s ease;
  line-height: 1;
}

.star-btn:hover {
  transform: scale(1.2);
}

.star-btn.active {
  color: #f59e0b;
}

.rating-feedback-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 8px;
  min-width: 100px;
}

/* Reflection Form */
.reflection-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.form-textarea {
  width: 100%;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.2s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 95, 116, 0.15);
}

.reflection-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.save-status-msg {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-green);
  min-height: 20px;
}

/* ========================================================
   MODAL & POPUPS
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.25s ease;
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title-wrap h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px 24px;
}

.modal-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  font-size: 0.9rem;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 95, 116, 0.15);
}

.avatar-picker {
  display: flex;
  gap: 10px;
}

.avatar-choice {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--bg-page);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-choice.active {
  border-color: var(--accent-pink);
  background: var(--accent-pink-soft);
  transform: scale(1.1);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-page);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
}

/* App Footer */
.app-footer {
  background: white;
  border-top: 1px solid var(--border-light);
  padding: 24px 20px;
  margin-top: auto;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ========================================================
   PRINT STYLES FOR OFFICIAL CERTIFICATE
   ======================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  .certificate-wrap, .certificate-wrap * {
    visibility: visible;
  }
  .certificate-wrap {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
  }
  .cert-action-bar, .app-header, .global-progress-bar-wrap, .app-footer, .page-footer-nav {
    display: none !important;
  }
}

/* ========================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ======================================================== */
@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 28px 24px;
  }
  .hero-tag, .hero-action-row {
    justify-content: center;
  }
  .hero-visual {
    margin-top: 16px;
  }
  .score-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .score-mini-stats {
    justify-content: center;
  }
  .cert-footer {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
  }
  .cert-sign-col {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .user-profile-header {
    width: 100%;
    justify-content: space-between;
  }
  .btn-change-user .btn-text {
    display: none;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .page-banner-title {
    font-size: 1.3rem;
  }
  .formula-syntax {
    font-size: 1.1rem;
  }
  .can-do-body {
    flex-direction: column;
  }
  .can-do-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .page-footer-nav {
    flex-direction: column;
    width: 100%;
  }
  .page-footer-nav .btn {
    width: 100%;
  }
}
