@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --gradient: linear-gradient(135deg, var(--primary), var(--accent));
}

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

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

h1 {
    font-size: clamp(1.75rem, 6vw + 1rem, 3rem);
    font-weight: 600;
    margin-bottom: 8px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 2vw + 0.5rem, 1rem);
    font-weight: 300;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    position: relative;
}

input[type="text"] {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.add-btn {
    background: var(--gradient);
    border: none;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-btn:hover {
    transform: scale(1.05) rotate(90deg);
    filter: brightness(1.1);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 6px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 0 4px;
}

.todo-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: transparent;
}

.todo-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.todo-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border);
    transform: translateY(-2px);
}

.checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.todo-item.completed .checkbox {
    background: var(--primary);
}

.todo-item.completed .checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.todo-text {
    flex: 1;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.todo-item.completed .todo-text {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.6;
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}
