/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark: #0a0e1a;
  --bg-card: #111827;
  --bg-card2: #1a2236;
  --accent: #7c5cbf;
  --accent2: #9d7de8;
  --gold: #f0b429;
  --gold2: #fcd34d;
  --zalo: #0068FF;
  --green: #10b981;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1e2d45;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app { min-height: 100vh; }

#page-root { position: relative; z-index: 1; }

.hidden { display: none !important; }

/* ===== STARS BACKGROUND ===== */
.stars-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 20% 50%, #1a0a3e22 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, #0a1a3e22 0%, transparent 60%),
              var(--bg-dark);
}
.stars-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, #fff6 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 45%, #fff4 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 20%, #fff5 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 60%, #fff3 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 35%, #fff4 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 75%, #fff3 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 85%, #fff4 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, #fff3 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 90%, #fff3 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 50%, #fff4 0%, transparent 100%);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--text);
  text-decoration: none;
}
.navbar-brand .moon { font-size: 22px; }
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.btn-nav {
  padding: 8px 20px; border-radius: 50px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s;
}
.btn-nav-outline {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn-nav-outline:hover { border-color: var(--accent2); color: var(--accent2); }
.btn-nav-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.btn-nav-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px #7c5cbf55; }

/* ===== LANDING ===== */
.landing { position: relative; min-height: 100vh; }

.hero {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 120px 24px 80px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 50px;
  background: #7c5cbf22; border: 1px solid #7c5cbf55;
  font-size: 13px; color: var(--accent2); font-weight: 500;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800; line-height: 1.15;
  background: linear-gradient(135deg, #fff 0%, var(--accent2) 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 20px; max-width: 800px;
}
.hero-sub {
  font-size: clamp(16px, 2vw, 20px); color: var(--text-muted);
  max-width: 580px; line-height: 1.7; margin-bottom: 40px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.btn-primary {
  padding: 16px 36px; border-radius: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 16px; font-weight: 700;
  border: none; cursor: pointer; transition: all 0.25s;
  box-shadow: 0 4px 24px #7c5cbf44;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px #7c5cbf66; }

.btn-zalo {
  padding: 16px 36px; border-radius: 50px;
  background: var(--zalo);
  color: #fff; font-size: 16px; font-weight: 700;
  border: none; cursor: pointer; transition: all 0.25s;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 24px #0068ff44;
}
.btn-zalo:hover { transform: translateY(-2px); box-shadow: 0 8px 32px #0068ff66; }
.btn-zalo img { width: 24px; height: 24px; border-radius: 4px; }

.hero-stats {
  display: flex; gap: 40px; margin-top: 64px;
  flex-wrap: wrap; justify-content: center;
}
.stat { text-align: center; }
.stat-num {
  font-size: 36px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== FEATURES SECTION ===== */
.section { position: relative; z-index: 1; padding: 80px 24px; }
.section-title {
  text-align: center; font-size: clamp(24px, 4vw, 40px); font-weight: 800;
  margin-bottom: 12px;
}
.section-sub { text-align: center; color: var(--text-muted); font-size: 16px; margin-bottom: 48px; }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 1100px; margin: 0 auto;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: all 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 8px 32px #7c5cbf22;
}
.feature-icon { font-size: 36px; margin-bottom: 16px; }
.feature-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feature-desc { color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* ===== WEEKS OVERVIEW ===== */
.weeks-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; max-width: 1000px; margin: 0 auto;
}
.week-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden;
}
.week-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.week-card.w1::before { background: linear-gradient(90deg, #10b981, #34d399); }
.week-card.w2::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.week-card.w3::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.week-card.w4::before { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.week-num { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.week-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.week-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.week-days { margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.week-days span { color: var(--accent2); font-weight: 600; }

/* ===== CTA SECTION ===== */
.cta-section {
  position: relative; z-index: 1;
  text-align: center; padding: 80px 24px;
  background: linear-gradient(135deg, #0d1224 0%, #1a0a3e 100%);
}
.cta-section h2 { font-size: clamp(24px, 4vw, 40px); font-weight: 800; margin-bottom: 16px; }
.cta-section p { color: var(--text-muted); font-size: 18px; margin-bottom: 40px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
}
.zalo-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 300; width: 90%; max-width: 420px;
}
.zalo-modal-inner {
  background: #fff; border-radius: 20px; padding: 36px; text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.zalo-header { margin-bottom: 28px; }
.zalo-logo { width: 60px; height: 60px; margin-bottom: 12px; border-radius: 12px; }
.zalo-header h2 { color: #1a1a2e; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.zalo-header p { color: #666; font-size: 14px; }
.zalo-form { display: flex; flex-direction: column; gap: 12px; }
.zalo-form label { text-align: left; font-size: 13px; font-weight: 600; color: #333; margin-bottom: -6px; }
.zalo-form input {
  padding: 14px 16px; border: 2px solid #e5e7eb; border-radius: 12px;
  font-size: 16px; font-family: inherit; outline: none; transition: border-color 0.2s;
  color: #1a1a2e;
}
.zalo-form input:focus { border-color: var(--zalo); }
.btn-zalo-login {
  padding: 14px; border-radius: 12px; background: var(--zalo); color: #fff;
  font-size: 16px; font-weight: 700; border: none; cursor: pointer;
  font-family: inherit; transition: all 0.2s; margin-top: 4px;
}
.btn-zalo-login:hover { background: #0052cc; }
.btn-cancel {
  padding: 10px; border-radius: 12px; background: transparent; color: #666;
  font-size: 14px; border: none; cursor: pointer; font-family: inherit;
}
.btn-cancel:hover { color: #333; }
.zalo-note { margin-top: 16px; font-size: 11px; color: #999; line-height: 1.5; }

/* ===== DASHBOARD ===== */
.dashboard { min-height: 100vh; padding-top: 80px; }
.dash-header {
  background: linear-gradient(135deg, #0d1224 0%, #1a0a3e55 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 32px 28px;
}
.dash-header-inner { max-width: 1100px; margin: 0 auto; }
.dash-welcome { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; }
.dash-title { font-size: 28px; font-weight: 800; margin-bottom: 20px; }
.dash-progress-bar-wrap {
  background: var(--bg-card2); border-radius: 50px; height: 8px;
  overflow: hidden; margin-bottom: 8px; max-width: 500px;
}
.dash-progress-bar {
  height: 100%; border-radius: 50px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.5s ease;
}
.dash-progress-text { font-size: 13px; color: var(--text-muted); }
.dash-progress-text span { color: var(--gold); font-weight: 700; }

.dash-content { max-width: 1100px; margin: 0 auto; padding: 32px; }

/* Streak bar */
.streak-bar {
  display: flex; gap: 16px; margin-bottom: 32px; flex-wrap: wrap;
}
.streak-item {
  flex: 1; min-width: 140px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 14px;
}
.streak-icon { font-size: 28px; }
.streak-val { font-size: 22px; font-weight: 800; color: var(--gold); }
.streak-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Week sections */
.week-section { margin-bottom: 36px; }
.week-section-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.week-badge {
  padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.week-badge.w1 { background: #10b98122; color: #34d399; border: 1px solid #10b98133; }
.week-badge.w2 { background: #3b82f622; color: #60a5fa; border: 1px solid #3b82f633; }
.week-badge.w3 { background: #8b5cf622; color: #a78bfa; border: 1px solid #8b5cf633; }
.week-badge.w4 { background: #f59e0b22; color: #fcd34d; border: 1px solid #f59e0b33; }
.week-section-title { font-size: 18px; font-weight: 700; }

.days-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.day-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; cursor: pointer;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.day-card:hover:not(.locked) {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 6px 24px #7c5cbf33;
}
.day-card.locked { opacity: 0.4; cursor: not-allowed; }
.day-card.completed { border-color: var(--green); background: #10b98110; }
.day-card.active { border-color: var(--gold); background: #f0b42910; }
.day-card.completed::after {
  content: '✓'; position: absolute; top: 8px; right: 10px;
  color: var(--green); font-weight: 700; font-size: 14px;
}
.day-card.active::after {
  content: '▶'; position: absolute; top: 8px; right: 10px;
  color: var(--gold); font-size: 12px;
}
.day-num { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.day-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.day-meta { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.lock-icon { font-size: 18px; margin-bottom: 4px; }

/* ===== LESSON PAGE ===== */
.lesson-page { min-height: 100vh; padding-top: 80px; }
.lesson-topbar {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 16px 32px; display: flex; align-items: center; gap: 16px;
}
.btn-back {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 8px 16px; border-radius: 50px;
  font-size: 14px; font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.btn-back:hover { border-color: var(--accent2); color: var(--accent2); }
.lesson-topbar-info { flex: 1; }
.lesson-topbar-day { font-size: 12px; color: var(--text-muted); }
.lesson-topbar-title { font-size: 16px; font-weight: 700; }

.lesson-body { max-width: 780px; margin: 0 auto; padding: 40px 24px 80px; }

.greeting-box {
  background: linear-gradient(135deg, #7c5cbf22, #9d7de822);
  border: 1px solid #7c5cbf55;
  border-left: 4px solid var(--accent2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.greeting-wave { font-size: 22px; }

.lesson-hero {
  text-align: center; padding: 40px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 32px;
}
.lesson-week-tag {
  display: inline-block; padding: 4px 14px; border-radius: 50px;
  font-size: 12px; font-weight: 700; margin-bottom: 16px;
  background: #7c5cbf22; color: var(--accent2); border: 1px solid #7c5cbf44;
}
.lesson-title {
  font-size: clamp(22px, 4vw, 32px); font-weight: 800; margin-bottom: 12px;
  background: linear-gradient(135deg, #fff, var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.lesson-meta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.lesson-meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}

.content-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 20px;
}
.content-block h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.content-block p { color: var(--text-muted); line-height: 1.8; margin-bottom: 12px; font-size: 15px; }
.content-block p:last-child { margin-bottom: 0; }
.content-block ul { padding-left: 20px; }
.content-block li { color: var(--text-muted); line-height: 1.8; margin-bottom: 8px; font-size: 15px; }
.content-block strong { color: var(--text); }

.highlight-box {
  background: #7c5cbf15; border: 1px solid #7c5cbf44;
  border-left: 4px solid var(--accent); border-radius: 12px;
  padding: 16px 20px; margin: 16px 0;
}
.highlight-box p { color: var(--text) !important; font-weight: 500; margin: 0 !important; }

.steps-list { list-style: none; padding: 0; }
.steps-list li {
  display: flex; gap: 14px; margin-bottom: 16px; color: var(--text-muted);
  font-size: 15px; line-height: 1.7;
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}

/* Homework section */
.homework-block {
  background: linear-gradient(135deg, #1a0a3e 0%, #0d1224 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius); padding: 28px; margin-bottom: 20px;
}
.homework-block h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
  color: var(--gold); display: flex; align-items: center; gap: 10px;
}
.homework-block .hw-desc { color: var(--text-muted); margin-bottom: 20px; font-size: 15px; line-height: 1.7; }

.hw-form { display: flex; flex-direction: column; gap: 14px; }
.hw-form label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.hw-form input, .hw-form textarea, .hw-form select {
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text); padding: 12px 16px; border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none; transition: border-color 0.2s;
  resize: vertical;
}
.hw-form input:focus, .hw-form textarea:focus { border-color: var(--gold); }
.hw-form textarea { min-height: 120px; }

.upload-area {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.upload-area:hover { border-color: var(--gold); background: #f0b42908; }
.upload-icon { font-size: 36px; margin-bottom: 12px; }
.upload-text { font-size: 14px; color: var(--text-muted); }
.upload-text strong { color: var(--gold); }
#file-input { display: none; }
.upload-preview { margin-top: 12px; }
.upload-preview img { max-width: 200px; border-radius: 8px; }
.upload-preview .file-name { font-size: 13px; color: var(--green); margin-top: 8px; }

.btn-submit {
  padding: 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #e59f00);
  color: #1a1a2e; font-size: 16px; font-weight: 800;
  border: none; cursor: pointer; font-family: inherit;
  transition: all 0.25s; margin-top: 8px;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 24px #f0b42955; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.submit-success {
  text-align: center; padding: 24px;
  background: #10b98115; border: 2px solid var(--green);
  border-radius: var(--radius);
}
.submit-success .check { font-size: 48px; margin-bottom: 12px; }
.submit-success h4 { color: var(--green); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.submit-success p { color: var(--text-muted); font-size: 14px; }
.btn-next-day {
  margin-top: 16px; padding: 12px 28px; border-radius: 50px;
  background: var(--green); color: #fff; font-size: 15px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-next-day:hover { transform: translateY(-2px); }

/* ===== PROFILE DROPDOWN ===== */
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; cursor: pointer;
  border: 2px solid var(--accent2);
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; padding: 14px 28px; border-radius: 50px;
  font-size: 15px; font-weight: 600; z-index: 500;
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}
@keyframes slideUp { from { transform: translateX(-50%) translateY(20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(-50%) translateY(20px); } }

/* ===== FOOTER ===== */
footer {
  position: relative; z-index: 1;
  text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .navbar { padding: 12px 16px; }
  .hero { padding: 100px 16px 60px; }
  .hero-stats { gap: 24px; }
  .dash-content { padding: 16px; }
  .lesson-body { padding: 24px 16px 60px; }
  .days-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
