/* ==========================================================================
   DROMER - Celestial Design System & Stylesheet
   Gids voor Rust, Dromen en Reflectie
   ========================================================================== */

:root {
  /* Color Palette */
  --space-bg: #070913;
  --space-deep: #0a0d20;
  --space-surface: rgba(18, 22, 46, 0.65);
  --space-surface-hover: rgba(28, 34, 70, 0.75);
  --space-surface-active: rgba(38, 46, 94, 0.85);
  --space-border: rgba(196, 181, 253, 0.16);
  --space-border-glow: rgba(253, 230, 138, 0.35);

  /* Celestial Glows */
  --moon-gold: #fef08a;
  --moon-glow: rgba(254, 240, 138, 0.25);
  --starlight: #e0e7ff;
  --nebula-violet: #a855f7;
  --nebula-lavender: #c4b5fd;
  --nebula-cyan: #38bdf8;
  --aurora-emerald: #34d399;

  /* Typography Colors */
  --text-pure: #ffffff;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Transitions & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --shadow-celestial: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.15);
  --shadow-glow: 0 0 35px rgba(196, 181, 253, 0.25);
  --shadow-moon: 0 0 40px rgba(254, 240, 138, 0.3);

  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--space-bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   Cosmic Splash / Loading Screen (App Intro with Brand Logo)
   ========================================================================== */
.app-splash-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  background: radial-gradient(circle at center, #161b3d 0%, #0a0e24 55%, #050713 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s ease, visibility 0.8s;
  pointer-events: auto;
}

.app-splash-screen.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  visibility: hidden;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  max-width: 360px;
  animation: splashContentIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashContentIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.splash-logo-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-halo {
  position: absolute;
  inset: -12px;
  border-radius: 36px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(254, 240, 138, 0.25) 50%, transparent 75%);
  filter: blur(12px);
  animation: splashHaloPulse 3s ease-in-out infinite;
}

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

.splash-logo-img {
  width: 130px;
  height: 130px;
  border-radius: 28px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 35px rgba(168, 85, 247, 0.4);
  border: 2px solid rgba(254, 240, 138, 0.4);
  animation: splashLogoFloat 4s ease-in-out infinite;
}

@keyframes splashLogoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.splash-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--moon-gold);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(254, 240, 138, 0.35);
}

.splash-sparkle {
  color: var(--nebula-cyan);
}

.splash-subtitle {
  font-size: 0.95rem;
  color: var(--nebula-lavender);
  opacity: 0.9;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}

.splash-loader-bar {
  width: 170px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.splash-loader-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #38bdf8, #fef08a);
  border-radius: 4px;
  animation: splashProgress 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashProgress {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(-20%);
  }
  100% {
    transform: translateX(0%);
  }
}

.splash-status-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 0.4px;
}

/* Cosmic Canvas Background */
#cosmic-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* Main Layout Wrapper */
.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 24px 36px 24px;
  gap: 20px;
}

/* Glassmorphism Panel Component */
.glass-panel {
  background: var(--space-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-celestial);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(14, 18, 38, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-lg);
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-ring {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--nebula-lavender);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
  position: relative;
  z-index: 2;
}

.pulsing-halo {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.6) 0%, transparent 70%);
  animation: pulse-halo 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse-halo {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-pure);
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ffffff 40%, var(--moon-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sparkle-icon {
  font-size: 1.1rem;
  -webkit-text-fill-color: initial;
  animation: sparkle-twinkle 2.5s infinite;
}

@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0.7; transform: rotate(0deg) scale(1); }
  50% { opacity: 1; transform: rotate(15deg) scale(1.15); }
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--nebula-lavender);
  font-weight: 300;
  letter-spacing: 0.3px;
}

/* Moon Widget */
.moon-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(25, 30, 60, 0.5);
  border: 1px solid rgba(254, 240, 138, 0.2);
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px rgba(254, 240, 138, 0.1);
  transition: all var(--transition-normal);
  cursor: default;
}

.moon-widget:hover {
  background: rgba(35, 42, 85, 0.65);
  border-color: rgba(254, 240, 138, 0.4);
  box-shadow: 0 0 25px rgba(254, 240, 138, 0.2);
}

.moon-symbol {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(254, 240, 138, 0.6));
}

.moon-info {
  display: flex;
  flex-direction: column;
}

.moon-phase-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--moon-gold);
}

