/* ================= GLOBAL RESET & VARIABLES ================= */
:root {
  /* Premium Dark Theme Color Tokens */
  --bg-dark: #070b13;
  --bg-card: rgba(13, 20, 35, 0.65);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(59, 130, 246, 0.35);
  
  --primary: #3b82f6;      /* Electric Blue */
  --secondary: #8b5cf6;    /* Glowing Purple */
  --success: #10b981;      /* Emerald Green */
  --danger: #ef4444;       /* Neon Red */
  --warning: #f59e0b;      /* Warm Gold */
  
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  
  --font-en: 'Outfit', sans-serif;
  --font-bn: 'Hind Siliguri', sans-serif;
  
  --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
}

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

body {
  font-family: var(--font-en);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Lang-specific fallbacks */
html[lang="bn"] body {
  font-family: var(--font-bn);
}

/* ================= BACKGROUND GLOW ORBS ================= */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.45;
  pointer-events: none;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--primary), transparent);
  top: 10%;
  left: -50px;
  animation: floatOrb1 20s infinite ease-in-out alternate;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--secondary), transparent);
  bottom: 15%;
  right: -80px;
  animation: floatOrb2 25s infinite ease-in-out alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 40px) scale(1.15); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-100px, -60px) scale(0.9); }
}

/* ================= MAIN CONTAINER ================= */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding: 24px 20px 100px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ================= HEADER ================= */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accent-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 10px var(--primary));
  width: 32px;
  height: 32px;
}

.logo-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 0.72rem;
  color: var(--text-sub);
  display: block;
  margin-top: -3px;
}

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

/* ================= APP UTILITIES ================= */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: var(--shadow-premium);
  padding: 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.text-gradient {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-sub); }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-2 { margin-top: 8px; }

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 10px;
  border-radius: 10px;
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.link-btn {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ================= SECTION LAYOUTS ================= */
.app-section {
  display: none;
  width: 100%;
}

.app-section.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

/* Forms */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sub);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 14px 14px 44px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

select {
  padding-left: 14px; /* Select dropdowns don't need left icon padding */
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

textarea {
  padding-left: 14px;
}

.help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Sandbox Indicator */
.sandbox-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  margin-top: 24px;
}

.hero-icon-container {
  margin: 0 auto 16px auto;
  width: 64px;
  height: 64px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  filter: drop-shadow(0 0 5px var(--primary));
}

/* ================= SOBRIETY CLOCK ================= */
.badge-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--success);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.clock-display {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.clock-segment {
  display: flex;
  flex-direction: column;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  min-width: 76px;
  padding: 12px 6px;
}

.clock-num {
  font-size: 1.8rem;
  font-weight: 700;
}

.clock-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.success-glow {
  color: var(--success) !important;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* ================= MOOD COMPONENT ================= */
.section-subtitle {
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}

.mood-selector {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mood-btn {
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-sub);
  flex: 1;
  padding: 12px 6px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.mood-btn svg {
  width: 22px;
  height: 22px;
}

.mood-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mood-btn.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.mood-label {
  font-size: 0.7rem;
}

/* ================= TIMELINE / ROADMAP ================= */
.timeline-container {
  position: relative;
  padding-left: 20px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 31px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border-glass);
}

.timeline-item {
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
  position: relative;
}

.timeline-icon-box {
  background: var(--bg-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  z-index: 2;
  margin-top: 16px;
}

.timeline-icon-box svg {
  width: 18px;
  height: 18px;
}

.timeline-item.unlocked .timeline-icon-box {
  color: var(--success);
  filter: drop-shadow(0 0 5px var(--success));
}

.timeline-item.locked .timeline-icon-box {
  color: var(--text-muted);
}

.timeline-item.next .timeline-icon-box {
  color: var(--primary);
  filter: drop-shadow(0 0 5px var(--primary));
  animation: pulsePrimary 1.5s infinite alternate;
}

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

.timeline-content-panel {
  flex: 1;
}

.timeline-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  display: inline-block;
  margin-bottom: 4px;
}

.timeline-item.unlocked .timeline-badge {
  color: var(--success);
}

.timeline-item.locked .timeline-badge {
  color: var(--text-muted);
}

/* ================= JOURNAL LIST ================= */
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journal-card {
  background: rgba(10, 15, 26, 0.4);
  border-left: 3px solid var(--primary);
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
}

.journal-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.journal-card-text {
  font-size: 0.88rem;
  line-height: 1.4;
}

/* ================= PANIC BREATHING SYSTEM ================= */
.panic-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}

.panic-headline {
  font-size: 1.8rem;
}

.breathing-circle-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
}

.breathing-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  border: 2px solid var(--primary);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
  transition: transform 1s ease-in-out;
}

.breathing-ring.inhale {
  transform: scale(1.6);
  background: rgba(139, 92, 246, 0.18);
  border-color: var(--secondary);
  box-shadow: 0 0 45px rgba(139, 92, 246, 0.45);
}

.breathing-ring.hold {
  transform: scale(1.6);
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  box-shadow: 0 0 45px rgba(16, 185, 129, 0.45);
}

.breathing-ring.exhale {
  transform: scale(1);
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.breathing-timer {
  font-size: 3rem;
  font-weight: 700;
  z-index: 5;
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.breathing-instruction {
  font-size: 1.15rem;
  min-height: 28px;
}

/* ================= BOTTOM NAVIGATION BAR ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  padding: 12px 10px;
  z-index: 100;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: color 0.3s;
  flex: 1;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item:hover svg {
  transform: translateY(-2px);
}

.panic-trigger {
  color: var(--danger) !important;
}

.panic-trigger svg {
  animation: alertPulse 1.5s infinite alternate;
}

@keyframes alertPulse {
  from { filter: drop-shadow(0 0 0px var(--danger)); }
  to { filter: drop-shadow(0 0 8px var(--danger)); }
}
