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

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #334155;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --high: #ef4444;
    --medium: #f59e0b;
    --low: #10b981;
    --success: #22c55e;
    --danger: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    min-height: 100vh;
    color: var(--text);
    padding: 24px 16px;
    display: flex;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 720px;
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.app-header {
    text-align: center;
    margin-bottom: 24px;
}

.app-header h1 {
    font-size: 2rem;
    margin-bottom: 4px;
}

.rocket {
    display: inline-block;
    animation: float 2.4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ----- Progress ----- */
.progress-section {
    margin-bottom: 20px;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.progress-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.4s ease;
}

/* ----- Add task ----- */
.add-task form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
#taskInput {
    flex: 1 1 240px;
    min-width: 0;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
#taskInput:focus {
    border-color: var(--primary);
}
#prioritySelect {
    padding: 12px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-add {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-add:hover  { background: var(--primary-hover); }
.btn-add:active { transform: scale(0.97); }

/* ----- Controls ----- */
.controls {
    margin-bottom: 16px;
}
#searchInput {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 10px;
    outline: none;
}
#searchInput:focus { border-color: var(--primary); }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-btn {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { color: var(--text); border-color: var(--primary); }
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ----- Task list ----- */
.task-list {
    list-style: none;
    margin-bottom: 16px;
    max-height: 480px;
    overflow-y: auto;
}
.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-left: 4px solid var(--medium);
    border-radius: 10px;
    margin-bottom: 8px;
    animation: slideIn 0.25s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.task-item.priority-high   { border-left-color: var(--high);   }
.task-item.priority-medium { border-left-color: var(--medium); }
.task-item.priority-low    { border-left-color: var(--low);    }

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--success);
    flex-shrink: 0;
}
.task-text {
    flex: 1;
    font-size: 0.95rem;
    word-break: break-word;
}
.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}
.task-priority {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.priority-high  .task-priority { background: rgba(239, 68, 68, 0.2);  color: var(--high);   }
.priority-medium .task-priority { background: rgba(245, 158, 11, 0.2); color: var(--medium); }
.priority-low   .task-priority { background: rgba(16, 185, 129, 0.2); color: var(--low);    }

.task-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.task-delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ----- Footer ----- */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.btn-clear {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.btn-clear:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Scrollbar */
.task-list::-webkit-scrollbar       { width: 6px; }
.task-list::-webkit-scrollbar-track { background: transparent; }
.task-list::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }

@media (max-width: 480px) {
    .app { padding: 20px; }
    .app-header h1 { font-size: 1.5rem; }
    .btn-add { width: 100%; }
}