.moon-details {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Header Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  background: rgba(30, 36, 75, 0.6);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-full);
  color: var(--text-main);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--space-surface-hover);
  border-color: var(--nebula-lavender);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.nav-bar {
  display: flex;
  align-items: center;
  background: rgba(14, 18, 40, 0.8);
  backdrop-filter: blur(16px);
  padding: 6px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--space-border);
  gap: 6px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.nav-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-normal);
  position: relative;
}

.nav-tab:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: var(--text-pure);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(56, 189, 248, 0.25) 100%);
  border: 1px solid rgba(196, 181, 253, 0.35);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.25);
}

.tab-badge {
  background: rgba(254, 240, 138, 0.2);
  color: var(--moon-gold);
  border: 1px solid rgba(254, 240, 138, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

/* ==========================================================================
   Tab Panes Common
   ========================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  animation: fadeInPane 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

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

.celestial-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--nebula-lavender);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

/* Buttons */
.btn-primary-action {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #38bdf8 100%);
  border: none;
  color: #ffffff;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(168, 85, 247, 0.6);
  filter: brightness(1.1);
}

.btn-secondary-action {
  background: rgba(30, 37, 75, 0.7);
  border: 1px solid var(--nebula-lavender);
  color: var(--text-main);
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary-action:hover {
  background: rgba(45, 55, 110, 0.8);
  box-shadow: 0 0 15px rgba(196, 181, 253, 0.3);
  transform: translateY(-1px);
}

.btn-subtle {
  background: transparent;
  border: 1px solid var(--space-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-subtle:hover {
  color: var(--text-pure);
  border-color: var(--nebula-lavender);
}

.btn-danger-subtle {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger-subtle:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

/* ==========================================================================
   TAB 1: Chat (De Kosmische Gids)
   ========================================================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px);
  min-height: 520px;
  position: relative;
  overflow: hidden;
}

/* Scrollable area containing both Intro and Messages */
.chat-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chat-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.chat-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(196, 181, 253, 0.2);
  border-radius: 4px;
}

.chat-intro-card {
  padding: 24px;
  background: linear-gradient(180deg, rgba(30, 36, 75, 0.4) 0%, rgba(18, 22, 46, 0.2) 100%);
  border-bottom: 1px solid var(--space-border);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

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

.btn-toggle-intro {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--nebula-lavender);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-toggle-intro:hover {
  background: rgba(168, 85, 247, 0.25);
  color: var(--text-pure);
  border-color: var(--nebula-lavender);
}

.chat-intro-card.collapsed {
  padding: 10px 18px;
  background: rgba(18, 22, 46, 0.4);
}

.chat-intro-card.collapsed .chat-intro-body {
  display: none;
}

.chat-intro-card.collapsed .chat-intro-header-row {
  margin-bottom: 0;
}

.chat-intro-body h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-pure);
  margin-bottom: 6px;
}

.intro-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--moon-gold);
  margin-bottom: 16px;
}

.quick-prompts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(196, 181, 253, 0.25);
  color: var(--text-main);
  padding: 7px 15px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-chip:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--nebula-lavender);
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

/* Chat Messages Area */
.chat-messages {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.message-row {
  display: flex;
  gap: 14px;
  max-width: 85%;
  animation: messageSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.message-row.dromer,
.message-row.moonchi {
  align-self: flex-start;
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--nebula-lavender);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
  flex-shrink: 0;
}

.user-avatar-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.msg-bubble {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  line-height: 1.65;
  font-size: 0.98rem;
  position: relative;
  word-break: break-word;
}

.message-row.dromer .msg-bubble,
.message-row.moonchi .msg-bubble {
  background: rgba(25, 30, 64, 0.7);
  border: 1px solid var(--space-border);
  color: var(--text-main);
  border-top-left-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.message-row.user .msg-bubble {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.6) 0%, rgba(79, 70, 229, 0.7) 100%);
  border: 1px solid rgba(196, 181, 253, 0.3);
  color: #ffffff;
  border-top-right-radius: 4px;
}

.msg-bubble p {
  margin-bottom: 10px;
}
.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble .dromer-breakdown,
.msg-bubble .moonchi-breakdown {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(14, 18, 42, 0.6);
  border-left: 3px solid var(--moon-gold);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.msg-bubble .dromer-breakdown h4,
.msg-bubble .moonchi-breakdown h4 {
  color: var(--moon-gold);
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.msg-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  display: block;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 20px;
}
.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--nebula-lavender);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Chat Input Bar */
.chat-input-wrapper {
  padding: 16px 24px;
  border-top: 1px solid var(--space-border);
  background: rgba(14, 18, 40, 0.8);
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(22, 28, 60, 0.7);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  transition: all var(--transition-fast);
}

.chat-input-bar:focus-within {
  border-color: var(--nebula-lavender);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}

.btn-voice {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-upload-image {
  color: var(--nebula-lavender);
}

.btn-upload-image:hover {
  color: var(--moon-gold);
}

.btn-voice:hover {
  color: var(--moon-gold);
  transform: scale(1.1);
}

.btn-voice.recording {
  color: #ef4444;
  animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px #ef4444); }
  50% { transform: scale(1.2); filter: drop-shadow(0 0 10px #ef4444); }
}

/* Image Upload & Preview in Chat */
.image-preview-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  animation: fadeInPane 0.25s ease;
}

.image-preview-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(26, 32, 68, 0.85);
  border: 1px solid var(--space-border-glow);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 15px rgba(168, 85, 247, 0.2);
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-md);
}

.image-preview-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.image-preview-details {
  display: flex;
  flex-direction: column;
}

.image-preview-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-pure);
}

