/* =======================================================
   SmritiSetu (স্মৃতি সেতু) Design System
   Elderly Accessible • High Contrast • North-East Aesthetics
   ======================================================= */

:root {
  --primary-navy: #1b365d;
  --secondary-teal: #0f766e;
  --accent-orange: #d97706;
  --accent-gold: #f59e0b;
  --bg-cream: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #cbd5e1;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --success-green: #15803d;
  --danger-red: #b91c1c;
  --touch-min: 52px;
  --border-radius: 16px;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-regional: 'Noto Sans Bengali', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: #f1f5f9;
  color: var(--text-dark);
  line-height: 1.5;
  font-size: 16px;
}

/* App Container */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
  padding-bottom: 70px;
}

/* Header */
.app-header {
  background: var(--primary-navy);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 3px solid var(--accent-gold);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  font-size: 32px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-gold);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-sub {
  font-family: var(--font-regional);
  font-size: 17px;
  color: var(--accent-gold);
}

.brand-tagline {
  font-size: 12px;
  color: #cbd5e1;
}

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

.badge {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-online {
  background: #dcfce7;
  color: var(--success-green);
}

.badge-accent {
  background: #fef3c7;
  color: #92400e;
}

.btn-pill {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
}

.btn-pill:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Nav Bar */
.nav-bar {
  display: flex;
  background: white;
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-btn {
  flex: 1;
  min-width: 90px;
  padding: 12px 6px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  min-height: var(--touch-min);
}

.nav-btn .nav-icon {
  font-size: 22px;
}

.nav-btn.active {
  color: var(--primary-navy);
  border-bottom-color: var(--accent-orange);
  background: #f8fafc;
}

/* Main Content Area */
.main-content {
  padding: 20px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

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

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, #1b365d, #0f766e);
  color: white;
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(27, 54, 93, 0.15);
}

.welcome-banner h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.welcome-banner p {
  font-size: 14px;
  color: #e2e8f0;
}

/* Game Cards */
.game-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.game-card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.game-card-icon {
  font-size: 42px;
  width: 72px;
  height: 72px;
  background: #f1f5f9;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.game-card-body {
  flex: 1;
}

.clinical-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--secondary-teal);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.game-card-body h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 4px;
}

.game-card-body p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.game-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  align-items: center;
  flex-wrap: wrap;
}

.lvl-badge {
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.btn-play {
  background: var(--primary-navy);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  min-height: var(--touch-min);
}

/* Streak Summary */
.streak-summary-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  text-align: center;
}

.streak-item {
  display: flex;
  flex-direction: column;
}

.streak-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-navy);
}

.streak-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Active Game Play Surface */
.game-play-container {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  padding: 16px;
}

.game-play-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-back {
  background: #e2e8f0;
  border: none;
  color: var(--text-dark);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
}

.active-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
}

.game-live-stats {
  display: flex;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
}

.game-board-surface {
  min-height: 380px;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #f8fafc;
}

