/* ==========================================
   SAN TRIBE PEER SUPPORT HUB - DESIGN SYSTEM
   ========================================== */

:root {
  /* Elegant Gold & Dark Color Theme */
  --color-bg-dark: #090a0f;         /* Deep rich obsidian black */
  --color-card-bg: rgba(20, 22, 28, 0.7); /* Translucent obsidian glass */
  --color-card-border: rgba(255, 226, 89, 0.12); /* Subtle gold border */
  
  /* Gold Palette (Radiant metallic gradient) */
  --gold-primary: #FFE259;
  --gold-secondary: #FFA751;
  --gold-gradient: linear-gradient(135deg, #FFE259 0%, #FFA751 100%);
  --gold-glow: rgba(255, 167, 81, 0.25);
  
  /* Text Tones */
  --text-primary: #F8F9FA;          /* Soft crisp white */
  --text-secondary: #A0A5B5;        /* Calming muted steel silver */
  --text-muted: #6B7280;            /* Darker muted tone */
  
  /* Design Details */
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 12px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-gold-hover: 0 15px 35px rgba(255, 167, 81, 0.25);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

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

body {
  font-family: var(--font-main);
  background-color: #050608;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 20px;
}

/* Dynamic Ambient Glows */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-color: var(--color-bg-dark);
  overflow: hidden;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
}

.bg-glow-1 {
  top: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--gold-secondary);
}

.bg-glow-2 {
  bottom: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: #2563EB; /* Deep bay blue glow */
}

/* ==========================================
   MASTER MOBILE CONTAINER (Jarrod's & Peter's)
   ========================================== */
.mobile-frame-container {
  width: 100%;
  max-width: 412px; /* Perfect smartphone screen width */
  height: 844px;    /* iPhone 12/13/14/15 Pro scale ratio */
  background: #111319;
  border-radius: 48px; /* Smooth curved corner phone bezel */
  border: 12px solid #242833; /* Elegant outer hardware border */
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Device Top Notch Simulator */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 28px;
  background: #242833;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  z-index: 100;
}

.phone-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.app-scrollable-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: none; /* Hide standard Firefox scrollbar */
}

.app-scrollable-content::-webkit-scrollbar {
  display: none; /* Hide Chrome/Safari scrollbars */
}

/* Status Bar Details */
.phone-status-bar {
  height: 44px;
  padding: 0 28px 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  z-index: 90;
  background-color: transparent;
}

.status-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-status {
  opacity: 0.8;
}

/* ==========================================
   PHASE 2 - ONBOARDING & PRIVACY OVERLAY
   ========================================== */
.onboarding-overlay {
  position: absolute;
  top: 44px; /* Under the phone status bar */
  left: 0;
  width: 100%;
  height: calc(100% - 44px);
  background-color: #111319;
  z-index: 80;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transition: opacity 0.4s ease;
}

.onboarding-slide {
  display: none;
  flex-direction: column;
  height: 100%;
  animation: slide-in-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.onboarding-slide.active {
  display: flex;
}

/* Slide 1 - Selection */
.onboarding-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 14px;
  margin-bottom: 20px;
}

.onboarding-app-name {
  font-size: 32px;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 14px;
  margin-bottom: 4px;
}

.onboarding-tagline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.welcome-disclaimer {
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-md);
  padding: 14px;
  text-align: center;
  margin-bottom: 24px;
}

.welcome-disclaimer p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.mode-options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mode-card-btn {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
  width: 100%;
  color: var(--text-primary);
}