.image-preview-sub {
  font-size: 0.72rem;
  color: var(--nebula-lavender);
}

.btn-remove-image {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  margin-left: 6px;
}

.btn-remove-image:hover {
  background: rgba(239, 68, 68, 0.5);
  color: #ffffff;
  transform: scale(1.1);
}

.chat-bubble-image {
  max-width: 100%;
  max-height: 260px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  display: block;
  border: 1px solid rgba(196, 181, 253, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  object-fit: cover;
}

/* Recording Pulse for Voice Memo */
.recording-pulse {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  border-color: #ef4444 !important;
  animation: pulse-recording 1.2s infinite ease-in-out !important;
}

@keyframes pulse-recording {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

#chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-pure);
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  max-height: 120px;
  padding: 6px 4px;
}

#chat-textarea::placeholder {
  color: var(--text-dim);
}

.btn-send {
  background: linear-gradient(135deg, #7c3aed 0%, #38bdf8 100%);
  border: none;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.chat-footer-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
  padding-left: 12px;
}

.hint-dot {
  width: 6px;
  height: 6px;
  background: var(--aurora-emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--aurora-emerald);
}

/* ==========================================================================
   TAB 2: Dromendagboek
   ========================================================================== */
.journal-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  height: calc(100vh - 210px);
  min-height: 520px;
}

.journal-sidebar {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-pure);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.filter-group input {
  background: rgba(14, 18, 42, 0.6);
  border: 1px solid var(--space-border);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-pure);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.filter-group input:focus {
  border-color: var(--nebula-lavender);
}

.type-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-filter {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--space-border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-filter:hover {
  color: var(--text-main);
  border-color: var(--nebula-lavender);
}

.chip-filter.active {
  background: rgba(168, 85, 247, 0.25);
  border-color: var(--nebula-lavender);
  color: var(--text-pure);
  font-weight: 600;
}

.stats-card {
  background: rgba(14, 18, 42, 0.7);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.stats-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--nebula-lavender);
  margin-bottom: 12px;
  letter-spacing: 0.6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

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

.stat-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--moon-gold);
}

.stat-lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.sidebar-footer {
  margin-top: auto;
}

/* Journal Entries Area */
.journal-entries-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.entries-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--space-border);
  background: rgba(14, 18, 40, 0.6);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.entries-sort select {
  background: rgba(22, 28, 60, 0.8);
  border: 1px solid var(--space-border);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.entries-list {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.entries-list::-webkit-scrollbar {
  width: 6px;
}
.entries-list::-webkit-scrollbar-thumb {
  background: rgba(196, 181, 253, 0.2);
  border-radius: 4px;
}

/* Dream Entry Card */
.dream-card {
  background: rgba(20, 26, 56, 0.6);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dream-card:hover {
  background: rgba(26, 34, 72, 0.75);
  border-color: rgba(196, 181, 253, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

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

.dream-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dream-card-date {
  font-weight: 500;
}

.dream-type-tag {
  background: rgba(168, 85, 247, 0.2);
  color: var(--nebula-lavender);
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
}

.dream-mood-tag {
  background: rgba(254, 240, 138, 0.15);
  color: var(--moon-gold);
  border: 1px solid rgba(254, 240, 138, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.74rem;
}

.dream-card-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text-pure);
  font-weight: 600;
}

.dream-card-content {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.dream-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.symbol-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.dream-card-analysis {
  background: rgba(14, 18, 42, 0.7);
  border-left: 3px solid var(--nebula-lavender);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

.dream-card-analysis h5 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--moon-gold);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dream-card-analysis p {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.55;
}

.dream-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.btn-card-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn-card-action:hover {
  color: var(--moon-gold);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3.5rem;
  opacity: 0.8;
  filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.4));
}

/* ==========================================================================
   TAB 3: Nachtelijk Orakel
   ========================================================================== */
.oracle-container {
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
  min-height: 600px;
}

.oracle-header h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--text-pure);
  margin-bottom: 8px;
}

.oracle-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* 3D Card Scene & Flip */
.oracle-card-scene {
  perspective: 1200px;
  width: 320px;
  height: 480px;
  margin: 10px auto;
}

.oracle-card-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  border-radius: var(--radius-lg);
}

