:root {
    --bg-base: #0a0f1d;
    --card-bg: rgba(18, 25, 43, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-teal: #14b8a6;
    --accent-rose: #f43f5e;

    --orb-1: rgba(59, 130, 246, 0.15);
    --orb-2: rgba(99, 102, 241, 0.15);
    --orb-3: rgba(20, 184, 166, 0.15);

    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 40vw;
    height: 40vw;
    background: var(--orb-1);
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 35vw;
    height: 35vw;
    background: var(--orb-2);
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
}

.orb-3 {
    width: 30vw;
    height: 30vw;
    background: var(--orb-3);
    top: 20%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -50px) scale(1.1);
    }
}

#app-container {
    width: 100%;
    max-width: 550px;
    padding: 20px;
    z-index: 10;
    position: relative;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    width: 100%;
    position: absolute;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.view-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.98);
    pointer-events: none;
}

.view-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

h1,
h2 {
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.8rem;
}

.subtitle,
p {
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    font-size: 1.05rem;
}

.small-text {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: -10px;
}

.action-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    width: 100%;
    margin-top: 1rem;
}

.action-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.action-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.action-btn.outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.action-btn.outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-btn.subtly {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    margin-top: 0;
    /* Clear default margin for inline buttons */
}

.action-btn.subtly:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.text-danger:hover {
    background: rgba(244, 63, 94, 0.1) !important;
}

/* Input Screen */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-indigo);
}

/* Audio Grid Redesign */
.audio-options-header {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.audio-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.audio-pill {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-pill .icon {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.audio-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.audio-pill.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-indigo);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.audio-pill.active .icon {
    color: var(--text-primary);
}

/* Breathing */
.breathing-container {
    align-items: center;
}

.breathing-circle-wrapper {
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
}

#breathing-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-teal) 0%, rgba(20, 184, 166, 0.2) 80%, transparent 100%);
    box-shadow: 0 0 50px rgba(20, 184, 166, 0.4);
    opacity: 0.8;
}

/* 4-7-8 Breathing Animation (19 seconds total) 
   Inhale: 4s (0% to 21%) 
   Hold: 7s (21% to 58%)
   Exhale: 8s (58% to 100%)
*/
@keyframes breathe478 {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    21% {
        transform: scale(3.5);
        opacity: 1;
    }

    58% {
        transform: scale(3.5);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

.active-breathing {
    animation: breathe478 19s linear infinite;
}

/* Focus Task Display */
.chosen-task {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.2);
    color: var(--accent-teal);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Progress Ring */
.timer-display {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
}

.progress-ring__circle {
    transition: stroke-dashoffset 1s linear;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring__circle.bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.progress-ring__circle.fg {
    stroke: var(--accent-teal);
    stroke-linecap: round;
}

.time-text {
    position: absolute;
    font-size: 3.5rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.timer-controls {
    display: flex;
    gap: 1rem;
}

@media (max-width: 600px) {
    #app-container {
        padding: 10px;
    }

    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .time-text {
        font-size: 2.8rem;
    }

    .progress-ring {
        height: 160px;
        width: 160px;
    }

    .progress-ring__circle {
        r: 70;
        cx: 80;
        cy: 80;
    }
}