/* style.css */
/* Konfigurieren der Hauptfarben basierend auf den Wireframes */
:root {
    --color-dark-blue: #2B4162; 
    --color-light-bg: #F5F5E0; 

    /* ✅ EINZIGE AKZENTFARBE: Himmelblau + Abstufungen */
    --color-accent: #7EC8E3;          /* Himmelblau */
    --color-accent-soft: #A9DBEE;     /* hell */
    --color-accent-strong: #4FA3C7;   /* dunkler */

    /* ✅ kein Grün mehr, ersetzen wir durch helles Himmelblau */
    --color-button-soft: #A9DBEE;

    /* Neue Farben für die Genre-Auswahl (werden aktuell nicht mehr als Button-Farbe genutzt,
       weil Genre-Buttons "pill" grau + Akzent aktiv sind – aber lassen wir drin) */
    --color-genre-1: #C9D9E9;
    --color-genre-2: #B0C4DE;
    --color-genre-3: #FFFFFF;
    --color-genre-4: #B3D9D9;
    --color-header-icon: #333333;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-light-bg);
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px; 
    height: 100vh;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    overflow: hidden; 
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hidden-screen {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}
.visible-screen {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

.app-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem; 
    position: relative; 
    color: var(--color-header-icon);
}

.header-title {
    position: absolute;
    left: 50%;
    top: 50%; 
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark-blue);
    z-index: 5;
}

.header-icon-wrapper {
    z-index: 10;
    padding: 0;
}

/* Screens Styling */
#splash-screen {
    background-image: url('./Somnia-Bilder/schlafendeperson.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-light-bg);
    text-align: center;
    text-shadow: 0px 2px 8px rgba(0,0,0,0.4); 
    justify-content: space-between;
    padding: 15vh 24px;
}

#splash-screen h1, .splash-bottom-content {
    z-index: 20; 
    position: relative; 
}

#main-menu-screen {
    background-image: url('./Somnia-Bilder/zweiterscreen.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    justify-content: space-between;
    padding: 24px;
    color: var(--color-dark-blue); 
    text-shadow: 0px 0px 4px rgba(255,255,255,0.7); 
}

#main-menu-screen .flex, #main-menu-screen h2, #main-menu-screen button {
    z-index: 20;
    position: relative;
}

#settings-menu-screen, 
#genre-selection-screen,
#sleeptimer-selection-screen,
#playback-screen { 
    background-image: url('./Somnia-Bilder/genrescreen.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 24px;
    justify-content: flex-start;
}

/* ********************************************* */
/* ATEMÜBUNG ANIMATION & PLACEHOLDER             */
/* ********************************************* */

.atemuebung {
   background-image: url('./Somnia-Bilder/atmen.png');
    background-color: #a0d3f5; /* Hellblaues Fallback */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Animation: Atmen */
@keyframes breathe {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.breathing-circle {
    animation: breathe 8s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(66, 153, 225, 0.5);
}

/* --------------------------------------------- */

.settings-menu-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
    border-bottom: 1px solid #E0E0E0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-dark-blue);
    cursor: pointer;
    transition: background-color 0.1s;
}

.settings-menu-item:hover {
    background-color: #FAFAFA;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 320px;
    margin-top: 2rem;
}

/* ===========================
   TIMER BUTTONS (+10%)
   =========================== */
.timer-button {
    width: 100%;
    padding: 1.1rem;                   /* ✅ +10% (war 1rem) */
    background-color: white;
    border: 1px solid #E0E0E0;
    border-radius: 0.825rem;           /* ✅ +10% (war 0.75rem) */
    text-align: center;
    font-size: 1.2375rem;              /* ✅ +10% (war 1.125rem) */
    color: var(--color-dark-blue);
    font-weight: 500;
    transition: background-color 0.1s, font-weight 0.1s;
}

.timer-button:hover {
    background-color: #F8F8F8;
}

.timer-button.active {
    font-weight: 800;
    background-color: var(--color-accent-soft);
    border-color: var(--color-accent);
}

#voice-selection-screen {
    background-image: url('./Somnia-Bilder/genrescreen.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 24px;
    justify-content: flex-start;
}

#profile-modal {
    display: none;
}

#profile-modal.flex {
    display: flex;
}