.oracle-card-wrapper.flipped {
  transform: rotateY(180deg);
}

.oracle-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  transform-style: preserve-3d;
}

.oracle-card-back, .oracle-card-front {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.2);
}

/* Card Back Design */
.oracle-card-back {
  background: linear-gradient(135deg, #131738 0%, #1f2554 50%, #0d1029 100%);
  border: 2px solid rgba(254, 240, 138, 0.35);
  align-items: center;
  justify-content: center;
}

.card-back-ornament {
  border: 1px solid rgba(254, 240, 138, 0.25);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
}

.card-back-moon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 15px rgba(254, 240, 138, 0.5));
  animation: floatMoon 4s ease-in-out infinite;
}

@keyframes floatMoon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.card-back-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  letter-spacing: 4px;
  color: var(--moon-gold);
  font-weight: 600;
}

.card-back-sub {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--nebula-lavender);
  margin-top: 4px;
}

.card-back-prompt {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card Front Design */
.oracle-card-front {
  background: linear-gradient(160deg, #1c224c 0%, #151a3d 60%, #0d1029 100%);
  border: 2px solid var(--space-border-glow);
  transform: rotateY(180deg);
  text-align: center;
  align-items: center;
  justify-content: space-between;
}

.card-front-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--nebula-lavender);
}

.card-front-symbol {
  font-size: 3.2rem;
  margin: 6px 0;
  filter: drop-shadow(0 0 15px rgba(254, 240, 138, 0.4));
}

.card-front-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--moon-gold);
  font-weight: 600;
}

.card-front-meaning {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-pure);
  line-height: 1.5;
  margin: 8px 0;
}

.card-front-practical {
  background: rgba(10, 14, 34, 0.6);
  border-left: 2px solid var(--aurora-emerald);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.45;
}

.card-front-affirmation {
  background: rgba(10, 14, 34, 0.6);
  border-left: 2px solid var(--moon-gold);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.45;
  margin-top: 6px;
}

.oracle-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   TAB 4: Rust, Soundscapes & Ademhaling
   ========================================================================== */
.relax-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.breath-card, .soundscape-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.breath-header h2, .soundscape-header h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-pure);
  margin-bottom: 6px;
}

.breath-header p, .soundscape-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Breath Circle Animation */
.breath-visualizer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  min-height: 280px;
}

.breath-circle {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(56, 189, 248, 0.15) 70%, transparent 100%);
  border: 2px solid var(--nebula-lavender);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease;
}

.breath-circle.inhale {
  transform: scale(1.55);
  border-color: var(--moon-gold);
  box-shadow: 0 0 50px rgba(254, 240, 138, 0.6);
  transition: transform 4s cubic-bezier(0.25, 1, 0.5, 1);
}

.breath-circle.hold {
  transform: scale(1.55);
  border-color: var(--aurora-emerald);
  box-shadow: 0 0 55px rgba(52, 211, 153, 0.6);
  transition: none;
}

.breath-circle.exhale {
  transform: scale(1);
  border-color: var(--nebula-cyan);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
  transition: transform 8s cubic-bezier(0.4, 0, 0.2, 1);
}

.breath-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.breath-instruction {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-pure);
  font-weight: 600;
}

.breath-countdown {
  font-size: 1.1rem;
  color: var(--moon-gold);
  font-weight: 700;
}

.breath-preset-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.breath-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--space-border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.breath-preset-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  color: var(--text-pure);
  border-color: var(--nebula-lavender);
}

