/* --- DESIGN SYSTEM & COLOR VARIABLES --- */
:root {
  /* Fonts */
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Global Accent Colors */
  --primary: #8b5cf6; /* Rich Violet */
  --primary-hover: #7c3aed;
  --primary-light: rgba(139, 92, 246, 0.15);
  
  --success: #10b981; /* Emerald Green */
  --success-light: rgba(16, 185, 129, 0.15);
  
  --warning: #f59e0b; /* Amber */
  --warning-light: rgba(245, 158, 11, 0.15);
  
  --danger: #ef4444; /* Rose */
  --danger-hover: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.15);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.18);
  
  --theme-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* --- THEME CUSTOM PROPERTIES (LIGHT DEFAULT) --- */
:root {
  --bg-app: #f5f3ff;
  --bg-gradient: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  --bg-panel: rgba(255, 255, 255, 0.7);
  --bg-card: #ffffff;
  --bg-input: #f3f4f6;
  --text-main: #111827; 
  --text-muted: #4b5563; 
  --border-color: rgba(0, 0, 0, 0.12);
  --border-focus: rgba(139, 92, 246, 0.4);
  --glass-blur: blur(24px);
  --header-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  --card-hover-border: rgba(139, 92, 246, 0.2);
  --neon-glow: 0 0 10px rgba(139, 92, 246, 0.1);
}

/* --- DARK THEME --- */
[data-theme="dark"] {
  --bg-app: #0f172a; /* Slate 900 */
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --bg-panel: rgba(15, 23, 42, 0.7);
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-input: rgba(15, 23, 42, 0.8);
  --text-main: #f8fafc; /* Slate 50 */
  --text-muted: #94a3b8; /* Slate 400 */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(139, 92, 246, 0.6);
  --header-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --card-hover-border: rgba(139, 92, 246, 0.4);
  --neon-glow: 0 0 15px rgba(139, 92, 246, 0.2);
}

/* --- RESET & BASIC SETUP --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-app);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  transition: var(--theme-transition);
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

/* App Outer Shell */
.app-layout {
  width: 100%;
  max-width: 1000px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 80px; /* space for navigation */
}

/* --- TOP HEADER BAR --- */
.app-header {
  height: 70px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--header-shadow);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 26px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.logo-area h1 {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

/* Streak flame badge */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--warning-light);
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  cursor: default;
  transition: transform 0.2s ease;
}
.streak-badge:hover {
  transform: scale(1.05);
}

.icon-flame {
  font-size: 18px;
  animation: flicker 2s infinite alternate;
}

@keyframes flicker {
  0% { transform: scale(0.95); filter: drop-shadow(0 0 1px var(--warning)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 5px var(--warning)); }
}

/* --- BOTTOM/DESKTOP NAVIGATION --- */
.app-navigation {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 75px;
  background: var(--bg-panel);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px 10px 10px;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  max-width: 65px;
  flex: 1;
  border-radius: var(--radius-lg);
  padding: 10px 0 6px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
  transition: width 0.3s ease;
  opacity: 0;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item span {
  font-size: 26px;
  margin-bottom: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item .nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.8;
}

.nav-item:hover {
  color: var(--text-main);
}

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

.nav-item.active::before {
  width: 30px;
  opacity: 1;
  box-shadow: 0 2px 8px var(--primary);
}

.nav-item.active span {
  transform: translateY(-3px);
  font-variation-settings: 'FILL' 1;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6));
}

@media(min-width: 769px) {
  .app-navigation {
    position: sticky;
    top: 70px;
    bottom: auto;
    height: 60px;
    border-top: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
    background: var(--bg-app); /* Solid bg for desktop nav to prevent text overlap when sticky */
    padding: 0 24px;
    margin-bottom: 0;
    order: 1; /* Place it between header (order 0) and main content (order 2) */
    z-index: 90;
    justify-content: flex-start; /* Align nav items to the left on desktop */
    gap: 16px;
  }
  .app-header {
    order: 0;
  }
  .app-main-content {
    order: 2;
  }
  .app-layout {
    padding-bottom: 24px;
  }
  .nav-item {
    flex-direction: row;
    max-width: none;
    flex: 0 1 auto;
    gap: 8px;
    padding: 10px 20px;
  }
}

/* --- MAIN CONTENT & PAGES --- */
.app-main-content {
  flex: 1;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
}

.app-page {
  display: none;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  flex-direction: column;
  gap: 32px;
}

.app-page.active {
  display: flex;
}

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

/* Page Headers */
.page-header {
  margin-bottom: 4px;
}
.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.page-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* --- REUSABLE GLASS PANEL --- */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 20px 0;
}