/* ----- Individueller Hintergrund für den PLAYBACK-SCREEN ----- */
#playback-screen {
    background-image: url('./Somnia-Bilder/playscreen.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* =====================================================
   PRIMARY BUTTON (Text-Breite +10%)
   ===================================================== */

.primary-button {
    display: inline-flex;              /* ✅ */
    align-items: center;
    justify-content: center;

    width: fit-content;                /* ✅ passt sich der Schriftlänge an */
    max-width: 100%;                   /* ✅ nicht über den Screen */
    padding: 0.825rem 1.65rem;         /* ✅ +10% */
    margin-top: 2rem;

    background-color: white;
    color: #1f2937;

    font-size: 0.9625rem;              /* ✅ +10% */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;

    border-radius: 9999px;
    border: none;

    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;

    white-space: normal;
}

.primary-button:hover {
    background-color: #EAF6FB;
    transform: translateY(-1px);
}

.primary-button:active {
    transform: scale(0.97);
}

/* =====================================================
   SETTINGS BUTTONS (Genre / Stimme) (+10%)
   ===================================================== */

.settings-button {
    width: 100%;
    max-width: 352px;                  /* ✅ +10% */
    padding: 1.265rem 0;               /* ✅ +10% */

    background: rgba(120, 120, 120, 0.55);
    backdrop-filter: blur(4px);

    color: #ffffff;
    font-size: 1.375rem;               /* ✅ +10% */
    font-weight: 700;

    text-align: center;

    border: none;
    border-radius: 9999px;

    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.settings-button:hover {
    background: rgba(120, 120, 120, 0.7);
    transform: translateY(-1px);
}

.settings-button:active {
    transform: scale(0.97);
}

/* =====================================================
   GENRE BUTTONS – pill +10% (nur 1 Definition!)
   ===================================================== */

.genre-button {
    height: 88px;                      /* ✅ +10% (war 80px) */
    width: 100%;

    background: rgba(120, 120, 120, 0.45);
    backdrop-filter: blur(4px);

    color: white;
    font-size: 1.21rem;                /* ✅ +10% */
    font-weight: 700;

    border-radius: 9999px;
    border: none;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.genre-button:hover {
    background: rgba(120, 120, 120, 0.65);
}

.genre-button:active {
    transform: scale(0.97);
}

/* ✅ Aktives Genre (Himmelblau als Akzentfarbe) */
.genre-button.active {
    background: rgba(126, 200, 227, 0.8);
    box-shadow: 0 0 12px rgba(126, 200, 227, 0.6);
}

/* =====================================================
   SETTINGS BUTTONS – NUR Buttons vertikal zentrieren
   ===================================================== */

#settings-menu-screen {
    justify-content: flex-start;
}

.settings-buttons-wrapper {
    margin-top: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

/* =====================================================
   GENRE BUTTONS – NUR Buttons vertikal zentrieren
   ===================================================== */

.genre-buttons-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =====================================================
   Atemübung: lebender Kreis (Farbwechsel + Shadow + Text-Fade)
   ===================================================== */

.breathing-circle {
    transition: transform 4s ease-in-out, box-shadow 1.2s ease, background-color 1.2s ease;
    background-color: rgba(255, 255, 255, 0.92); /* neutral */
}

.breathing-circle.inhale {
    background-color: rgba(126, 200, 227, 0.35);
    box-shadow: 0 0 28px rgba(126, 200, 227, 0.55);
}

.breathing-circle.exhale {
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.08);
}

#breathing-text {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#breathing-text.fade-out {
    opacity: 0;
    transform: translateY(2px);
}

/* ============================
   COOLER BREATHING CIRCLE (Glow + Ripple + Smooth)
   ============================ */

#breathing-text {
  transition: opacity 220ms ease, transform 220ms ease;
}
#breathing-text.fade-out {
  opacity: 0;
  transform: translateY(4px);
}

.breathing-circle {
  position: relative;
  overflow: visible;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow:
    0 0 0 10px rgba(126, 200, 227, 0.10),
    0 0 30px rgba(126, 200, 227, 0.25),
    0 20px 35px rgba(0, 0, 0, 0.18);
  transform: scale(1);
  transition: transform 900ms ease-in-out, box-shadow 900ms ease-in-out;
}

.breathing-circle::before,
.breathing-circle::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 9999px;
  pointer-events: none;
  border: 2px solid rgba(126, 200, 227, 0.25);
  opacity: 0;
  transform: scale(0.9);
}