.breath-preset-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(56, 189, 248, 0.25) 100%);
  border-color: var(--nebula-lavender);
  color: var(--text-pure);
  font-weight: 600;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.breath-haptic-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--nebula-lavender);
  background: rgba(168, 85, 247, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.breath-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.breath-phases-indicator {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.phase-pill {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: all var(--transition-fast);
}

.phase-pill.active {
  background: rgba(168, 85, 247, 0.3);
  border-color: var(--nebula-lavender);
  color: var(--text-pure);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

/* Soundscapes Multi-Track Mixer */
.sound-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sound-track-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(18, 24, 52, 0.6);
  border: 1px solid var(--space-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.sound-track-item:hover {
  background: rgba(28, 36, 75, 0.7);
  border-color: var(--nebula-lavender);
}

.sound-track-item.playing {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--nebula-lavender);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}

.track-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

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

.track-icon {
  font-size: 1.5rem;
}

.track-info h4 {
  font-size: 0.95rem;
  color: var(--text-pure);
  font-weight: 600;
}

.track-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.track-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--space-border);
  color: var(--text-pure);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.track-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 38px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.vol-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.track-volume-slider {
  flex: 1;
  height: 4px;
  accent-color: var(--nebula-cyan);
  cursor: pointer;
}

.track-vol-val {
  min-width: 34px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-main);
  font-weight: 500;
}

.timer-fade-hint {
  font-size: 0.76rem;
  color: var(--moon-gold);
  background: rgba(254, 240, 138, 0.1);
  border: 1px solid rgba(254, 240, 138, 0.2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.track-play-btn:hover {
  background: var(--nebula-lavender);
  color: var(--space-bg);
  transform: scale(1.08);
}

.sound-track-item.playing .track-play-btn {
  background: var(--moon-gold);
  color: var(--space-bg);
  box-shadow: 0 0 15px rgba(254, 240, 138, 0.6);
}

/* Master Volume & Timer */
.audio-master-controls {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--space-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.volume-slider-row, .timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.volume-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--nebula-lavender);
}

.timer-row select {
  background: rgba(22, 28, 60, 0.8);
  border: 1px solid var(--space-border);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.timer-badge {
  font-size: 0.78rem;
  color: var(--moon-gold);
  font-weight: 600;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeInModal 0.25s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: var(--radius-lg);
  animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--space-border);
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-title h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-pure);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.1);
}

/* Forms in Modals */
.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-voice-inline {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--nebula-lavender);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-voice-inline:hover {
  background: rgba(168, 85, 247, 0.3);
}

.form-group input, .form-group select, .form-group textarea {
  background: rgba(14, 18, 42, 0.7);
  border: 1px solid var(--space-border);
  color: var(--text-pure);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--nebula-lavender);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.field-hint a {
  color: var(--nebula-lavender);
  text-decoration: underline;
}

.form-actions, .modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--space-border);
}

/* Settings Specific */
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.settings-section h4 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--moon-gold);
  margin-bottom: 8px;
}

.settings-help {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
}

.settings-btn-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(22, 28, 64, 0.9);
  border: 1px solid var(--nebula-lavender);
  backdrop-filter: blur(12px);
  color: var(--text-pure);
  padding: 12px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.3);
  font-size: 0.9rem;
  display: none;
  z-index: 200;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  display: block;
}

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

/* ==========================================================================
   Voeding & Vitaliteit Module (Nutrition, Food Vision & Barcode Scanner)
   ========================================================================== */
.nutrition-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px;
}

.nutrition-container .section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--moon-gold);
  margin-top: 8px;
  margin-bottom: 6px;
}

.nutrition-container .section-header p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.nutrition-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.action-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  color: #fff;
  backdrop-filter: blur(8px);
}

.action-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(212, 175, 55, 0.5); /* subtiel goud */
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.action-card .icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.action-card strong {
  font-size: 1.05rem;
  color: var(--text-pure);
  margin-bottom: 4px;
}

