/* =========================================================================
   VOOLA - PURE WEB APP STYLES (MATCHING FLUTTER THEME 1-IN-1)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #4F46E5;
  --primary-light: #6366F1;
  --primary-dark: #3730A3;
  --primary-tint: #EEF2FF;
  
  --secondary: #7C3AED;
  --secondary-tint: #F5F3FF;
  
  --emerald: #059669;
  --emerald-light: #10B981;
  --emerald-tint: #ECFDF5;
  
  --amber: #D97706;
  --amber-light: #F59E0B;
  --amber-tint: #FFFBEB;
  
  --rose: #E11D48;
  --rose-light: #F43F5E;
  --rose-tint: #FFF1F2;
  
  --cyan: #0284C7;
  --cyan-light: #0EA5E9;
  --cyan-tint: #F0F9FF;
  
  --canvas: #F8FAFC;
  --surface: #FFFFFF;
  --surface-elevated: #F1F5F9;
  --border: #E2E8F0;
  --border-subtle: #F1F5F9;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'JetBrains Mono', monospace;
  
  --card-shadow: 0 4px 18px rgba(15, 23, 42, 0.04), 0 1px 4px rgba(15, 23, 42, 0.02);
  --glow-shadow: 0 8px 24px rgba(79, 70, 229, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  --elevated-shadow: 0 10px 28px rgba(79, 70, 229, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--canvas);
  font-family: var(--font-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

#app-root {
  max-width: 480px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  background-color: var(--surface);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0,0,0,0.08);
}

/* Header */
.app-header {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 10;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--amber-tint);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--amber);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: var(--surface-elevated);
  color: var(--primary);
}

/* Main Content Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--canvas);
  position: relative;
}

.tab-pane {
  display: none;
  padding: 16px 16px 85px 16px;
  min-height: 100%;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: var(--surface);
  border-top: 1.2px solid var(--border-subtle);
  display: flex;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05);
  z-index: 20;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px 0;
  transition: all 0.15s ease;
}

.nav-item .icon-wrapper {
  padding: 4px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item .nav-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.2px;
  margin-top: 2px;
}

.nav-item.active .icon-wrapper {
  background: var(--primary-tint);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.nav-item.active svg {
  stroke: var(--primary);
  fill: rgba(79, 70, 229, 0.1);
}

.nav-item.active .nav-label {
  color: var(--primary);
  font-weight: 800;
}

/* Cards & Components */
.card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.card-hero {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 50%, #EEF2FF 100%);
  border: 1px solid #E0E7FF;
  position: relative;
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  letter-spacing: -0.2px;
}

.badge-indigo { background: var(--primary-tint); color: var(--primary); }
.badge-emerald { background: var(--emerald-tint); color: var(--emerald); }
.badge-amber { background: var(--amber-tint); color: var(--amber); }
.badge-rose { background: var(--rose-tint); color: var(--rose); }
.badge-secondary { background: var(--secondary-tint); color: var(--secondary); }

.card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.35;
  margin-top: 8px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 6px;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #FFF;
  border: none;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
  transition: all 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
  background: var(--primary-dark);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-outline:active {
  background: var(--surface-elevated);
}

/* Progress bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: var(--surface-elevated);
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 8px;
  transition: width 0.3s ease;
}

/* Filter chips */
.chip-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.chip-scroller::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.active {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* Search bar */
.search-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.search-input-box input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
}

/* Modal view for Lesson Detail, Quiz, Profile */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  z-index: 50;
  display: none;
  flex-direction: column;
  animation: slideInUp 0.22s ease-out;
}

.modal-overlay.active {
  display: flex;
}

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  height: 56px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 40px 16px;
}

/* Phase Headers */
.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 14px 0;
}

.phase-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.phase-number {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.phase-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* Interactive Studio Box */
.studio-box {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  padding: 16px;
  margin-bottom: 20px;
}

.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.param-deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.param-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.param-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.param-value {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

.audit-score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 800;
}

.audit-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.pillar-chip {
  text-align: center;
  padding: 6px 2px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 750;
  border: 1px solid var(--border);
  background: var(--surface-canvas);
  color: var(--text-muted);
}

.pillar-chip.active {
  background: var(--emerald-tint);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald);
}

.quick-inject-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 8px 0 14px 0;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.quick-inject-chip {
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
}

.deliverable-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #0F172A;
  color: #E2E8F0;
  font-family: var(--font-code);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
}

/* Toast */
.toast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #FFF;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Code block snippet */
pre.code-block {
  background: #0F172A;
  color: #E2E8F0;
  padding: 14px;
  border-radius: 12px;
  font-family: var(--font-code);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-x: auto;
  margin: 12px 0;
}

/* Subscription & Account Styles */
.sub-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.sub-status-badge.active {
  background: var(--emerald-tint);
  color: var(--emerald);
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.sub-status-badge.cancelled {
  background: var(--rose-tint);
  color: var(--rose);
  border: 1px solid rgba(225, 29, 72, 0.25);
}

.btn-danger-outline {
  background: var(--surface);
  color: var(--rose);
  border: 1.2px solid rgba(225, 29, 72, 0.3);
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  transition: all 0.15s ease;
}
.btn-danger-outline:hover, .btn-danger-outline:active {
  background: var(--rose-tint);
  border-color: var(--rose);
}

.btn-subtle-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  transition: background 0.15s ease;
}
.btn-subtle-link:hover, .btn-subtle-link:active {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.legal-content-box {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px 18px;
  font-family: var(--font-body);
}

