/* ============================================================
 * R&K Kelas Inggris — Main Stylesheet
 * Mobile-first, accessible, fun
 * ============================================================ */

/* ===== Container ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Top Header ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-weight: 800;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  overflow: hidden;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-name { font-size: 1.05rem; line-height: 1.1; }
.brand-sub { font-size: 0.72rem; opacity: 0.9; font-weight: 600; }

.nav-toggle {
  background: rgba(255,255,255,0.18);
  border: none;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.4rem;
  display: none;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
nav.main-nav a {
  color: white;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.2s;
}
nav.main-nav a:hover,
nav.main-nav a.active {
  background: rgba(255,255,255,0.22);
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  nav.main-nav {
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: var(--primary-dark);
    padding: 12px;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    min-width: 200px;
    display: none;
  }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { width: 100%; padding: 12px 14px; }
}

/* ===== Hero ===== */
.hero {
  padding: 56px 16px 40px;
  text-align: center;
  background: linear-gradient(180deg, #dbeafe 0%, #f4f9ff 100%);
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 900;
  line-height: 1.15;
}
.hero p.tagline {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 22px;
  font-weight: 600;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}
.hero-stat {
  background: white;
  padding: 12px 20px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  min-width: 130px;
}
.hero-stat .num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  display: block;
}
.hero-stat .lbl {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 700;
}

/* ===== CTA Buttons ===== */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 8px 22px rgba(249, 112, 86, 0.35);
}
.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary-light);
}
.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ===== Sections ===== */
section {
  padding: 50px 0;
}
section h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  text-align: center;
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 900;
}
section .sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 660px;
  margin: 0 auto 36px;
  font-weight: 600;
}

/* ===== Cards Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  color: var(--text);
  display: block;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.card-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: inline-block;
}
.card h3 {
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 800;
}
.card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0 0 12px;
  line-height: 1.55;
}
.card .badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-hover);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
  margin-right: 6px;
}

/* ===== Level Tabs ===== */
.level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.level-tab {
  padding: 10px 18px;
  background: white;
  border: 2px solid var(--border-soft);
  border-radius: 99px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-family: inherit;
}
.level-tab:hover { border-color: var(--primary); }
.level-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== Quiz Card ===== */
.quiz-box {
  background: white;
  padding: 28px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
}
.quiz-question {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
  line-height: 1.4;
}
.quiz-option {
  display: block;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--bg-soft);
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  transition: all 0.2s;
  font-family: inherit;
}
.quiz-option:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.quiz-option.correct {
  background: #d1fae5;
  border-color: var(--success);
  color: #064e3b;
}
.quiz-option.wrong {
  background: #fee2e2;
  border-color: var(--error);
  color: #7f1d1d;
}

/* ===== Vocab Card ===== */
.vocab-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  border-left: 4px solid var(--secondary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.vocab-eng {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  flex: 1;
}
.vocab-eng .phon {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-top: 2px;
}
.vocab-id {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.95rem;
}
.speak-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.speak-btn:hover { transform: scale(1.1); background: var(--primary); color: white; }

/* ===== Grammar Box ===== */
.grammar-box {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  border-top: 5px solid var(--primary);
}
.grammar-box h3 {
  color: var(--primary);
  margin: 0 0 10px;
  font-size: 1.25rem;
}
.formula {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  margin: 14px 0;
  font-size: 0.98rem;
  text-align: center;
}
.example {
  background: var(--bg-soft);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  border-left: 3px solid var(--secondary);
}
.example .en { font-weight: 700; color: var(--primary); }
.example .id { color: var(--text-secondary); font-size: 0.85rem; display: block; margin-top: 4px; }

/* ===== FAQ ===== */
.faq-item {
  background: white;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-q {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  user-select: none;
}
.faq-q::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--secondary);
  transition: transform 0.2s;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.faq-item.open .faq-a {
  padding: 0 20px 16px;
  max-height: 500px;
}

/* ===== Footer ===== */
footer {
  background: var(--primary-dark);
  color: #cbd5e1;
  padding: 40px 16px 24px;
  margin-top: 60px;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
}
.footer-grid h4 {
  color: white;
  margin: 0 0 14px;
  font-size: 1rem;
}
.footer-grid a {
  color: #cbd5e1;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  font-size: 0.9rem;
}
.footer-grid a:hover { color: var(--accent); }
.copyright {
  text-align: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ===== Progress Bar ===== */
.progress {
  height: 10px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 99px;
  transition: width 0.5s;
}

/* ===== Toast/Notification ===== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: white;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* ===== Karaoke Sync — highlight kata yang sedang diucapkan ===== */
.kw {
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  padding: 0 2px;
  border-radius: 4px;
  display: inline-block;
}
.kw.kw-active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1e3a8a;
  font-weight: 900;
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.45);
  text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}
@media (prefers-reduced-motion: reduce) {
  .kw.kw-active { transform: none; }
}

/* ===== Hidden helpers ===== */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ===== Page Header (inner pages) ===== */
.page-head {
  text-align: center;
  padding: 40px 16px 24px;
}
.page-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 900;
}
.page-head p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}

/* ===== Print friendly ===== */
@media print {
  .topbar, footer, .nav-toggle, .speak-btn { display: none !important; }
  body { background: white; color: black; }
}
