:root {
    --bg-color: #0f172a; /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.4); /* Slate 800 with opacity */
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.5);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.5);
    
    /* Default theme colors for Focus Mode */
    --theme-color: var(--accent-red);
    --theme-glow: var(--accent-red-glow);
}

body.break-mode {
    --theme-color: var(--accent-green);
    --theme-glow: var(--accent-green-glow);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

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

/* Background blob effects */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    border-radius: 50%;
    transition: background 1s ease;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--theme-color);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #6366f1; /* Indigo 500 */
    bottom: -50px;
    right: -50px;
}

.app-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 20px;
    z-index: 1; /* Keep above blobs */
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.header h1 {
    text-align: center;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 1px;
    margin-bottom: 30px;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.timer-display {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.progress-ring {
    transform: rotate(-90deg);
}

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

.progress-ring__circle {
    stroke: var(--theme-color);
    stroke-dasharray: 816.814; /* Default 2*pi*r, JS will recalculate */
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear, stroke 0.5s ease;
    filter: drop-shadow(0 0 8px var(--theme-glow));
}

.time-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#time-left {
    font-size: 4.5rem;
    font-weight: 300;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

#current-mode {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
    font-weight: 600;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.control-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.play-btn, .pause-btn {
    width: 72px;
    height: 72px;
    background: var(--theme-color);
    box-shadow: 0 8px 24px var(--theme-glow);
    color: white; /* Make sure icons stay white */
}

.play-btn:hover, .pause-btn:hover {
    background: var(--theme-color);
    filter: brightness(1.1);
    box-shadow: 0 12px 32px var(--theme-glow);
}

.play-btn svg {
    margin-left: 4px; /* Optical centering for play button icon */
}

.sessions-tracker {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#session-count {
    color: var(--text-primary);
    font-weight: 600;
}

/* Music Integration */
.music-glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.global-music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.global-music-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.music-panel {
    position: fixed;
    top: 90px;
    right: 20px;
    width: 340px;
    height: 320px;
    padding: 15px;
    border-radius: 20px;
    z-index: 90;
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.music-panel.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.video-container {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
}

.video-container iframe {
    border-radius: 12px;
}

.music-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.music-settings input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.3s;
}

.music-settings input:focus {
    border-color: var(--theme-color);
}

.music-settings button {
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s;
}

.music-settings button:hover {
    opacity: 0.8;
}
