/* css/meditatie.css — Meditație: muzică de relaxare generată live */

#meditatie-section .container { max-width: 820px; }

.med-intro {
    padding: 0.85rem 1rem;
    border: 1px solid var(--card-border);
    border-left: 4px solid #7c3aed;
    border-radius: 0.6rem;
    background: var(--section-alt-bg);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

/* ─── Scena de respirație ───────────────────────────────────────────────── */
.med-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem 1rem;
    min-height: 21rem;
    border-radius: 1rem;
    background: radial-gradient(ellipse at 50% 45%, rgba(124, 58, 237, 0.22) 0%, rgba(15, 23, 42, 0) 68%),
                linear-gradient(180deg, #0f172a 0%, #171334 100%);
    overflow: hidden;
    margin-bottom: 1.2rem;
}
.med-circle-wrap {
    position: relative;
    width: 12rem; height: 12rem;
    display: flex; align-items: center; justify-content: center;
}
/* inelul fix, ca reper pentru cât de mult crește cercul */
.med-circle-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(196, 181, 253, 0.32);
}
.med-circle {
    width: 12rem; height: 12rem;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, rgba(233, 213, 255, 0.95), rgba(139, 92, 246, 0.75) 45%, rgba(76, 29, 149, 0.55) 100%);
    box-shadow: 0 0 3rem rgba(139, 92, 246, 0.45);
    transform: scale(0.6);
    /* nicio tranziție CSS: scala vine din requestAnimationFrame, altfel s-ar bate cu ea */
    will-change: transform;
}
.med-circle[data-phase="1"], .med-circle[data-phase="3"] { box-shadow: 0 0 3.4rem rgba(196, 181, 253, 0.55); }

/* Halou care se umflă și se stinge foarte lent, pe lângă cerc: mișcarea lungă a
   instrumentelor rezonante, nu pulsul unui metronom. 11 secunde, cu o curbă simetrică. */
.med-circle-wrap::before {
    content: '';
    position: absolute;
    inset: -14%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.22) 0%, rgba(167, 139, 250, 0) 68%);
    opacity: 0;
    pointer-events: none;
}
body.med-running .med-circle-wrap::before {
    animation: med-resonance 11s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
@keyframes med-resonance {
    0%   { opacity: 0.10; transform: scale(0.92); }
    50%  { opacity: 0.55; transform: scale(1.06); }
    100% { opacity: 0.10; transform: scale(0.92); }
}
@media (prefers-reduced-motion: reduce) {
    body.med-running .med-circle-wrap::before { animation: none; opacity: 0.25; }
}
.med-breath-text {
    position: absolute;
    text-align: center;
    color: #f5f3ff;
    pointer-events: none;
}
.med-breath-phase {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.med-breath-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.med-clock {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.5rem;
    color: #e9d5ff;
    font-variant-numeric: tabular-nums;
}
.med-progress {
    width: min(22rem, 90%);
    height: 0.3rem;
    border-radius: 999px;
    background: rgba(196, 181, 253, 0.2);
    overflow: hidden;
}
.med-progress span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, #7c3aed, #c4b5fd);
    border-radius: 999px;
}
/* Eticheta instrumentului: sticlă mată peste scenă, ca să se citească fără să acopere. */
.badge-instrument {
    margin: 0;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f5f3ff;
    background: rgba(148, 130, 238, 0.18);
    border: 1px solid rgba(233, 213, 255, 0.28);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
    box-shadow: 0 0.4rem 1.2rem rgba(15, 23, 42, 0.35);
}
/* fără backdrop-filter (Firefox mai vechi) fundalul rămâne totuși lizibil */
@supports not (backdrop-filter: blur(4px)) {
    .badge-instrument { background: rgba(76, 29, 149, 0.72); }
}

.med-now {
    font-size: 0.82rem;
    color: #c4b5fd;
    text-align: center;
    margin: 0;
}
.med-status {
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: center;
    margin: 0;
    min-height: 1.2rem;
}

/* ─── Comenzi ───────────────────────────────────────────────────────────── */
.med-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.4rem;
}
.med-btn {
    padding: 0.6rem 1.3rem;
    border: 1px solid var(--card-border);
    border-radius: 0.6rem;
    background: transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.med-btn-main {
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    border-color: transparent;
    color: #fff;
    min-width: min(12rem, 100%);
}
.med-btn-stop { border-color: rgba(248, 113, 113, 0.5); color: #ef4444; }

.med-group { margin-bottom: 1.1rem; }
.med-group h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--secondary-text-color);
    margin-bottom: 0.45rem;
}
.med-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.med-chip {
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.med-chip.is-active {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.16);
    box-shadow: inset 0 -2px 0 #7c3aed;
    font-weight: 700;
}
/* Un strat stins arată stins: scris șters și tăiat, ca să se vadă dintr-o privire ce
   lipsește din ce auzi. Fără asta, „aprins" și „stins" se deosebeau doar printr-o nuanță. */
.med-chip.is-off {
    opacity: 0.5;
    border-style: dashed;
    text-decoration: line-through;
}
.med-chip.is-off:hover { opacity: 0.75; }

