/* ========================================
   BREATHING EXERCISE - ZEN MODE
   ======================================== */

.breathing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    /* Strict use of root colors */
    background-color: var(--color-bg-primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1.5s ease, visibility 1.5s;
}

.breathing-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Ambient Background - Soft moving blobs using existing vars */
.breathing-ambient {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.ambient-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.ambient-shape:nth-child(1) {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background-color: var(--color-brand-yellow);
    animation-delay: 0s;
}

.ambient-shape:nth-child(2) {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background-color: var(--color-secondary-olive);
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 40px); }
}

/* Content Wrapper */
.breathing-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-align: center;
    padding: var(--spacing-md);
}

.breathing-title {
    font-family: var(--font-primary);
    color: var(--color-primary-olive);
    font-size: 2rem;
    font-weight: var(--font-weight-medium);
    margin: 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.2s;
}

/* The Breathing Circle Visual */
.breathing-visual {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-sm) 0;
}

/* Interactive breathing control (circle button) */
.breathing-circle-inner {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, var(--color-brand-yellow), #fdf1ce);
    color: var(--color-primary-olive);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    box-shadow: 0 18px 45px rgba(242, 201, 105, 0.4);
    transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
                box-shadow 0.5s ease,
                background 0.5s ease,
                color 0.5s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.4s;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.breathing-circle-inner.pulsing {
    animation: fadeInUp 1s ease forwards 0.4s, circlePulse 3s ease-in-out infinite 1.2s;
}

.breathing-circle-inner:focus-visible {
    outline: 3px solid rgba(86, 98, 49, 0.5);
    outline-offset: 6px;
}

.breathing-circle-inner .breathing-circle-glow,
.breathing-circle-inner .breathing-circle-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.breathing-circle-glow {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.breathing-circle-pulse {
    border: 2px solid rgba(255, 255, 255, 0.55);
    opacity: 0;
    transform: scale(0.85);
}

.breathing-circle-inner.inhaling .breathing-circle-glow {
    opacity: 1;
}

.breathing-circle-inner.inhaling .breathing-circle-pulse {
    animation: rippleWave 1.6s ease-out infinite;
}

.breathing-circle-inner .breathing-circle-label {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.breathing-circle-icon {
    font-size: 2rem;
    line-height: 1;
}

.breathing-circle-text {
    font-size: 0.85rem;
    letter-spacing: 0.35em;
}

.breathing-circle-inner.holding,
.breathing-circle-inner.inhaling {
    transform: scale(1.2);
    box-shadow: 0 24px 60px rgba(242, 201, 105, 0.65);
}

.breathing-circle-inner.exhaling {
    transform: scale(0.88);
    background: linear-gradient(145deg, var(--color-secondary-olive), var(--color-primary-olive));
    color: var(--color-cream);
    box-shadow: 0 16px 40px rgba(86, 98, 49, 0.5);
}

.breathing-circle-inner.complete {
    transform: scale(1);
    background: linear-gradient(145deg, var(--color-cream), #ffffff);
    color: var(--color-primary-olive);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* Instructions */
.breathing-instruction {
    font-family: var(--font-primary);
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    min-height: 1.5em;
    font-weight: var(--font-weight-normal);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.5s;
}

/* Progress Text */
.breathing-progress {
    font-family: var(--font-primary);
    color: var(--color-primary-olive);
    margin-top: var(--spacing-xs);
    font-size: 0.95rem;
    opacity: 0.7;
}

@media (max-width: 520px) {
    .breathing-visual {
        width: 220px;
        height: 220px;
    }

    .breathing-circle-inner {
        width: 160px;
        height: 160px;
        letter-spacing: 0.15em;
    }

    .breathing-circle-text {
        font-size: 0.7rem;
        letter-spacing: 0.25em;
    }
}

/* Animation Utilities */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main Site Blur Effect */
body.breathing-active > *:not(.breathing-overlay) {
    filter: blur(10px);
    transition: filter 1.5s ease;
}

body.breathing-finished > *:not(.breathing-overlay) {
    filter: blur(0);
}

@keyframes circlePulse {
    0%, 100% {
        box-shadow: 0 18px 45px rgba(242, 201, 105, 0.35);
    }
    50% {
        box-shadow: 0 26px 65px rgba(242, 201, 105, 0.55);
    }
}

@keyframes rippleWave {
    0% {
        opacity: 0.6;
        transform: scale(0.85);
    }
    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}
