:root {
    --bg-color: #0b1120;
    --bg-gradient-1: rgba(59, 130, 246, 0.15);
    --bg-gradient-2: rgba(239, 68, 68, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-danger: #ef4444;
    --accent-danger-hover: #dc2626;
    --accent-warning: #f59e0b;
    --accent-warning-hover: #d97706;
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --ring-glow: 0 0 20px rgba(59, 130, 246, 0.5);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, var(--bg-gradient-1) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, var(--bg-gradient-2) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    perspective: 1000px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.timer-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 48px;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}

/* Ensure the stroke color is updated via JS / CSS vars correctly */
.progress-ring__circle {
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
    filter: drop-shadow(var(--ring-glow));
}

.time-display {
    font-size: 4.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    z-index: 10;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.controls {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-bottom: 24px;
}

.btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn:hover::after {
    opacity: 1;
}

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

.btn-primary {
    background-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
}

.btn-primary.paused {
    background-color: var(--accent-warning);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.btn-primary.paused:hover {
    background-color: var(--accent-warning-hover);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

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

.status {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color 0.3s ease;
}

.settings {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.settings.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.settings-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 1rem;
    width: 80px;
    outline: none;
    transition: all 0.2s ease;
}

.glass-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.glass-input::-webkit-inner-spin-button, 
.glass-input::-webkit-outer-spin-button {
    -webkit-appearance: none; 
    margin: 0; 
}

.glass-input[type=number] {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

@media (max-width: 400px) {
    .timer-container {
        width: 260px;
        height: 260px;
    }
    .progress-ring {
        transform: rotate(-90deg) scale(0.866); /* 260/300 */
        transform-origin: center;
    }
    .time-display {
        font-size: 4rem;
    }
    h1 {
        font-size: 1.8rem;
    }
}