.voice-caption-box {
  margin-top: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* Game 1: Smriti Sprint Styles */
.sprint-arena {
  width: 100%;
  max-width: 480px;
  height: 320px;
  position: relative;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.central-target {
  font-size: 64px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
}

.central-target:active {
  transform: scale(0.9);
}

.peripheral-target {
  position: absolute;
  font-size: 40px;
  cursor: pointer;
  user-select: none;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* Game 2: Xodot Spaced Retrieval */
.xodot-card-box {
  text-align: center;
  max-width: 400px;
}

.xodot-avatar {
  font-size: 80px;
  margin-bottom: 12px;
}

.xodot-name-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.btn-option {
  background: white;
  border: 2px solid var(--primary-navy);
  color: var(--primary-navy);
  padding: 14px 12px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  min-height: 54px;
}

.btn-option:hover {
  background: #eff6ff;
}

/* Game 3: Bihu Bazaar CST */
.bazaar-arena {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.bazaar-item-display {
  font-size: 64px;
  background: white;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  text-align: center;
}

.bazaar-baskets {
  display: flex;
  gap: 12px;
  width: 100%;
}

.bazaar-basket-btn {
  flex: 1;
  background: white;
  border: 2px solid var(--secondary-teal);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--secondary-teal);
  cursor: pointer;
  min-height: 56px;
}

.bazaar-basket-btn:hover {
  background: #f0fdfa;
}

/* Reminders */
.reminders-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reminders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.reminder-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reminder-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reminder-icon {
  font-size: 32px;
  background: #f1f5f9;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reminder-time {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
}

.reminder-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.btn-ack {
  background: var(--success-green);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 48px;
}

.demo-trigger-card {
  background: #fffbeb;
  border: 2px dashed #f59e0b;
  border-radius: var(--border-radius);
  padding: 16px;
}

.demo-trigger-card h4 {
  font-size: 16px;
  color: #92400e;
  margin-bottom: 6px;
}

.demo-trigger-card p {
  font-size: 13px;
  color: #78350f;
  margin-bottom: 12px;
}

.demo-trigger-card button {
  margin-right: 8px;
  margin-bottom: 6px;
}

/* Sunflower Mode */
.sunflower-container {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.sunflower-overlay {
  background: linear-gradient(180deg, #fef3c7 0%, #fff7ed 100%);
  padding: 24px;
  border-radius: var(--border-radius);
  border: 2px solid #fde68a;
}

.sunflower-badge {
  background: #f59e0b;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 10px;
}

.sunflower-content h2 {
  font-size: 24px;
  color: #78350f;
  margin-bottom: 8px;
}

.sunflower-content p {
  color: #92400e;
  font-size: 14px;
  margin-bottom: 16px;
}

.sunflower-visualizer {
  width: 100%;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
}

.visualizer-scene {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #10b981, #047857);
  background-size: cover;
  background-position: center;
  transition: background 0.6s ease-in-out;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.scenery-caption {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.sunflower-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn-soothe {
  background: white;
  border: 2px solid #d97706;
  color: #b45309;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}

.btn-soothe:hover {
  background: #fffbeb;
}

.gentle-prompt {
  background: white;
  padding: 12px;
  border-radius: 12px;
  font-style: italic;
  font-size: 15px;
  color: #92400e;
  text-align: center;
  border: 1px solid #fde68a;
}

/* Caregiver Dashboard */
.caregiver-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
}

.kpi-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-navy);
  margin: 4px 0;
}

.kpi-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-trend {
  font-size: 12px;
  font-weight: 700;
}

.kpi-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.chart-section-card, .alerts-log-card, .screening-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 18px;
}

.chart-section-card h3, .alerts-log-card h3, .screening-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 12px;
}

.trend-bars {
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 12px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.bar {
  width: 44px;
  background: #cbd5e1;
  border-radius: 6px 6px 0 0;
  transition: height 0.4s;
}

.active-bar {
  background: var(--primary-navy);
}

.chart-legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.green { background: var(--success-green); }
.legend-dot.blue { background: var(--primary-navy); }

.alerts-log-card .alert-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.alert-info { background: #f0f9ff; border-left: 4px solid #0284c7; }
.alert-success { background: #f0fdf4; border-left: 4px solid var(--success-green); }
.alert-warning { background: #fffbeb; border-left: 4px solid var(--accent-gold); }

.alert-time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ASHA Portal */
.asha-portal {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.asha-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.question-step {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 12px;
  margin: 12px 0;
}

.q-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary-teal);
  text-transform: uppercase;
}

.q-text {
  font-size: 16px;
  font-weight: 700;
  margin: 8px 0 14px;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-choice {
  background: white;
  border: 2px solid var(--border-color);
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  min-height: 48px;
}

.btn-choice:hover {
  border-color: var(--primary-navy);
  background: #f1f5f9;
}

.asha-result {
  margin-top: 16px;
  padding: 16px;
  background: #eff6ff;
  border-radius: 12px;
  border: 2px solid #bfdbfe;
}

.community-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-box {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-digit {
  font-size: 28px;
  font-weight: 800;
  color: var(--secondary-teal);
  display: block;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Voice Capsule Floating Button */
.voice-floating-capsule {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-navy);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(27, 54, 93, 0.4);
  cursor: pointer;
  z-index: 100;
  border: 2px solid var(--accent-gold);
  min-height: 52px;
}

.voice-capsule-icon {
  font-size: 22px;
}

.voice-capsule-text {
  font-size: 14px;
  font-weight: 700;
}

.pulse-ring {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-ring-anim 1.5s infinite;
}

@keyframes pulse-ring-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* General Buttons */
.btn-primary {
  background: var(--primary-navy);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}

.btn-secondary {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
}

.btn-outline {
  background: white;
  border: 2px solid var(--primary-navy);
  color: var(--primary-navy);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}

/* Utilities */
.hidden { display: none !important; }
.text-green { color: var(--success-green); }
.text-blue { color: var(--primary-navy); }

/* Responsive adjustments for mobile/tablet */
@media (max-width: 640px) {
  .header-badges { width: 100%; justify-content: flex-end; }
  .streak-summary-card { grid-template-columns: repeat(2, 1fr); }
  .community-stats-grid { grid-template-columns: 1fr; }
  .nav-btn .nav-text { font-size: 11px; }
}
