/* Araam - Breathe View Styles */

#view-breathe .container {
    max-width: calc(var(--base-unit) * 50);
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--base-unit) * 0.2);
    padding: 0 var(--base-unit);
}

#view-breathe h1 {
    font-size: calc(var(--base-unit) * 3);
}

#view-breathe .breathing-container {
    position: relative;
    width: var(--circle-size);
    height: var(--circle-size);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: calc(var(--base-unit) * 1) 0;
    z-index: 1;
}

#view-breathe .breathing-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(var(--circle-size) * 0.7);
    height: calc(var(--circle-size) * 0.7);
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 1;
    transition-property: transform, background-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1;
}

#view-breathe .timer-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--accent-color-2);
    opacity: 0.9;
    transition: height 0.2s linear, opacity 0.6s cubic-bezier(0.4, 0, 0.6, 1);
    pointer-events: none;
    will-change: height, opacity;
    transform: translateZ(0);
}

#view-breathe .breathing-circle.inhale {
    transform: translate(-50%, -50%) scale(1.6);
    background-color: var(--secondary-color);
}

#view-breathe .breathing-circle.exhale {
    transform: translate(-50%, -50%) scale(0.6);
    background-color: var(--primary-color);
}

#view-breathe .start-stop-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary-color);
    border: none;
    border-radius: 50%;
    width: calc(var(--base-unit) * 4);
    height: calc(var(--base-unit) * 4);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(157, 193, 131, 0.4);
    z-index: 10;
}

#view-breathe .start-stop-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#view-breathe .pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(var(--circle-size) * 0.8);
    height: calc(var(--circle-size) * 0.8);
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0.9;
    z-index: 1;
    animation: breathePulse 4s ease-in-out infinite;
}

@keyframes breathePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
        background-color: var(--primary-color);
    }
    50% {
        opacity: 0.5;
        background-color: var(--secondary-color);
    }
}

#view-breathe .breathing-instruction {
    width: 100%;
    text-align: center;
    font-weight: 500;
    font-family: var(--font-serif);
    font-size: calc(var(--base-unit) * 1.3);
    color: var(--text-color);
    opacity: 0.8;
    transition: opacity var(--transition-medium);
    position: relative;
    z-index: 10;
}

#view-breathe .calming-message,
#view-breathe .stats {
    font-family: var(--font-serif);
    font-size: calc(var(--base-unit) * 1.2);
    color: var(--text-color-2);
    opacity: 0.8;
    transition: opacity var(--transition-medium);
    font-weight: 500;
}

#view-breathe .messages {
    width: 100%;
    text-align: center;
    margin-top: calc(var(--base-unit) * 1);
}

/* Pattern Selection */
#view-breathe .pattern-selector {
    position: absolute;
    bottom: calc(var(--base-unit) * 11);
    left: 50%;
    transform: translate(-50%, 0);
    margin: 0;
    opacity: 1;
    transition: all var(--transition-medium);
    width: 100%;
    z-index: 20;
}

#view-breathe .pattern-selector[hidden] {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -10px);
}

#view-breathe .patterns {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: calc(var(--base-unit) * 0.3);
    justify-content: center;
}

#view-breathe .pattern-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--base-unit);
}

#view-breathe .pattern-btn {
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: calc(var(--base-unit) * 1.5);
    background-color: var(--primary-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--base-unit) * 0.5);
    opacity: 0.7;
    width: calc(var(--base-unit) * 10);
}

#view-breathe .pattern-btn:hover { opacity: 1; transform: translateY(-2px); }
#view-breathe .pattern-btn.active { background-color: var(--secondary-color); color: white; opacity: 1; }

#view-breathe .pattern-name {
    font-family: var(--font-serif);
    font-size: calc(var(--base-unit) * 1.1);
    font-weight: 500;
}

#view-breathe .pattern-detail {
    font-size: calc(var(--base-unit) * 0.9);
    opacity: 0.8;
}