.action-card small {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.result-card, .daily-rhythm-card {
  background: rgba(22, 27, 46, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

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

.result-header h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--moon-gold);
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.macro-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.macro-item span {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f1e7d0;
}

.macro-item label {
  font-size: 0.75rem;
  opacity: 0.7;
  color: var(--text-muted);
}

.mood-boost-box, .portion-box {
  background: rgba(142, 120, 227, 0.08);
  border-left: 3px solid #b69eff;
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.mood-boost-box h4, .portion-box h4 {
  font-size: 0.95rem;
  color: var(--nebula-lavender);
  margin-bottom: 6px;
  font-weight: 600;
}

.mood-boost-box p, .portion-box p {
  font-size: 0.9rem;
  color: var(--text-pure);
  line-height: 1.55;
}

.daily-rhythm-card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--moon-gold);
  margin-bottom: 4px;
}

.daily-rhythm-card .subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.timeline-meals {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meal-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
  transition: all var(--transition-fast);
}

.meal-slot:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.slot-time {
  font-family: monospace;
  font-size: 0.85rem;
  opacity: 0.75;
  min-width: 95px;
  color: var(--nebula-cyan);
}

.slot-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slot-content strong {
  font-size: 0.92rem;
  color: var(--text-pure);
}

.slot-content span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.check-meal-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.check-meal-btn:hover {
  transform: scale(1.08);
}

.check-meal-btn.completed {
  background: #3ecf8e;
  border-color: #3ecf8e;
  color: #0b1021;
  box-shadow: 0 0 12px rgba(62, 207, 142, 0.4);
}

/* Barcode Scanner Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(6px);
}

.modal-window {
  width: 90%;
  max-width: 480px;
  background: #11162b;
  border: 1px solid var(--space-border-glow);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(168, 85, 247, 0.2);
}

.modal-window .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-window .modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--moon-gold);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text-pure);
}

.scanner-viewport {
  position: relative;
  width: 100%;
  height: 280px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

#barcode-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-laser-line {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 2px;
  background: #ff5252;
  box-shadow: 0 0 10px #ff5252;
  animation: laserScan 2s infinite ease-in-out;
}

.scanner-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 14px;
}

@keyframes laserScan {
  0%, 100% { transform: translateY(-90px); }
  50% { transform: translateY(90px); }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
  .journal-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .relax-grid {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-wrap: wrap;
    padding: 12px 18px;
  }
  .moon-widget {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .chat-container {
    height: calc(100vh - 240px);
    height: calc(100dvh - 240px);
    min-height: 480px;
  }
}

@media (max-width: 640px) {
  .app-layout {
    padding: 10px 10px 18px 10px;
    gap: 12px;
  }
  .app-header {
    padding: 10px 14px;
    gap: 10px;
  }
  .header-brand {
    gap: 10px;
  }
  .header-avatar {
    width: 40px;
    height: 40px;
  }
  .avatar-ring {
    width: 44px;
    height: 44px;
  }
  .brand-title {
    font-size: 1.4rem;
  }
  .brand-subtitle {
    font-size: 0.78rem;
  }
  .nav-tab .tab-label {
    display: none;
  }
  .nav-tab {
    padding: 10px;
    font-size: 1.2rem;
  }
  .form-row {
    flex-direction: column;
  }
  .oracle-card-scene {
    width: 280px;
    height: 440px;
  }

  /* Chat Mobile Specifics - Prevents banner sticking & restores visibility */
  .chat-container {
    height: calc(100vh - 180px);
    height: calc(100dvh - 180px);
    min-height: 0;
    border-radius: var(--radius-md);
  }

  .chat-intro-card {
    padding: 12px 14px;
  }

  .chat-intro-card.collapsed {
    padding: 8px 12px;
  }

  .chat-intro-body h2 {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .intro-quote {
    font-size: 0.88rem;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .quick-prompts-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .quick-prompts-row::-webkit-scrollbar {
    display: none;
  }

  .quick-chip {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 6px 12px;
    flex-shrink: 0;
  }

  .chat-messages {
    padding: 12px 10px;
    gap: 12px;
  }

  .message-row {
    max-width: 95%;
    gap: 10px;
  }

  .msg-avatar, .user-avatar-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .msg-bubble {
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .chat-input-wrapper {
    padding: 10px 12px;
  }

  .chat-input-bar {
    gap: 8px;
    padding: 4px 8px;
  }

  #chat-textarea {
    font-size: 0.9rem;
    padding: 6px 4px;
  }

  .btn-send {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .btn-voice {
    padding: 4px;
    font-size: 1.1rem;
  }

  .chat-footer-hint {
    font-size: 0.68rem;
    margin-top: 4px;
    padding-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Nutrition Mobile */
  .nutrition-container {
    padding: 12px 10px;
    gap: 16px;
  }
  .macro-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .nutrition-actions-grid {
    grid-template-columns: 1fr;
  }
  .meal-slot {
    padding: 12px 10px;
    gap: 8px;
  }
  .slot-time {
    min-width: 75px;
    font-size: 0.78rem;
  }
}