@keyframes ripple {
  0%   { opacity: 0.0; transform: scale(0.92); }
  20%  { opacity: 0.35; }
  100% { opacity: 0.0; transform: scale(1.35); }
}

.breathing-circle::before {
  animation: ripple 4s ease-out infinite;
}
.breathing-circle::after {
  animation: ripple 4s ease-out infinite;
  animation-delay: 1.2s;
}

.breathing-circle.inhale {
  transform: scale(1.22);
  box-shadow:
    0 0 0 14px rgba(126, 200, 227, 0.14),
    0 0 45px rgba(126, 200, 227, 0.38),
    0 30px 50px rgba(0, 0, 0, 0.20);
}

.breathing-circle.exhale {
  transform: scale(0.98);
  box-shadow:
    0 0 0 10px rgba(126, 200, 227, 0.10),
    0 0 26px rgba(126, 200, 227, 0.22),
    0 18px 32px rgba(0, 0, 0, 0.16);
}

#breathing-screen .animate-pulse {
  opacity: 0.18 !important;
}

/* Stop Button bleibt klar sichtbar */
#stop-button {
    position: relative;
    z-index: 10;
}

/* =========================================
   PLAYBACK: DIM IN STUFEN (nur Playback)
   Startet über JS nach 10s
   ========================================= */

#playback-screen {
  position: relative;
}

#playback-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,1);
  opacity: 0;
  transition: opacity 1200ms ease;
  pointer-events: none;
  z-index: 5;
}

#playback-screen > * {
  position: relative;
  z-index: 6;
}

#playback-screen.playback-dim-1 *:not(#stop-button):not(#stop-button *),
#playback-screen.playback-dim-2 *:not(#stop-button):not(#stop-button *),
#playback-screen.playback-dim-3 *:not(#stop-button):not(#stop-button *),
#playback-screen.playback-dim-4 *:not(#stop-button):not(#stop-button *),
#playback-screen.playback-dim-5 *:not(#stop-button):not(#stop-button *) {
  transition: opacity 1200ms ease;
}

#playback-screen.playback-dim-1::before { opacity: 0.12; }
#playback-screen.playback-dim-1 *:not(#stop-button):not(#stop-button *) { opacity: 0.85; }

#playback-screen.playback-dim-2::before { opacity: 0.22; }
#playback-screen.playback-dim-2 *:not(#stop-button):not(#stop-button *) { opacity: 0.68; }

#playback-screen.playback-dim-3::before { opacity: 0.34; }
#playback-screen.playback-dim-3 *:not(#stop-button):not(#stop-button *) { opacity: 0.50; }

#playback-screen.playback-dim-4::before { opacity: 0.48; }
#playback-screen.playback-dim-4 *:not(#stop-button):not(#stop-button *) { opacity: 0.33; }

#playback-screen.playback-dim-5::before { opacity: 0.62; }
#playback-screen.playback-dim-5 *:not(#stop-button):not(#stop-button *) { opacity: 0.18; }

/* =====================================================
   DIM-PATCH (nur Playback) – kompatibel zu .playback-dim
   ===================================================== */
#playback-screen.playback-dim::before{
  opacity: 0.34;
}
#playback-screen.playback-dim *:not(#stop-button):not(#stop-button *){
  opacity: 0.50;
}

/* ===========================
   SLEEP CHECK-IN (Emoji)
   =========================== */
.sleep-emoji-row {
  display: flex;
  gap: 1.25rem;
}

.sleep-emoji-btn {
  font-size: 3rem;
  line-height: 1;
  padding: 0.9rem 1.1rem;
  border-radius: 9999px;
  border: 2px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.sleep-emoji-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.95);
}

.sleep-emoji-btn:active {
  transform: scale(0.97);
}

/* optional: kleiner Graph im Profil */
.sleep-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  height: 90px;
  margin-top: 0.75rem;
}

.sleep-bar {
  width: 10px;
  border-radius: 9999px;
  background: rgba(126, 200, 227, 0.75);
  opacity: 0.9;
}

.sleep-bar.mood-1 { opacity: 0.25; }
.sleep-bar.mood-2 { opacity: 0.55; }
.sleep-bar.mood-3 { opacity: 0.9; }

/* =========================================
   CHECK-IN SCREEN – Background Placeholder
   ========================================= */
#sleep-checkin-screen {
  background-image: url("./Somnia-Bilder/Schlafcheck1.jpg"); /* placeholder */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