#view-breathe .tooltip {
    position: absolute;
    bottom: calc(var(--base-unit) * 4);
    left: 50%;
    background: var(--tooltip-bg);
    padding: calc(var(--base-unit) * 0.8);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 4px var(--tooltip-shadow);
    width: calc(var(--base-unit) * 15);
    font-size: calc(var(--base-unit) * 0.8);
    opacity: 0;
    visibility: hidden;
    z-index: 7;
}

#view-breathe .pattern-wrapper:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(calc(var(--base-unit) * -0.5));
}

/* Controls */
#view-breathe .controls {
    display: flex;
    position: relative;
    gap: calc(var(--base-unit) * 2);
    justify-content: center;
    margin: calc(var(--base-unit) * 1.7) 0;
    opacity: 1;
    transition: opacity var(--transition-medium);
    z-index: 10;
}

/* Timer Modal */
#view-breathe .timer-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--modal-bg);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1000;
    padding: calc(var(--base-unit) * 2);
}

#view-breathe .timer-modal:not([hidden]) {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

#view-breathe .timer-modal[hidden] { display: none; }

#view-breathe .timer-content {
    background: var(--modal-content-bg);
    padding: calc(var(--base-unit) * 3);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: calc(var(--base-unit) * 35);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

#view-breathe .timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--base-unit) * 2);
}

#view-breathe .timer-content h2 {
    font-family: var(--font-serif);
    color: var(--text-color);
    font-size: calc(var(--base-unit) * 2);
    margin: 0;
}

#view-breathe .close-modal-btn {
    position: absolute;
    top: calc(var(--base-unit) * 1.5);
    right: calc(var(--base-unit) * 1.5);
    background: none;
    border: none;
    padding: calc(var(--base-unit) * 0.5);
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.4;
    transition: all var(--transition-fast);
    border-radius: 50%;
    width: calc(var(--base-unit) * 2.5);
    height: calc(var(--base-unit) * 2.5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

#view-breathe .close-modal-btn:hover {
    opacity: 0.4;
    background-color: var(--primary-color);
}

#view-breathe .timer-description {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: calc(var(--base-unit) * 3);
    font-size: var(--base-unit);
    text-align: center;
}

#view-breathe .timer-presets {
    display: flex;
    justify-content: space-between;
    gap: var(--base-unit);
    margin-bottom: calc(var(--base-unit) * 3);
}

#view-breathe .timer-preset {
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: calc(var(--base-unit) * 1.2);
    font-size: var(--base-unit);
    font-weight: 500;
    width: calc(var(--base-unit) * 10);
}

#view-breathe .timer-preset:hover { background: var(--primary-color); transform: translateY(-2px); opacity: 0.8; }
#view-breathe .timer-preset.active { background: var(--secondary-color); border-color: var(--secondary-color); color: white; transform: translateY(-2px); opacity: 1; }

#view-breathe .timer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--base-unit);
    margin-top: calc(var(--base-unit) * 3);
}

#view-breathe .start-timer-btn,
#view-breathe .cancel-timer-btn {
    padding: calc(var(--base-unit) * 1.2);
    font-family: var(--font-serif);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--base-unit);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#view-breathe .start-timer-btn { background: var(--secondary-color); color: white; }
#view-breathe .cancel-timer-btn { background: var(--primary-color); color: var(--text-color); }
#view-breathe .start-timer-btn:hover,
#view-breathe .cancel-timer-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

/* Nudge animation */
#view-breathe .nudge {
    animation: nudge 0.4s ease-out;
}

@keyframes nudge {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(0.95); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 768px) {
    #view-breathe .pattern-selector { bottom: calc(var(--base-unit) * 15); }
}

@media (max-width: 500px) {
    #view-breathe .patterns { flex-direction: row; align-items: center; gap: calc(var(--base-unit) * 0.5); }
    #view-breathe .pattern-selector { bottom: calc(var(--base-unit) * -12); }
    #view-breathe .timer-content { padding: calc(var(--base-unit) * 2); }
    #view-breathe .timer-presets { grid-template-columns: repeat(3, 1fr); }
    :root { --circle-size: min(70vh, 70vw); }
}
