:root {
    --bg-gradient-1: #4facfe;
    --bg-gradient-2: #00f2fe;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #ffffff;
    --btn-hover: rgba(255, 255, 255, 0.2);
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    /* Fallback dark bg */
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Dynamic Mesh Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.5), transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.4), transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(236, 72, 153, 0.4), transparent 50%);
    filter: blur(60px);
    animation: pulseBackground 10s ease-in-out infinite alternate;
}

@keyframes pulseBackground {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

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

/* Glass Container */
.glass-container {
    width: 90%;
    max-width: 1200px;
    padding: 2rem;
    border-radius: 24px;
    /* Optional: Outer glass effect for the whole app container */
    /* background: rgba(255, 255, 255, 0.05); */
    /* backdrop-filter: blur(10px); */
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    /* Timer, Sounds | Tasks spans row 2 */
    gap: 2rem;
}

/* Specific Layout for functionality */
.timer-panel {
    grid-column: 1 / 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sound-panel {
    grid-column: 2 / 3;
}

.tasks-panel {
    grid-column: 1 / -1;
    /* Full width on bottom */
}

/* Glass Panel Component */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-4px);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

/* Timer Specifics */
.timer-display {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 565.48;
    /* 2 * PI * r */
    stroke-dashoffset: 0;
}

.time-text {
    position: absolute;
    font-size: 3rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

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

.mode-toggles {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 99px;
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: white;
    color: #1a1a2e;
    padding: 0.75rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.mode-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Sounds */
.sound-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sound-btn {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

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

.sound-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.sound-btn .icon {
    font-size: 1.5rem;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input[type=range] {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Tasks */
.add-task-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#task-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
}

#task-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#task-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.btn-icon {
    width: 48px;
    height: 48px;
    /* Match input height roughly */
    border-radius: 12px;
    background: white;
    color: #1a1a2e;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
}

.task-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.task-item.completed .task-checkbox {
    background: #10b981;
    /* Green accent */
    border-color: #10b981;
}

.task-item.completed .task-checkbox::after {
    content: '✓';
    color: white;
    font-size: 0.8rem;
}

.task-text {
    flex-grow: 1;
    font-size: 1rem;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.4);
}

.delete-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.25rem;
    padding: 0.25rem;
}

.delete-btn:hover {
    color: #ef4444;
    /* Red accent */
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .timer-panel,
    .sound-panel,
    .tasks-panel {
        grid-column: 1 / -1;
    }

    header h1 {
        font-size: 2.5rem;
    }
}