.med-select {
    width: 100%;
    max-width: 22rem;
    padding: 0.5rem 0.7rem;
    font-size: 1rem;              /* ≥1rem: sub atât, iOS mărește pagina la focus */
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    min-height: 44px;             /* cât să se prindă cu degetul */
}
.med-select:focus { border-color: #7c3aed; outline: none; }

.med-hint {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--secondary-text-color);
}
/* Scurtătura „doar instrumentul": e o acțiune, dar nu merită greutatea unui buton plin. */
.med-link {
    padding: 0;
    margin-left: 0.25rem;
    font: inherit;
    font-weight: 700;
    color: #7c3aed;
    background: none;
    border: none;
    border-bottom: 1px solid currentColor;
    cursor: pointer;
}
.med-link:hover { color: #6d28d9; }

.med-note {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    line-height: 1.5;
}
/* al doilea rând de chipsuri, filtrat de categoria de deasupra */
.med-chips-sub { margin-top: 0.4rem; }

/* Toate instrumentele se vad deodata, fiecare cu semnul lui, in loc de un rand de
   pastile dupa ce alegeai intai categoria. auto-fill cu un minim in rem tine randul
   plin pe ecran lat si il rupe singur pe telefon, fara praguri scrise de mana. */
.med-instr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
    gap: 0.45rem;
}
.med-instr {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.04); color: inherit;
    font-size: 0.82rem; font-weight: 600; text-align: left;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.med-instr i { width: 1.1rem; text-align: center; opacity: 0.85; flex-shrink: 0; }
.med-instr span { min-width: 0; overflow-wrap: anywhere; }
.med-instr:hover { border-color: #7c3aed; }
.med-instr.is-active { border-color: #7c3aed; background: rgba(124, 58, 237, 0.22); }
.med-instr.is-active i { opacity: 1; }

/* Avertismentul pentru căști trebuie să sară în ochi: fără ele, binauralul nici nu există. */
.med-headphones {
    display: flex;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0.6rem 0 0;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.12);
    color: #b45309;
    font-size: 0.82rem;
    line-height: 1.5;
}
.med-headphones i { font-size: 1rem; margin-top: 0.1rem; }
body.dark-theme .med-headphones { color: #fcd34d; }

.med-slider {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.med-slider label { flex: 0 0 8.5rem; }
.med-slider .form-range { flex: 1 1 8rem; min-width: 0; }
.med-slider span { min-width: 3rem; text-align: right; font-weight: 700; }

/* ─── Lista de pe YouTube ───────────────────────────────────────────────── */
.med-playlist {
    padding: 1rem 1.15rem;
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    background: var(--section-alt-bg);
    margin-top: 1.6rem;
}
.med-playlist h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
.med-playlist h3 i { color: #ef4444; }
.med-playlist-note {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--secondary-text-color);
    margin-bottom: 0.8rem;
}
/* Fațada: până la clic nu se încarcă niciun iframe, deci pagina rămâne rapidă
   și nu trimite nimic către YouTube fără voia ta. */
.med-playlist-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.6rem;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 50%, rgba(124, 58, 237, 0.28) 0%, rgba(15, 23, 42, 0) 70%), #0f172a;
}
.med-playlist-box iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.med-playlist-play {
    position: absolute;
    inset: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    border: 0;
    background: transparent;
    color: #e9d5ff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.med-playlist-icon {
    width: 4rem; height: 4rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 0.5rem 1.6rem rgba(239, 68, 68, 0.4);
    transition: transform 0.15s ease;
}
.med-playlist-play:active .med-playlist-icon { transform: scale(0.94); }
/* Comutatorul de chakre: fiecare are culoarea ei tradițională, ca bulina să fie reperul */
.med-chakras {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}
.med-chakra {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.8rem;
    cursor: pointer;
    min-height: 40px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.med-chakra-dot {
    width: 0.7rem; height: 0.7rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0.5rem currentColor;
}
.med-chakra.is-active {
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.16);
    font-weight: 700;
}
.med-chakra.is-active .med-chakra-dot { box-shadow: 0 0 0.7rem 0.1rem rgba(255, 255, 255, 0.35); }

.med-playlist-alt { margin: 0.7rem 0 0; font-size: 0.82rem; }
.med-playlist-alt a { color: #a78bfa; }

/* ─── Explicații ────────────────────────────────────────────────────────── */
.med-tips {
    padding: 1rem 1.15rem;
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    background: var(--section-alt-bg);
    margin-top: 1.6rem;
}
.med-tips h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.6rem; }
.med-tips h3 i { color: #a78bfa; }
.med-tips ul { margin: 0 0 0.8rem; padding-left: 1.2rem; }
.med-tips li { font-size: 0.9rem; line-height: 1.65; }
.med-tips-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--secondary-text-color);
    border-top: 1px solid var(--card-border);
    padding-top: 0.7rem;
}

/* Cât timp rulează ședința, restul paginii se retrage discret. */
body.med-running .med-intro,
body.med-running .med-tips { opacity: 0.55; transition: opacity 0.5s ease; }

@media (hover: hover) {
    .med-btn:hover { border-color: #7c3aed; }
    .med-chip:hover { border-color: #7c3aed; }
}
.med-btn:active, .med-chip:active { border-color: #7c3aed; }

@media (max-width: 575.98px) {
    .med-stage { min-height: 18rem; padding: 1.4rem 0.6rem; }
    .med-circle-wrap, .med-circle { width: 9.5rem; height: 9.5rem; }
    .med-slider label { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .med-circle { transition: none; }
}