.mode-card-btn:hover {
  border-color: rgba(255, 167, 81, 0.4);
  background: rgba(25, 27, 34, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.mode-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 226, 89, 0.08);
  border: 1.5px solid rgba(255, 226, 89, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.mode-card-text {
  flex: 1;
}

.mode-card-text h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.mode-card-text p {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.mode-card-arrow {
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.mode-card-btn:hover .mode-card-arrow {
  color: var(--gold-primary);
  transform: translateX(2px);
}


/* Quiz Options & Cards */
.quiz-checkcard {
  transition: var(--transition-smooth) !important;
}

.quiz-checkcard:hover {
  border-color: rgba(255, 167, 81, 0.45) !important;
  background: rgba(25, 27, 34, 0.8) !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.quiz-checkcard.selected {
  background: rgba(255, 226, 89, 0.06) !important;
  border-color: var(--gold-primary) !important;
  box-shadow: 0 0 16px rgba(255, 226, 89, 0.12);
}

.quiz-checkcard.selected .checkcard-emoji {
  transform: scale(1.15);
  transition: transform 0.2s ease;
}

.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Slide 2 - Loading */
.generating-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 24px;
}

.spinner-ring {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(255, 226, 89, 0.1);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

.generating-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.generating-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 280px;
}

/* Slide 3 - Pseudonym Reveal */
.reveal-header {
  text-align: center;
  margin-top: 14px;
  margin-bottom: 24px;
}

.reveal-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ADE80;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.reveal-header h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.reveal-header p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.pseudo-name-card {
  background: linear-gradient(135deg, rgba(25, 27, 34, 0.8) 0%, rgba(13, 14, 18, 0.9) 100%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 15px 35px rgba(255, 167, 81, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.pseudo-prefix {
  font-family: var(--font-main);
  font-size: 24px;
  font-weight: 800;
  color: var(--gold-secondary);
}

.pseudo-display {
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.pseudo-benefits-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.benefit-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.benefit-check {
  color: var(--gold-primary);
  font-weight: 800;
  font-size: 16px;
}

.benefit-item p {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Slide 4 - PIN Screen */
.back-link-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 24px;
  width: fit-content;
}

.back-link-btn:hover {
  color: var(--gold-primary);
}

.pin-header {
  text-align: center;
  margin-bottom: 24px;
}

.pin-header h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.pin-header p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 260px;
  margin: 0 auto;
}

.pin-dots-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-card-border);
  transition: var(--transition-smooth);
}

.pin-dot.filled {
  background-color: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(255, 226, 89, 0.4);
}

.pin-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, auto);
  gap: 14px;
  max-width: 240px;
  margin: 0 auto;
}

.pin-key {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin: 0 auto;
}

.pin-key:hover {
  background: rgba(255, 226, 89, 0.1);
  border-color: rgba(255, 226, 89, 0.3);
  color: var(--gold-primary);
}

.pin-key.spec {
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  border: none;
  width: 60px;
}

.pin-key.spec:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

/* ==========================================
   APP HEADER & SHELL CONTENT
   ========================================== */
.app-top-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: #111319;
  z-index: 50;
  flex-shrink: 0;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38BDF8; /* Cool medical blue */
}

.user-avatar-dot.active-glow {
  background: #4ADE80; /* Safe active green */
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.user-profile-text {
  display: flex;
  flex-direction: column;
}

.user-hello {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.user-display-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-display-name.anon-badge {
  color: var(--gold-primary);
}

.exit-session-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.exit-session-btn:hover {
  color: #EF4444; /* Alert exit warning red */
}

.app-view {
  width: 100%;
  animation: slide-in-fade 0.4s ease forwards;
}

/* ==========================================
   WELCOME BANNER (Morgan's piece)
   ========================================== */
.welcome-banner {
  position: relative;
  padding: 32px 24px 28px 24px;
  background: linear-gradient(180deg, #161821 0%, #0d0f14 100%);
  border-bottom: 1px solid var(--color-card-border);
  overflow: hidden;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 80% 20%, rgba(255, 226, 89, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* Logo and Brand Header */
.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.sankofa-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 226, 89, 0.06);
  border: 1.5px solid rgba(255, 226, 89, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(255, 167, 81, 0.1);
}

.sankofa-badge.pulse-anim {
  animation: pulse-glow 3s infinite ease-in-out;
}

.sankofa-svg {
  width: 24px;
  height: 24px;
}

.brand-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Titles */
.banner-titles {
  margin-bottom: 20px;
}

.app-title {
  font-family: var(--font-main);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.subtitle-badge {
  display: inline-block;
  background: rgba(255, 226, 89, 0.06);
  border: 1px solid rgba(255, 226, 89, 0.2);
  padding: 4px 12px;
  border-radius: 100px;
}

.gold-text-glow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--gold-primary);
  text-shadow: 0 0 10px rgba(255, 226, 89, 0.3);
}

/* Intro Card (Minimalist glass) */
.intro-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 2;
}

.welcome-intro-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.highlight-gold {
  color: var(--gold-primary);
  position: relative;
  display: inline-block;
}

.highlight-gold::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gold-gradient);
  border-radius: 10px;
  opacity: 0.7;
}

.welcome-body-text {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Safe Badge */
.safe-badge-container {
  display: flex;
}

.safe-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-primary);
  background: rgba(255, 226, 89, 0.06);
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255, 226, 89, 0.12);
}