/* --- HERO CARD (MY DAILY WALK) --- */
.walk-hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(20, 18, 33, 0.7) 100%);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: var(--neon-glow);
}

@media(min-width: 768px) {
  .walk-hero-card {
    flex-direction: row;
    align-items: center;
  }
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-illustration-icon {
  font-size: 40px;
  color: var(--primary);
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
}

.hero-text-content h3 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
}

.hero-quote {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.hero-right {
  display: flex;
  align-items: center;
}

/* Custom Checkbox card */
.daily-check-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  width: 100%;
}

.custom-checkbox-container {
  display: block;
  position: relative;
  width: 26px;
  height: 26px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0; width: 0;
}

.checkbox-checkmark {
  position: absolute;
  top: 0; left: 0;
  height: 26px; width: 26px;
  background-color: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.custom-checkbox-container:hover input ~ .checkbox-checkmark {
  border-color: var(--primary);
}

.custom-checkbox-container input:checked ~ .checkbox-checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.custom-checkbox-container input:checked ~ .checkbox-checkmark:after {
  display: block;
}

.custom-checkbox-container .checkbox-checkmark:after {
  left: 8px; top: 3px;
  width: 6px; height: 12px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.check-info h4 {
  font-size: 13px;
  font-weight: 600;
}
.check-info p {
  font-size: 10px;
  color: var(--text-muted);
}

/* --- FRUITAGE CHECKIN FORM --- */
.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.dashboard-section-header h3 {
  font-family: var(--font-title);
  font-size: 18px;
}

.fruitage-checkin-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-description {
  font-size: 13px;
  color: var(--text-muted);
}

.sliders-grid {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 12px;
  margin-top: 16px;
  scroll-snap-type: x mandatory;
}

.slider-item {
  flex: 0 0 240px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.slider-item:hover {
  transform: translateY(-2px);
  border-color: var(--card-hover-border);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
}

.slider-value {
  background: var(--bg-input);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

/* Range sliders styling */
.fruitage-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  outline: none;
}

.fruitage-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.fruitage-slider::-webkit-slider-thumb:active {
  transform: scale(1.3);
}

/* Slide Thumbs colors */
.slider-love::-webkit-slider-thumb { background: #ec4899; box-shadow: 0 0 8px rgba(236, 72, 153, 0.6); }
.slider-joy::-webkit-slider-thumb { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.6); }
.slider-peace::-webkit-slider-thumb { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); }
.slider-patience::-webkit-slider-thumb { background: #f97316; box-shadow: 0 0 8px rgba(249, 115, 22, 0.6); }
.slider-kindness::-webkit-slider-thumb { background: #06b6d4; box-shadow: 0 0 8px rgba(6, 182, 212, 0.6); }
.slider-goodness::-webkit-slider-thumb { background: #a855f7; box-shadow: 0 0 8px rgba(168, 85, 247, 0.6); }
.slider-faith::-webkit-slider-thumb { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.slider-mildness::-webkit-slider-thumb { background: #84cc16; box-shadow: 0 0 8px rgba(132, 204, 22, 0.6); }
.slider-selfcontrol::-webkit-slider-thumb { background: #6366f1; box-shadow: 0 0 8px rgba(99, 102, 241, 0.6); }

.form-actions-right {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* --- BUTTONS --- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #9333ea 100%);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-secondary:hover {
  border-color: var(--border-focus);
  background: var(--bg-panel);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #f43f5e 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-hover) 0%, #e11d48 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.icon-btn:active {
  transform: scale(0.9);
}
.icon-btn:hover {
  color: var(--text-main);
  background: var(--border-color);
}

/* --- STORYBOARD TIMELINE JOURNAL --- */
.storyboard-layout {
  display: flex;
  flex-direction: column;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--border-color);
  margin-left: 10px;
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-card:hover {
  transform: translateX(4px);
  border-color: var(--card-hover-border);
}

.timeline-card:before {
  content: "";
  position: absolute;
  left: -27px; top: 22px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-app);
  box-shadow: 0 0 5px rgba(139, 92, 246, 0.5);
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.timeline-card-title h3 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
}

.timeline-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.timeline-card-body {
  font-size: 13px;
  line-height: 1.6;
}

.timeline-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.badge-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}
.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning);
}
.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.timeline-scripture {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- GAMES LAYOUT AND WORD SCRAMBLE --- */
.games-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media(min-width: 768px) {
  .games-layout {
    grid-template-columns: 1fr 360px;
  }
}

.game-play-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-header-row-flex {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}

@media(min-width: 600px) {
  .game-header-row-flex {
    flex-direction: row;
    align-items: center;
  }
}

.game-header h3 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}
.game-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.verse-selector-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.verse-selector-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.scramble-dropdown {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.scramble-game-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scramble-verse-prompt {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--primary);
  font-size: 18px;
}

.scramble-verse-hint {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

.drop-zone {
  min-height: 80px;
  background: var(--bg-input);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  position: relative;
}

.drop-placeholder {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
}

.words-pile {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.word-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.word-pill:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.word-pill.selected {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

.game-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.games-showcase-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.showcase-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-showcase-icon {
  font-size: 32px;
  color: var(--warning);
}

.showcase-card h4 {
  font-family: var(--font-title);
  font-size: 16px;
}
.showcase-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- 3D FLASHCARD STYLING --- */
.flashcard-scene {
  width: 100%;
  height: 180px;
  perspective: 600px;
  cursor: pointer;
  user-select: none;
}

.flashcard-card {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* Triggered via JS class toggle */
.flashcard-card.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.flashcard-front {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.05) 100%);
  color: var(--text-main);
}

.flashcard-back {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: var(--text-main);
  transform: rotateY(180deg);
  border-color: rgba(16, 185, 129, 0.3);
}

.flashcard-badge-icon {
  font-size: 26px;
  color: var(--primary);
}

.card-scenario-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-reply-text {
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
}

.flip-tip {
  align-self: flex-end;
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.flip-tip:after {
  content: " 🔄";
}

/* --- FAMILY WORSHIP GENERATOR STYLING --- */
.worship-generator-display {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.worship-generator-display.generated {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.02);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.worship-star {
  font-size: 24px;
  color: var(--warning);
  animation: pulse 2s infinite;
}

#worshipIdeaText {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

/* --- MY FRIENDS CIRCLE SOCIAL PAGE --- */
.circle-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media(min-width: 768px) {
  .circle-layout {
    grid-template-columns: 1fr 340px;
  }
}

.circle-panel h3 {
  font-family: var(--font-title);
  font-size: 18px;
  margin-bottom: 16px;
}

.circle-members-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.circle-member-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: visible; /* To allow floating emojis to exit card boundaries */
}

.member-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  font-size: 32px;
  color: var(--primary);
  background: var(--primary-light);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-self {
  color: var(--success);
  background: var(--success-light);
}

.member-info h4 {
  font-size: 14px;
  font-weight: 600;
}
.member-info p {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.streak-mini {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.encourage-btn {
  color: var(--text-muted);
}
.encourage-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}

.empty-slot-card {
  border: 2px dashed var(--border-color);
  background: transparent;
}

.avatar-empty {
  font-size: 32px;
  color: var(--text-muted);
}

.circle-encouragement h3 {
  font-family: var(--font-title);
  font-size: 18px;
  margin-bottom: 12px;
}

.combined-goals-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.combined-goal-card h4 {
  font-size: 12px;
  font-weight: 600;
}

.goal-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-progress-bar {
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.circle-activity-feed h4 {
  font-family: var(--font-title);
  font-size: 14px;
  margin-bottom: 8px;
}

.activity-feed-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.activity-feed-list li {
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.activity-feed-list li:before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
  position: absolute;
  left: 0; top: 0;
}

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

/* --- SETTINGS CARD --- */
.app-about-text {
  font-size: 13px;
  line-height: 1.6;
}

/* --- VICTORY MODAL SPECIAL EFFECTS --- */
.victory-card-glow {
  border: 1px solid var(--primary);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.victory-star-icon {
  font-size: 64px;
  color: var(--warning);
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
  animation: bounceScale 2s infinite ease-in-out;
}

@keyframes bounceScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.victory-points-badge {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: var(--radius-md);
  margin: 10px 0;
  letter-spacing: 0.5px;
}

/* --- FLOATING EMOJI ANIMATION --- */
.floating-emoji {
  position: absolute;
  pointer-events: none;
  font-size: 24px;
  z-index: 99;
  animation: floatUp 1s cubic-bezier(0.25, 1, 0.50, 1) forwards;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    transform: translateY(-80px) scale(0.8);
    opacity: 0;
  }
}

/* --- CONFIG & MISC UTILS --- */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.hidden {
  display: none !important;
}

/* --- OVERLAY MODALS FIX --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 7, 13, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  overflow-y: auto;
}

.modal-container {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

/* --- GAMES DASHBOARD HOVER & SHADOW EFFECTS --- */
.game-dashboard-card {
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.04);
}
.game-dashboard-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.12);
  border-color: var(--primary) !important;
}

.active-filter {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.launch-game-btn:active {
  transform: scale(0.95);
}

/* --- STUDY PROMPT CARD --- */
.study-prompt-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prompt-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-input);
  padding: 2px;
  border-radius: var(--radius-sm);
}
.prompt-tab {
  flex: 1;
  font-size: 10px;
  padding: 6px;
  text-align: center;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-weight: 700;
}
.prompt-tab.active {
  background: var(--primary);
  color: #ffffff;
}

/* --- OFFLINE LANDMARK TERRITORY --- */
.territory-info-card {
  border-left: 4px solid var(--warning);
}
.house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.house-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.house-block:hover {
  transform: translateY(-2px);
}
.house-block.unvisited { border-color: var(--border-color); background: var(--bg-card); }
.house-block.not-at-home { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); color: #b45309; }
.house-block.return-visit { border-color: #10b981; background: rgba(16, 185, 129, 0.08); color: #047857; }
.house-block.do-not-call { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); color: #b91c1c; }

/* --- PIPELINE MOCK (MEMORIAL HUB) --- */
.pipeline-container {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pipeline-step {
  flex: 1;
  min-width: 80px;
  padding: 8px;
  text-align: center;
  font-size: 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.pipeline-step.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* --- ASSEMBLY TALKS --- */
.talk-note-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.talk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}
.talk-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.talk-input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
}

/* --- THEME / TOGGLE SWITCH --- */
.theme-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color);
  transition: .4s;
  border-radius: 34px;
}
.theme-toggle .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.theme-toggle input:checked + .slider {
  background-color: var(--success);
}
.theme-toggle input:checked + .slider:before {
  transform: translateX(22px);
}


/* --- SPIRITUAL TREE OF FRUITAGE --- */
.spiritual-tree-panel {
  background: linear-gradient(to top, rgba(16, 185, 129, 0.12), rgba(139, 92, 246, 0.04) 70%, transparent);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.tree-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.tree-panel-title { font-family: var(--font-title); font-size: 16px; font-weight: 700; color: var(--text-main); margin: 0; }
.tree-panel-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; line-height: 1.4; }
.tree-stage-badge {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 5px 10px; border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15); color: #10b981;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.tree-stage-badge .material-symbols-rounded { font-size: 16px; }
.tree-stage-wrap { position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
.tree-canvas { width: 100%; }
.tree-canvas svg { width: 100%; height: auto; display: block; overflow: visible; }
.tree-canopy { transform-box: fill-box; transform-origin: 50% 92%; animation: treeSway 6.5s ease-in-out infinite; }
@keyframes treeSway { 0%, 100% { transform: rotate(-1.3deg); } 50% { transform: rotate(1.3deg); } }
.tree-fruit { transform-box: fill-box; transform-origin: center; animation: treeFruitPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; cursor: pointer; }
@keyframes treeFruitPop { 0% { transform: scale(0); } 70% { transform: scale(1.28); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .tree-canopy { animation: none; } .tree-fruit { animation-duration: 0.01s; } }

/* --- Territory Workspace --- */
.territory-chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: var(--radius-full);
  background: var(--bg-input); border: 1px solid var(--border-color);
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.18s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.territory-chip:hover { color: var(--text-main); }
.territory-chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.territory-chip .chip-count { font-size: 11px; opacity: 0.8; font-weight: 600; }
.territory-filter-chip {
  flex-shrink: 0; padding: 6px 12px; border-radius: var(--radius-full);
  background: transparent; border: 1px solid var(--border-color);
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.15s ease;
}
.territory-filter-chip.active { background: var(--text-main); border-color: var(--text-main); color: var(--bg-card); }
.territory-house-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-left: 4px solid var(--border-color); border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: houseCardIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.territory-house-card:hover { transform: translateX(3px); box-shadow: var(--shadow-md); }
.territory-house-card:active { transform: scale(0.99); }
@keyframes houseCardIn { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
.territory-house-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.territory-house-icon .material-symbols-rounded { font-size: 22px; }
.territory-house-main { flex: 1; min-width: 0; }
.territory-house-addr { font-size: 14px; font-weight: 700; color: var(--text-main); word-break: break-word; }
.territory-house-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.territory-house-status { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; }
.territory-empty {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.territory-empty .material-symbols-rounded { font-size: 56px; color: var(--border-color); }

/* --- Photo Booth --- */
.photo-frame-chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: var(--radius-full);
  background: var(--bg-input); border: 1px solid var(--border-color);
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.15s ease;
}
.photo-frame-chip.active { background: #f43f5e; border-color: #f43f5e; color: #fff; box-shadow: 0 4px 12px rgba(244,63,94,0.3); }
