/* ============================================================
   SpeakUp English Platform — Main Stylesheet
   Mobile-first, Bootstrap-compatible
   ============================================================ */

:root {
  --primary:     #4f46e5;
  --primary-dark:#3730a3;
  --secondary:   #7c3aed;
  --success:     #059669;
  --warning:     #d97706;
  --danger:      #dc2626;
  --surface:     #ffffff;
  --bg:          #f8fafc;
  --text:        #1e293b;
  --muted:       #64748b;
  --border:      #e2e8f0;
  --radius:      12px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
}

/* ---- Base ---- */
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* ---- Mode-specific accents ---- */
body.mode-gamified { --primary: #7c3aed; }
body.mode-simple   { --primary: #4f46e5; }

/* ---- Cards ---- */
.card { border-radius: var(--radius) !important; }
.card-header { border-radius: var(--radius) var(--radius) 0 0 !important; }

/* ---- Gradient hero card ---- */
.gradient-card { background: linear-gradient(135deg, var(--primary), var(--secondary)); }

/* ---- Buttons ---- */
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ---- Navbar ---- */
.navbar { background: var(--primary) !important; }

/* ---- Progress bars ---- */
.progress { border-radius: 99px; }
.progress-bar { border-radius: 99px; transition: width 0.6s ease; }

/* ---- Quiz Option Buttons ---- */
.option-btn {
  border-radius: 10px !important;
  transition: all 0.2s;
  border-width: 2px !important;
  font-size: 1rem;
  text-align: left;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--primary) !important;
  background: rgba(79,70,229,.06) !important;
  transform: translateX(3px);
}
.option-btn.active {
  border-color: var(--primary) !important;
  background: rgba(79,70,229,.1) !important;
}

/* ---- Lesson Content ---- */
.lesson-card { border-left: 4px solid var(--primary); }
.english-sentence {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
}
.hindi-meaning {
  font-size: 1.15rem;
  color: var(--muted);
  font-style: italic;
}
.example-item {
  border-left: 3px solid var(--success);
  padding-left: 12px;
  margin-bottom: 10px;
}
.example-en { font-weight: 600; color: var(--text); }
.example-hi { color: var(--muted); font-size: .9rem; }

/* ---- Vocabulary Card ---- */
.vocab-word {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
}
.vocab-pronunciation {
  color: var(--muted);
  font-size: .95rem;
  font-style: italic;
}
.vocab-hindi {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--secondary);
}
.pos-badge {
  background: var(--primary);
  color: white;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---- Dialogue ---- */
.dialogue-line { margin-bottom: 14px; }
.dialogue-speaker { font-weight: 700; color: var(--primary); margin-bottom: 2px; font-size: .85rem; text-transform: uppercase; }
.dialogue-bubble {
  background: white;
  border-radius: 0 12px 12px 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.dialogue-bubble.speaker-b {
  border-radius: 12px 0 12px 12px;
  background: #f0f4ff;
}
.dialogue-en { font-weight: 600; font-size: 1rem; }
.dialogue-hi { color: var(--muted); font-size: .88rem; margin-top: 2px; }

/* ---- Badge Items ---- */
.badge-earned { opacity: 1; }
.badge-locked { opacity: .35; filter: grayscale(1); }

/* ---- Leaderboard ---- */
.leaderboard-row:nth-child(1) { background: #fffbeb; }
.leaderboard-row:nth-child(2) { background: #f8fafc; }
.leaderboard-row:nth-child(3) { background: #fff7f0; }

/* ---- Level badges ---- */
.level-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px; font-size: .8rem; font-weight: 600;
}

/* ---- Stats card ---- */
.stat-card { transition: transform .2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.1) !important; }

/* ---- Alert level up ---- */
.level-up-alert { animation: pulse 1s ease 3; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.02)} }

/* ---- Speaking Practice ---- */
.speaking-text {
  font-size: 1.5rem; font-weight: 700; color: var(--primary);
  line-height: 1.5; text-align: center; padding: 1rem;
}
.phonetic-text { color: var(--muted); font-style: italic; text-align: center; font-size: 1rem; }

/* ---- Day progress ring ---- */
.progress-ring { position: relative; display: inline-block; }
.progress-ring-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-weight: 800; }

/* ---- Admin sidebar ---- */
.admin-sidebar {
  width: 260px; min-height: 100vh; background: var(--primary);
  position: fixed; top: 0; left: 0; z-index: 100;
  overflow-y: auto; transition: transform .3s;
}
.admin-sidebar .nav-link { color: rgba(255,255,255,.8); padding: .6rem 1.2rem; border-radius: 8px; margin: 2px 8px; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active { color: white; background: rgba(255,255,255,.15); }
.admin-content { margin-left: 260px; min-height: 100vh; }
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-content { margin-left: 0; }
}

/* ---- Form styles ---- */
.form-control, .form-select { border-radius: 8px; border-color: var(--border); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }

/* ---- Tables ---- */
.table { border-radius: 10px; overflow: hidden; }
.table thead th { background: var(--primary); color: white; border: none; }

/* ---- Gamified Mode extra visual flair ---- */
body.mode-gamified .card { border-top: 3px solid var(--primary); }
body.mode-gamified .option-btn:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(124,58,237,.3); }

/* ---- PWA install banner ---- */
#pwa-install { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 2000; width: calc(100% - 2rem); max-width: 400px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---- Animations ---- */
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ---- Responsive tweaks ---- */
@media (max-width: 576px) {
  .english-sentence { font-size: 1.2rem; }
  .vocab-word { font-size: 1.7rem; }
  .container { padding-left: 12px; padding-right: 12px; }
}

/* ---- Print ---- */
@media print { .navbar, .bottom-nav, .btn, #pwa-install { display: none !important; } }