.badge-icon {
  color: var(--gold-primary);
}

/* Button & Action Zone */
.action-section {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}

.cta-button {
  background: var(--gold-gradient);
  border: none;
  border-radius: var(--border-radius-md);
  padding: 16px 28px;
  width: 100%;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  color: #090a0f;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 167, 81, 0.2);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: 0.5s;
}

.cta-button:hover::before {
  left: 100%;
  transition: 0.7s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-hover);
}

.cta-button.clicked {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(255, 167, 81, 0.1);
}

.btn-arrow {
  transition: var(--transition-smooth);
}

.cta-button:hover .btn-arrow {
  transform: translateX(4px);
}

/* ==========================================
   APP COMPONENT PLACEHOLDERS (Future Pieces)
   ========================================== */
.app-preview-placeholder {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.placeholder-card {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-md);
  padding: 18px;
  align-items: center;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.placeholder-card:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 226, 89, 0.12);
}

.placeholder-icon {
  font-size: 24px;
  filter: grayscale(0.2);
}

.placeholder-text h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.placeholder-text p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ==========================================
   PHASE 6 - INTERACTIVE MAP STYLING
   ========================================== */
.map-view-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: calc(844px - 140px); /* Fill the phone view correctly */
}

.map-header {
  margin-bottom: 14px;
}

.map-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.map-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.map-toggle-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.map-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 10px 0;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.map-toggle-btn.active {
  background: var(--gold-gradient);
  color: #090a0f;
  box-shadow: 0 4px 12px rgba(255, 167, 81, 0.15);
}

.map-canvas-area {
  position: relative;
  width: 100%;
  height: 350px;
  background: #0d0f14;
  border: 1.5px solid rgba(255, 226, 89, 0.1);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.6);
  margin-bottom: 16px;
}

.oakland-svg-canvas {
  width: 100%;
  height: 100%;
}

/* Clickable Neighborhood Boundaries styling */
.oak-neighborhood-path {
  cursor: pointer;
  transition: var(--transition-smooth);
  fill: #151821;
}

.oak-neighborhood-path:hover {
  stroke: var(--gold-primary);
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 10px rgba(255, 226, 89, 0.3));
}

.oak-neighborhood-path.heat-view {
  stroke: rgba(255,255,255,0.15);
}

