/* Spoken English Pro — Refined Ruby Crimson & Velvet Slate Palette:
   #E11D48 (Ruby Crimson), #BE123C (Velvet Carmine), #9F1239 (Deep Wine),
   #FDA4AF (Soft Rose Glow), #F8FAFC (Pearl White), #94A3B8 (Cool Slate),
   #0A0F1D (Midnight Velvet), #12192C (Card Navy)
*/
:root {
  --brand-crimson: #E11D48;
  --brand-crimson-dark: #BE123C;
  --brand-wine: #9F1239;
  --brand-navy-dark: #0A0F1D;
  --brand-pearl: #F8FAFC;
  --brand-rose-soft: #FDA4AF;
  --brand-slate-silver: #94A3B8;
  --brand-blush: #FFE4E6;
  --brand-slate: #475569;

  --bg-dark: #0A0F1D;
  --bg-card: rgba(18, 25, 44, 0.94);
  --primary-neon: #E11D48;
  --primary-glow: rgba(225, 29, 72, 0.4);
  --accent-purple: #BE123C;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border-glass: rgba(253, 164, 175, 0.14);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
}

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

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 0%, #1A2238 0%, var(--bg-dark) 75%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 800;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--brand-pearl);
  transition: transform 0.2s ease;
  user-select: none;
  text-decoration: none;
  line-height: 1;
}

.brand-logo:hover {
  transform: translateY(-1px);
}

.logo-brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.logo-brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, #FFFFFF 30%, #FFE4E6 70%, #FDA4AF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-brand-pro {
  background: linear-gradient(135deg, var(--brand-crimson), var(--brand-wine));
  color: #FFFFFF;
  border: 1px solid rgba(253, 164, 175, 0.4);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.9px;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.45);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

.logo-orb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFE4E6 0%, #E11D48 45%, #BE123C 80%, #0A0F1D 100%);
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.6), inset 0 0 4px rgba(255, 228, 230, 0.85);
  border: 1.5px solid rgba(253, 164, 175, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.logo-orb::after {
  content: '⚡';
  font-size: 0.9rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.brand-logo:hover .logo-orb {
  box-shadow: 0 0 26px rgba(225, 29, 72, 0.9), inset 0 0 6px rgba(255, 228, 230, 0.95);
  transform: rotate(15deg);
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
}

.nav-link:hover, .nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.supernova-stats {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  font-size: 0.85rem;
  font-weight: 700;
}

.stat-pill.streak { color: #f97316; }
.stat-pill.xp { color: #facc15; }

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-greeting {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--brand-pearl);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-header-auth {
  padding: 0.45rem 1.1rem !important;
  font-size: 0.88rem !important;
  border-radius: 20px !important;
}

.btn-header-logout {
  padding: 0.35rem 0.8rem !important;
  font-size: 0.82rem !important;
  border-radius: 20px !important;
}

/* ── Mobile Bottom Navigation Bar (App Bar) ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 15, 29, 0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding: 0.3rem 0.5rem calc(0.3rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  flex: 1;
  padding: 0.3rem 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-item .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
  color: var(--brand-pearl);
}

.mobile-nav-item.active .nav-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .supernova-stats {
    display: none;
  }

  .mobile-bottom-nav:not(.hidden) {
    display: flex;
  }

  .app-main {
    padding-bottom: 84px !important;
  }

  .header-container {
    padding: 0.6rem 1rem;
  }

  .user-greeting {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-crimson), var(--brand-burgundy));
  color: var(--brand-pearl);
  border: 1px solid rgba(253, 190, 192, 0.2);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(212, 23, 30, 0.6);
  background: linear-gradient(135deg, #e31b23, var(--brand-crimson-dark));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-upgrade {
  background: linear-gradient(135deg, var(--brand-crimson), #b5141b);
  color: white;
  font-size: 1.05rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--brand-rose-soft);
  box-shadow: 0 4px 16px rgba(212, 23, 30, 0.45);
}

.btn-upgrade:hover {
  background: linear-gradient(135deg, #e31b23, #9e1016);
  box-shadow: 0 6px 24px rgba(212, 23, 30, 0.7);
}

.btn-full { width: 100%; }

/* ── Landing Hero & Feature Cards ── */
.landing-hero {
  text-align: center;
  padding: 2.5rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--brand-pearl);
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.landing-hero h1 span {
  background: linear-gradient(135deg, #FFFFFF 20%, #FFE4E6 60%, #FDA4AF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 1.8rem;
  line-height: 1.6;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 3rem;
  text-align: left;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: rgba(253, 164, 175, 0.3);
}

.feature-card .icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-pearl);
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Simple Focused Card Layout */
.app-main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.2rem;
}

.simple-lesson-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 2.2rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
}

.simple-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.simple-prompt-card {
  background: rgba(212, 23, 30, 0.08);
  border: 1px solid rgba(212, 23, 30, 0.3);
  padding: 1.4rem 1.8rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.8rem;
  text-align: center;
}

.simple-prompt-card h3 {
  font-size: 1.3rem;
  color: var(--brand-blush);
  margin-bottom: 0.4rem;
}

.simple-prompt-card p {
  font-size: 1.1rem;
  color: var(--brand-pearl);
  font-weight: 500;
}

/* Streamlined Selection Option Buttons */
.selection-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.btn-selection-pill {
  padding: 1.1rem 1.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(212, 23, 30, 0.35);
  border-radius: var(--radius-sm);
  color: var(--brand-pearl);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-selection-pill:hover {
  background: linear-gradient(135deg, rgba(212, 23, 30, 0.35), rgba(171, 48, 52, 0.35));
  border-color: var(--brand-crimson);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 23, 30, 0.45);
}

/* Big Mic Button for Voice Practice */
.simple-voice-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2rem 1rem;
  text-align: center;
}

.btn-mic-supernova-lg {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fdbec0 0%, var(--brand-crimson) 50%, var(--brand-crimson-dark) 85%);
  color: white;
  border: 2px solid rgba(253, 190, 192, 0.5);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(212, 23, 30, 0.55);
  transition: all 0.3s ease;
}

