/* ─── Variables (ACTotal Theme) ─── */
:root {
    --bg: #050506;
    --surface: #111827;
    --surface-light: #1f2937;
    --accent: #2DD4BF;
    /* Teal accent for relaxation */
    --accent-glow: rgba(45, 212, 191, 0.3);
    --accent-glow-strong: rgba(45, 212, 191, 0.6);
    --text: #ffffff;
    --text-dim: #9ca3af;
    --radius: 20px;
    --radius-sm: 12px;
}

/* ─── Base Reset ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ─── Layout ─── */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2DD4BF, #0D9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .08);
    background: var(--surface);
    color: var(--text-dim);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all .2s;
}

.btn-icon:hover {
    background: var(--surface-light);
    color: var(--text);
}

.text-success {
    color: var(--accent);
}

.text-center {
    text-align: center;
}

/* ─── Base Main Classes ─── */
.relax-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.view-section {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    animation: fadeIn 0.4s ease-out;
}

.view-section.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Setup & Finish Views ─── */
.info-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 100%;
}

.icon-hero {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.icon-hero.finish-icon {
    background: linear-gradient(135deg, #2DD4BF, #0D9488);
    -webkit-background-clip: text;
    color: transparent;
}

.info-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #fff;
}

.text-setup {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.steps-list {
    list-style: none;
    text-align: left;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    margin-bottom: 2rem;
    width: 100%;
}

.steps-list li {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: flex-start;
}

.steps-list li:last-child {
    margin-bottom: 0;
}

.steps-list li strong {
    color: var(--accent);
    margin-right: 0.5rem;
    min-width: 60px;
}

/* ─── Interaction Buttons ─── */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #2DD4BF, #0D9488);
    color: #fff;
    box-shadow: 0 5px 20px var(--accent-glow);
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:active {
    transform: scale(0.96);
}

/* ─── Breathe View ─── */
.phase-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2DD4BF, #0D9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.phase-subtitle {
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

.breathe-container {
    position: relative;
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto 4rem;
}

.breathe-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition-property: transform, background, box-shadow;
    transition-timing-function: ease-in-out;
    /* The transition-duration will be injected dynamically via JS based on the phase length */
}

/* Default state before animation */
.glow-circle {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--accent);
    filter: blur(40px);
    opacity: 0.3;
    z-index: 5;
    transition-property: transform, opacity;
    transition-timing-function: ease-in-out;
}

/* Scale modifiers applied by JS */
.scale-inhale .breathe-circle {
    transform: scale(2);
    box-shadow: 0 0 50px rgba(20, 184, 166, 0.6);
}

.scale-inhale .glow-circle {
    transform: scale(2.2);
    opacity: 0.6;
}

.scale-hold .breathe-circle {
    transform: scale(2);
    /* Keeps the expanded scale */
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.4);
    background: linear-gradient(135deg, #0D9488, #0F766E);
}

.scale-hold .glow-circle {
    transform: scale(2);
    opacity: 0.4;
}

.scale-exhale .breathe-circle,
.scale-exhale .glow-circle {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.2);
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.scale-exhale .glow-circle {
    opacity: 0.2;
}


/* Time counter */
.time-counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-variant-numeric: tabular-nums;
}

/* Footer Controls */
.exercise-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: auto;
}

.cycle-counter {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.cycle-counter strong {
    color: #fff;
    font-size: 1.1rem;
    margin: 0 0.2rem;
}

/* ─── Footer ─── */
.app-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 1rem;
    padding-top: 1rem;
}