/* Safe Haven Pin Markers */
.map-pin-marker {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.map-pin-marker:hover {
  transform: scale(1.1);
}

.pin-ripple {
  animation: ripple-scale 2.2s infinite ease-out;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes ripple-scale {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Direction Line Overlay */
.route-line-overlay {
  animation: route-flow 2s infinite linear;
}

@keyframes route-flow {
  to {
    stroke-dashoffset: -20;
  }
}

/* Map Details Glass Card Overlay */
.map-info-panel-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: calc(100% - 24px);
  background: rgba(17, 19, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slide-in-fade 0.4s ease forwards;
}

.info-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.map-info-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.map-info-close-btn:hover {
  color: var(--gold-primary) !important;
  transform: scale(1.15);
}

.info-card-badge {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
}

.info-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.info-card-address {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.info-card-desc {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.info-card-actions {
  display: flex;
  gap: 10px;
}

.map-action-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.primary-gold-btn {
  background: var(--gold-gradient) !important;
  color: #090a0f !important;
  box-shadow: 0 4px 15px rgba(255, 167, 81, 0.2);
}

.primary-gold-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 167, 81, 0.35);
}

.advocacy-notice-box {
  background: rgba(255, 226, 89, 0.06);
  border: 1px solid rgba(255, 226, 89, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Legend Styling */
.map-legend-box {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.legend-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gold-pin-dot { background-color: var(--gold-primary); }
.pulse-ripple-dot { background-color: var(--gold-primary); opacity: 0.5; box-shadow: 0 0 0 3px rgba(255, 226, 89, 0.2); }
.red-dot { background-color: #F43F5E; }
.yellow-dot { background-color: #F97316; }
.green-dot { background-color: #2DD4BF; }

/* ==========================================
   BOTTOM NAVIGATION BAR MOCKUP
   ========================================== */
.app-nav-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 76px;
  background: rgba(17, 19, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 16px 10px 16px; /* Padding bottom for iPhone indicator spacing */
  z-index: 100;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  width: 60px;
}

.nav-icon {
  transition: var(--transition-smooth);
}

.nav-item span {
  font-size: 9px;
  font-weight: 600;
}

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

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(255, 167, 81, 0.1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 167, 81, 0.25);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slide-in-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   CUSTOM IN-APP TOAST SYSTEM
   ========================================== */
.app-toast {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: calc(100% - 48px);
  max-width: 350px;
  background: rgba(13, 15, 21, 0.95);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px rgba(255, 167, 81, 0.15);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

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

.toast-g-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  flex-shrink: 0;
}

/* ==========================================
   KAIDEN'S EMOJI CHECK-IN & COPING STYLES
   ========================================== */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  justify-content: center;
}

.emoji-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.emoji-btn .emoji {
  font-size: 26px;
  transition: var(--transition-smooth);
}

.emoji-btn .mood-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.emoji-btn:hover {
  background: rgba(255, 226, 89, 0.08);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 226, 89, 0.1);
}

.emoji-btn:hover .emoji {
  transform: scale(1.15);
}

.emoji-btn.active {
  background: rgba(255, 226, 89, 0.12) !important;
  border-color: var(--gold-primary) !important;
  box-shadow: 0 0 16px rgba(255, 226, 89, 0.18);
}

.emoji-btn.active .emoji {
  transform: scale(1.2) translateY(-2px);
}

.emoji-btn.active .mood-label {
  color: var(--gold-primary);
  font-weight: 800;
}

/* Dynamic Coping Tip Container */
.tip-container {
  background: linear-gradient(135deg, rgba(255, 226, 89, 0.06) 0%, rgba(0, 0, 0, 0.25) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slide-in-fade 0.4s ease forwards;
}

.tip-container.hidden {
  display: none !important;
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tip-message strong {
  color: var(--gold-primary);
}

/* Section Title Layout */
.section-title {
  font-size: 16px;
  font-weight: 800;
  margin-top: 14px;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 15px;
  background: var(--gold-gradient);
  border-radius: 3px;
}

/* History Log Items */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  animation: slide-in-fade 0.3s ease forwards;
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-item-emoji {
  font-size: 20px;
}

.history-item-mood {
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--text-primary);
}

.history-item-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Resource Link Button Hover States */
.resource-link-btn:hover {
  background: rgba(255, 226, 89, 0.08) !important;
  border-color: var(--gold-primary) !important;
  color: var(--gold-primary) !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(255, 226, 89, 0.08);
}

/* ==========================================
   COMMUNITY HUB & AI COMPANION (Phases 4 & 5)
   ========================================== */
.community-toggle-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 4px;
  gap: 4px;
}

.comm-toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.comm-toggle-btn:hover {
  color: var(--text-primary);
}

.comm-toggle-btn.active {
  background: rgba(255, 226, 89, 0.1);
  color: var(--gold-primary);
  border: 1px solid rgba(255, 226, 89, 0.15);
}

/* Forum Feed Styling */
.forum-card-post {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slide-in-fade 0.3s ease forwards;
}

.forum-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forum-post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.forum-post-user {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-secondary);
}

.forum-post-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-card-border);
  color: var(--text-muted);
}

.forum-post-time {
  font-size: 10px;
  color: var(--text-muted);
}

.forum-post-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Chat bubble styling */
.chat-bubble {
  align-self: flex-start;
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  font-size: 11.5px;
  line-height: 1.45;
  animation: slide-in-fade 0.2s ease forwards;
}

.chat-bubble.ai-msg {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--color-card-border);
  color: var(--text-secondary);
}

.chat-bubble.user-msg {
  align-self: flex-end;
  background: rgba(255, 226, 89, 0.1);
  border: 1.5px solid rgba(255, 226, 89, 0.15);
  color: var(--gold-primary);
  border-radius: 12px 12px 4px 12px;
}

.chat-bubble.crisis-msg {
  align-self: center;
  max-width: 100%;
  background: rgba(244, 63, 94, 0.1);
  border: 1.5px solid rgba(244, 63, 94, 0.25);
  color: #FDA4AF;
  border-radius: 12px;
  text-align: center;
}

/* ==========================================
   GOOGLE IDENTITY SERVICES & AUTH STYLES
   ========================================== */
.google-gis-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
}

.google-gis-container:hover {
  border-color: rgba(255, 226, 89, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.user-avatar-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 8px rgba(255, 226, 89, 0.3);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  padding: 10px 16px;
  background: #FFFFFF;
  color: #3C4043;
  border: 1px solid #DADCE0;
  border-radius: 4px;
  font-family: 'Roboto', 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 2px rgba(60,64,67,0.12);
}

.custom-google-btn:hover {
  background-color: #F8F9FA;
  box-shadow: 0 1px 3px rgba(60,64,67,0.2);
  border-color: #D2E3FC;
}

.custom-google-btn:active {
  background-color: #EEEEEE;
}

.google-svg-logo {
  flex-shrink: 0;
}




/* ==========================================
   MOBILE & CROSS-DEVICE RESPONSIVE ADAPTATIONS
   (iPhones, Androids, Dynamic Islands & Foldables)
   ========================================== */

/* Universal Safe Area & Viewport Resets */
html {
  height: -webkit-fill-available;
}

body {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding: 0;
  overflow-x: hidden;
}

/* 1. Mobile Phone Devices & Screen Viewports (<= 768px) */
@media screen and (max-width: 768px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .mobile-frame-container {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    height: -webkit-fill-available;
    max-height: 100dvh;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* Hide simulated status bar and notch when on actual mobile hardware */
  .phone-notch,
  .phone-status-bar {
    display: none !important;
  }

  /* Top Header with iOS Dynamic Island / Notch Inset Padding */
  .app-top-header {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    height: calc(56px + max(10px, env(safe-area-inset-top)));
  }

  /* Onboarding Overlay with Native Top/Bottom Insets */
  .onboarding-overlay {
    top: 0;
    height: 100dvh;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  /* Scrollable Area Content Padding Adjustment */
  .phone-content-area {
    height: 100dvh;
  }

  .app-scrollable-content {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: calc(76px + max(16px, env(safe-area-inset-bottom)));
  }

  /* Bottom Navigation Bar with Home Indicator Spacing */
  .app-nav-bar {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    height: calc(60px + max(12px, env(safe-area-inset-bottom)));
  }
}

/* 2. Compact / Small Screen Phones (iPhone SE, iPhone 8, iPhone 12/13 Mini, <= 380px) */
@media screen and (max-width: 380px) {
  .welcome-banner {
    padding: 20px 14px 18px 14px;
  }

  .banner-title {
    font-size: 22px;
  }

  .banner-subtitle {
    font-size: 12px;
  }

  .brand-header {
    margin-bottom: 12px;
  }

  .mode-card-btn {
    padding: 12px;
  }

  .mode-card-text h3 {
    font-size: 13px;
  }

  .mode-card-text p {
    font-size: 11px;
  }

  /* Responsive Grids for Resource & Forum Cards */
  .resource-grid,
  .forum-feed-grid,
  .quick-access-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .quiz-checkcard {
    padding: 12px;
  }

  .chat-bubble {
    max-width: 90% !important;
    font-size: 13px !important;
  }

  .pin-pad-grid {
    gap: 8px !important;
  }

  .pin-key {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
  }
}

/* 3. Medium & Large Pro Phones (iPhone 12/13/14/15/16 Pro & Pro Max, 381px - 430px) */
@media screen and (min-width: 381px) and (max-width: 430px) {
  .welcome-banner {
    padding: 24px 18px 22px 18px;
  }

  .app-scrollable-content {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* 4. Touch Sizing & Tap Targets according to Mobile HIG */
button,
a,
.nav-item,
.mode-card-btn,
.forum-card,
.checkcard-item {
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}