.btn-mic-supernova-lg:hover {
  transform: scale(1.08);
  box-shadow: 0 0 40px rgba(212, 23, 30, 0.85);
}

.btn-mic-supernova-lg.recording {
  background: linear-gradient(135deg, #ef4444, #f97316);
  animation: pulseMic 1.2s infinite alternate;
  box-shadow: 0 0 45px rgba(239, 68, 68, 0.9);
}

@keyframes pulseMic {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* Chat & Feedback */
.simple-feedback-box {
  margin-top: 1.5rem;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
}

.simple-feedback-box.correct {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.simple-feedback-box.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Modals */
.modal-dialog {
  border: none;
  border-radius: var(--radius-md);
  padding: 0;
  max-width: 480px;
  width: 92%;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  background: var(--bg-dark);
  color: white;
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.modal-content {
  padding: 2.2rem;
  position: relative;
  background: rgba(20, 27, 44, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.btn-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1.8rem;
}

.tab-btn {
  flex: 1;
  padding: 0.8rem;
  background: none;
  border: none;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--primary-neon);
  border-bottom-color: var(--primary-neon);
}

.form-group { margin-bottom: 1.4rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }
.form-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.98rem;
}

.error-banner {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
  display: none;
}

/* Google Sign-In & One-Tap Styling */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.4rem 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-glass);
}

.auth-divider span {
  padding: 0 0.8rem;
}

.google-auth-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.btn-google-custom {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.2rem;
  background: #FFFFFF;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-google-custom:hover {
  background: #f9fafb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.hidden { display: none !important; }

/* Dashboard & Course Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.8rem;
}

@media (max-width: 850px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.lesson-list { display: flex; flex-direction: column; gap: 0.8rem; }
.lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
}

.badge-status { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 12px; font-weight: 700; }
.badge-free { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-paid { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.progress-bar-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  margin: 0.6rem 0;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary-neon), var(--accent-emerald));
  height: 100%;
}

/* ── Mobile Touch & Phone Optimizations ── */
@media (max-width: 640px) {
  .header-container {
    padding: 0.7rem 1rem;
    gap: 0.5rem;
  }

  .logo-brand-name {
    font-size: 1.1rem;
  }

  .logo-orb {
    width: 28px;
    height: 28px;
  }

  .logo-orb::after {
    font-size: 0.75rem;
  }

  .supernova-stats {
    gap: 0.4rem;
  }

  .stat-pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .app-main {
    padding: 1rem 0.8rem;
  }

  .simple-lesson-wrapper {
    padding: 1.4rem 1rem;
    border-radius: var(--radius-sm);
  }

  .simple-prompt-card {
    padding: 1.1rem 1rem;
  }

  .simple-prompt-card h3 {
    font-size: 1.15rem;
  }

  .simple-prompt-card p {
    font-size: 0.98rem;
  }

  .selection-options-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .btn-selection-pill {
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    min-height: 52px;
  }

  .btn-mic-supernova-lg {
    width: 82px;
    height: 82px;
    font-size: 2rem;
  }

  .modal-content {
    padding: 1.6rem 1.2rem;
    width: 94vw;
  }
}
