:root {
    --primary: #7e22ce;
    --primary-light: #a855f7;
    --secondary: #3b82f6;
    --accent: #f472b6;
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.6) blur(20px);
    z-index: -1;
    transform: scale(1.1);
}

.app-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
}

header {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.timer-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.current-task-input-container {
    width: 100%;
    margin-bottom: 0.5rem;
}

.current-task-input-container input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1rem;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

.current-task-input-container input:focus {
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.3);
}

.timer-modes {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    padding: 0.4rem;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 0.7rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(126, 34, 206, 0.3);
}

.timer-display {
    position: relative;
    margin: 1rem 0;
}

.progress-ring-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.time {
    position: absolute;
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: -2px;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.control-btn {
    flex: 1;
    padding: 1rem;
    border-radius: 1rem;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.primary {
    background: var(--primary);
    color: white;
}

.control-btn.primary:hover {
    background: var(--primary-light);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.control-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.control-btn.danger {
    background: #ef4444;
    color: white;
}

.control-btn.danger:hover {
    background: #f87171;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.control-btn.tertiary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.hidden {
    display: none;
}

.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 1.2rem;
    padding: 1.2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.music-player-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 1.2rem;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.music-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.music-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.icon-btn-text {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn-text:hover {
    transform: scale(1.1);
}

#volume-slider {
    width: 80px;
    height: 4px;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--secondary);
    border-radius: 50%;
    cursor: pointer;
}

.track-selector select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 0.8rem;
    padding: 0.6rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.track-selector select option {
    background: var(--bg-dark);
}

.tasks-container {
    background: var(--glass-bg);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tasks-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.task-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.task-input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    color: white;
    font-family: inherit;
}

.task-input-group button {
    background: var(--secondary);
    border: none;
    color: white;
    padding: 0 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
}

.task-item.completed {
    opacity: 0.5;
}

.task-item.active-session {
    border-color: var(--secondary);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        border-color: rgba(59, 130, 246, 0.5);
    }

    50% {
        border-color: rgba(59, 130, 246, 1);
    }

    100% {
        border-color: rgba(59, 130, 246, 0.5);
    }
}

.task-item.completed .task-text {
    text-decoration: line-through;
}

.task-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--secondary);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.task-checkbox:checked {
    background: var(--secondary);
}

.task-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.task-text {
    flex: 1;
    font-size: 0.95rem;
    transition: color 0.3s;
    cursor: pointer;
}

.task-text:hover {
    color: var(--secondary);
}

.focus-task-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: all 0.3s;
    padding: 0 0.5rem;
}

.focus-task-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.notification-toast.show {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 400px) {
    .app-container {
        padding: 1rem;
    }

    .time {
        font-size: 3.5rem;
    }

    svg.progress-ring {
        width: 250px;
        height: 250px;
    }

    circle {
        r: 115;
        cx: 125;
        cy: 125;
    }
}