/* Offline Bundled Fonts */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('./assets/fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('./assets/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('./assets/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('./assets/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  src: url('./assets/fonts/noto-sans-myanmar-myanmar-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  src: url('./assets/fonts/noto-sans-myanmar-myanmar-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* Super Duolingo Twilight-Slate Theme Variables */
:root {
  --bg-deep: #253047;
  --bg: #313F5B;
  --surface: #384866;
  --card: #3E4F70;
  --card-dark: #354463;
  --input: #2B3852;
  --border: #556A91;
  --text: #FFFFFF;
  --muted: #D2DEF0;
  --green: #22C55E;
  --green-light: #4ADE80;
  --green-dark: #15803D;
  --blue: #3B82F6;
  --blue-light: #93C5FD;
  --blue-dark: #1E40AF;
  --red: #FDA4AF;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Noto Sans Myanmar', system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, a { font: inherit; color: inherit; text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.green-text { color: var(--green-light); }
.blue-text { color: var(--blue-light); }
.mono { font-variant-numeric: tabular-nums; }

/* iOS 27 Depth Shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform-origin: top center;
  transition: transform 0.42s var(--spring), border-radius 0.42s var(--spring), opacity 0.35s ease;
  animation: pageIn 0.45s var(--spring);
}
.app-shell.modal-open {
  transform: scale(0.945) translateY(10px);
  border-radius: 24px;
  opacity: 0.65;
  overflow: hidden;
}

/* Tactile 3D Duolingo Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s var(--spring), filter 0.15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 1px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-green { background: var(--green); color: #092412; border-bottom: 4px solid var(--green-dark); }
.btn-blue { background: linear-gradient(135deg, #3B82F6, #6366F1); color: #fff; border-bottom: 4px solid var(--blue-dark); }
.btn-grey { background: #4B5E82; color: var(--text); border: 1px solid #6479A1; border-bottom: 4px solid #2F3E5C; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 10px; }

/* Header & Liquid-Glass Sliding Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(56, 72, 102, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-bar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.brand-btn:hover { color: var(--green-light); }
.brand-icon { width: 32px; height: 32px; flex-shrink: 0; }

.nav-desktop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(75, 94, 130, 0.92);
  border: 1px solid rgba(116, 139, 181, 0.65);
  border-bottom: 2px solid var(--green-light);
  border-radius: 12px;
  transition: transform 0.35s var(--spring), width 0.35s var(--spring);
  pointer-events: none;
}
.nav-tab {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-tab.active, .nav-tab:hover { color: #fff; }

.nav-mobile {
  display: none;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  background: var(--input);
  padding: 6px 8px;
  gap: 4px;
}
.m-tab {
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.m-tab.active { background: var(--card); color: #fff; }

/* Main & Cards */
.main-content { flex: 1; padding: 28px 0 40px; }
.tab-view { animation: tabIn 0.38s var(--spring); display: flex; flex-direction: column; gap: 26px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}
.card-hero {
  background: linear-gradient(135deg, #43567A, #3C4D82);
  border: 1px solid #5F76A3;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 7.5fr 4.5fr;
}
.hero-body { padding: 38px 34px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.hero-body h1 { font-size: clamp(26px, 3.2vw, 42px); font-weight: 800; line-height: 1.25; margin: 10px 0 8px; white-space: nowrap; letter-spacing: -0.02em; }
.hero-desc { font-size: 13px; line-height: 1.65; color: var(--muted); max-width: 560px; }
.hero-img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; background: var(--input); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.share-card { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.share-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.share-copy h2 { font-size: 20px; }
.share-copy a { font-size: 13px; font-weight: 700; }
.qr-code-frame { flex: 0 0 auto; padding: 8px; border-radius: 12px; background: #fff; }
.qr-code-frame img { width: 144px; height: 144px; }

/* Status Strip */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 14px 20px;
}

/* 2-Column Path Layout */
.path-grid { display: grid; grid-template-columns: 8fr 4fr; gap: 28px; align-items: start; }
.path-list { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.unit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeUp 0.42s var(--spring) backwards;
}
.unit-card.active { border-color: var(--green-light); }
.unit-card.odd { margin-left: 28px; }
.unit-card.even { margin-right: 28px; }

.unit-node {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  border-bottom: 4px solid #151B28;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  cursor: pointer;
}
.unit-node.done { background: var(--green); color: #092412; border-bottom-color: var(--green-dark); }
.unit-node.active { background: linear-gradient(135deg, #3B82F6, #6366F1); color: #fff; border-bottom-color: var(--blue-dark); }
.unit-node.locked { background: var(--input); color: #9BB0D1; border-bottom-color: #212C42; cursor: not-allowed; }

.unit-thumb { width: 82px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.unit-thumb.locked { filter: grayscale(1); opacity: 0.5; }
.unit-info { flex: 1; min-width: 0; }
.unit-info h3 { font-size: 16px; font-weight: 700; margin: 2px 0; }
.unit-info p { font-size: 13px; color: var(--muted); }

/* Sidebar Stats */
.sidebar { position: sticky; top: 84px; }
.progress-track { height: 12px; border-radius: 99px; background: var(--input); overflow: hidden; margin: 8px 0 16px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-light)); transition: width 0.45s var(--spring); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat-box { background: var(--card-dark); border: 1px solid var(--border); border-radius: 12px; padding: 12px 6px; }
.stat-val { font-size: 18px; font-weight: 800; margin-top: 2px; }
.stat-label { font-size: 11px; color: var(--muted); }
.trophy-box { margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(74, 222, 128, 0.4); font-size: 12px; font-weight: 700; color: #BBF7D0; }
.reset-btn { width: 100%; margin-top: 12px; background: none; border: none; color: var(--muted); font-size: 12px; padding: 8px; cursor: pointer; }
.reset-btn:hover { color: #fff; }

/* Filter Pills */
.pill-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--input); border: 1px solid var(--border); border-radius: 12px; }
.pill-btn { background: none; border: 1px solid transparent; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: 0.2s; }
.pill-btn.active { background: #4B5E82; border-color: #6B82AD; color: #fff; }

/* Video Library */
.video-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 22px; align-items: start; }
.video-box { aspect-ratio: 16 / 9; background: #182133; }
.video-box video { width: 100%; height: 100%; object-fit: contain; display: block; }
.tips-box { background: var(--card-dark); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.playlist { display: flex; flex-direction: column; gap: 10px; }
.playlist-item {
  width: 100%;
  text-align: left;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s, border-color 0.2s;
}
.playlist-item:hover { background: #46587B; transform: translateX(3px); }
.playlist-item.active { background: #4C6086; border-color: var(--blue-light); }
.play-badge { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--input); font-size: 13px; font-weight: 800; flex-shrink: 0; }
.playlist-item.active .play-badge { background: var(--blue); color: #fff; }
.playlist-item.done .play-badge { background: rgba(34, 197, 94, 0.2); color: var(--green-light); }

/* Label Inspection Lab */
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.lab-img { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; border: 1px solid var(--border); background: #fff; object-fit: cover; }
.lab-img.contain { object-fit: contain; padding: 12px; }
.check-btn {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-dark);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.check-btn:hover { border-color: var(--blue-light); }
.check-btn.ok { background: rgba(34, 197, 94, 0.12); border-color: rgba(74, 222, 128, 0.5); }
.check-btn.hazard { background: rgba(251, 113, 133, 0.15); border-color: rgba(251, 113, 133, 0.55); }
.check-reading { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.14); font-size: 12px; color: #E5ECF6; }
.verdict-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feedback-box { padding: 14px; border-radius: 12px; border: 1px solid var(--border); font-size: 14px; }
.feedback-box.ok { background: rgba(34, 197, 94, 0.15); border-color: rgba(74, 222, 128, 0.5); }
.feedback-box.bad { background: rgba(251, 113, 133, 0.15); border-color: rgba(251, 113, 133, 0.5); }

/* Summary */
.rights-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.summary-split { display: grid; grid-template-columns: 7fr 5fr; gap: 22px; }
.habit-btn {
  width: 100%;
  text-align: left;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-dark);
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.habit-btn.checked { background: rgba(34, 197, 94, 0.14); border-color: rgba(74, 222, 128, 0.45); color: var(--text); }
.step-item { padding: 13px; border-radius: 12px; background: var(--card-dark); border: 1px solid var(--border); font-size: 14px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 32px;
  padding: 26px 16px;
  text-align: center;
  font-size: 12px;
}
.footer-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; }
.logo-circle { width: 76px; height: 76px; border-radius: 50%; object-fit: contain; background: #fff; padding: 3px; box-shadow: 0 3px 10px rgba(0,0,0,0.2); }
.logo-card { background: #fff; padding: 9px 15px; border-radius: 12px; border: 1px solid #6479A1; box-shadow: 0 3px 10px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; }
.logo-mcf { height: 52px; width: auto; max-width: 100%; object-fit: contain; }
.logo-nda { height: 76px; width: auto; object-fit: contain; }
.credit { font-weight: 700; color: var(--text); margin-top: 4px; }

/* Full-Screen Lesson Modal (iOS 27 Spring Sheet) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: sheetUp 0.36s var(--spring);
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.modal-header-inner { max-width: 860px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 16px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; }
.modal-close:hover { background: #4B5E82; color: #fff; }
.modal-body { max-width: 860px; width: 100%; margin: 0 auto; padding: 28px 16px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }

.intro-grid { display: grid; grid-template-columns: 5fr 7fr; overflow: hidden; padding: 0; }
.intro-img { width: 100%; height: 100%; min-height: 210px; object-fit: cover; }

.quiz-card { animation: tabIn 0.3s var(--spring); }
.quiz-card.shake { animation: shake 0.36s ease; }
.quiz-img { width: 100%; max-height: 250px; object-fit: contain; border-radius: 12px; background: #fff; padding: 8px; border: 1px solid var(--border); margin-top: 12px; }
.options-list { display: grid; gap: 12px; margin-top: 16px; }
.opt-btn {
  width: 100%;
  text-align: left;
  padding: 15px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s;
}
.opt-btn:hover:not(:disabled) { background: #46587B; }
.opt-btn.picked { background: rgba(59, 130, 246, 0.28); border-color: var(--blue-light); }
.opt-btn.right { background: rgba(34, 197, 94, 0.22); border-color: var(--green-light); color: #DCFCE7; }
.opt-btn.wrong { background: rgba(251, 113, 133, 0.22); border-color: var(--red); color: #FFE4E6; }
.opt-num { width: 28px; height: 28px; border-radius: 8px; background: var(--input); color: var(--muted); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.opt-btn.picked .opt-num { background: var(--blue); color: #fff; }

.quiz-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.offline-badge { position: fixed; bottom: 16px; left: 16px; z-index: 40; background: #2B3852; border: 1px solid rgba(74, 222, 128, 0.55); padding: 8px 14px; border-radius: 12px; font-size: 12px; font-weight: 700; color: var(--green-light); }

/* Keyframe Animations */
@keyframes pageIn { from { opacity: 0; transform: scale(0.97) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tabIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(36px) scale(0.94); border-radius: 28px; } to { opacity: 1; transform: none; border-radius: 0; } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }

/* Responsive */
@media (max-width: 960px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: flex; }
  .card-hero, .path-grid, .video-grid, .lab-grid, .summary-split, .intro-grid { grid-template-columns: 1fr; }
  .rights-grid { grid-template-columns: repeat(2, 1fr); }
  .unit-card.odd, .unit-card.even { margin: 0; }
}
@media (max-width: 560px) {
  .brand-btn span { font-size: 14px; }
  .hero-body h1 { font-size: 21px; white-space: normal; }
  .rights-grid { grid-template-columns: 1fr; }
  .unit-card { flex-direction: column; text-align: center; }
  .share-card { align-items: flex-start; flex-direction: column; }
}
