/* ============================================================
   Mindful Suite – Component Styles
   Shared UI components across all mini-apps
   ============================================================ */

/* ── App Shell ────────────────────────────────────────── */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── Ambient Background Glow ──────────────────────────── */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--g-glow);
}

/* ── Top Navigation ───────────────────────────────────── */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--c-bg) 0%, transparent 100%);
}

.nav-home {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--c-text-soft);
  opacity: 0.7;
  transition: opacity 0.3s;
}

.nav-home:hover {
  opacity: 1;
}

.nav-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--c-text-soft);
  text-align: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Icon Button ──────────────────────────────────────── */
.btn-icon {
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--c-text-soft);
  font-size: 1rem;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--c-glow);
  border-color: var(--c-accent);
  color: var(--c-accent-2);
}

/* ── Primary Button ──────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2.2rem;
  background: var(--g-accent);
  color: #fff;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
  min-width: 13rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--c-glow);
}

.btn-primary:active {
  transform: translateY(-1px);
}

/* ── Ghost Button ────────────────────────────────────── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  border: 1.5px solid var(--c-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--c-text-soft);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--c-accent);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

/* ── Card ────────────────────────────────────────────── */
.card {
  background: var(--g-card);
  border: 1px solid var(--c-border);
  border-radius: 1rem;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--c-glow-soft);
  pointer-events: none;
}

/* ── Session Container ───────────────────────────────── */
.session-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
  position: relative;
  z-index: 1;
  text-align: center;
  gap: 2rem;
}

/* ── Theme Picker In Settings ────────────────────────── */
.theme-selection {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.theme-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  background: var(--c-surface-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-dot:hover {
  transform: scale(1.15);
}

.theme-dot.active {
  border-color: var(--c-accent);
  transform: scale(1.1);
}

.theme-dot[data-theme="nachtblau"] {
  background: #090d18;
}

.theme-dot[data-theme="nebel"] {
  background: #0f172a;
}

.theme-dot[data-theme="waldmoos"] {
  background: #052c22;
}

.theme-dot[data-theme="lavendel"] {
  background: #1e1b4b;
}

.theme-dot[data-theme="tiefsee"] {
  background: #083344;
}

/* ── Settings & Stats Panels ────────────────────────── */
.settings-panel,
.stats-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--m-ease-soft);
}

.settings-panel.open,
.stats-panel.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-backdrop,
.stats-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.settings-sheet,
.stats-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 2rem 2rem 0 0;
  padding: 2.5rem 2rem 4rem;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-panel.open .settings-sheet,
.stats-panel.open .stats-sheet {
  transform: translateY(0);
}

.settings-handle,
.stats-handle {
  width: 2.5rem;
  height: 4px;
  background: var(--c-border);
  border-radius: 10px;
  margin: 0 auto 1.5rem;
  opacity: 0.5;
}

.settings-row,
.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--c-border);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label,
.stats-label {
  font-size: 0.85rem;
  color: var(--c-text-soft);
  letter-spacing: 0.02em;
}

/* Specific Stats Styling */
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  color: var(--c-text);
  line-height: 1;
  margin-top: 0.25rem;
}

.stat-unit {
  font-size: 0.75rem;
  color: var(--c-accent-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Toggle Switch ───────────────────────────────────── */
.toggle {
  position: relative;
  width: 2.8rem;
  height: 1.5rem;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  /* Explicit properties instead of shorthand — avoids non-compositable
     border-*-color transitions being flagged by Lighthouse/PageSpeed */
  transition: background 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  background: var(--c-text-dim);
  border-radius: 50%;
  top: 50%;
  left: 0.2rem;
  transform: translateY(-50%);
  /* Only transition compositable properties */
  transition: transform 0.3s ease, background 0.3s ease;
}

.toggle input:checked+.toggle-slider {
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.toggle input:checked+.toggle-slider::before {
  transform: translate(1.3rem, -50%);
  background: white;
}

/* ── Progress Bar ────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 2px;
  background: var(--c-border);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--g-accent);
  border-radius: 1px;
  transition: width 0.5s var(--m-ease-soft);
}

/* ── Bottom Footer ───────────────────────────────────── */
.app-footer {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--c-text-dim);
}

.footer-links a:hover {
  color: var(--c-text-soft);
}

/* ── Hero Orb (shared across pages) ──────────────────── */
.hero-orb {
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  border: 1px solid var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-orb::before {
  content: '';
  position: absolute;
  inset: 1.2rem;
  border-radius: 50%;
  background: var(--c-glow);
  animation: pulseSoft 6s ease-in-out infinite;
}

.hero-orb::after {
  content: '';
  position: absolute;
  inset: -1.5rem;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  animation: pulseSoft 6s ease-in-out infinite reverse;
}

.hero-orb-inner {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--g-accent);
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

/* ── Notification Toast ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(4rem);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  padding: 0.75rem 1.5rem;
  font-size: 0.82rem;
  color: var(--c-text-soft);
  z-index: 1000;
  transition: transform 0.4s var(--m-ease-soft);
  pointer-events: none;
  white-space: nowrap;
}

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

/* ── Voice Select ────────────────────────────────────── */
.select-field {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 0.5rem;
  color: var(--c-text-soft);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  max-width: 12rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(200,210,228,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}

/* ── Range Slider ────────────────────────────────────── */
.range-field {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--c-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.range-field::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--c-accent-2);
  cursor: pointer;
}