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

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --border: #e2e8f0;
    --shadow: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
    --radius: 16px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 10px 25px rgba(0,0,0,0.4);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #e2e8f0 100%);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 32px;
}

.theme-toggle {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.theme-toggle .sun,
.theme-toggle .moon {
    font-size: 20px;
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle .sun {
    opacity: 0;
    transform: translateX(-10px);
}

[data-theme="dark"] .theme-toggle .moon {
    opacity: 1;
    transform: translateX(0);
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.add-task-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

#taskInput {
    flex: 1;
    padding: 18px 22px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

#taskInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.add-btn {
    padding: 18px 28px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.add-btn:active {
    transform: translateY(-1px);
}

.plus-icon {
    font-size: 20px;
    font-weight: bold;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-item {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
}

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

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.tasks-list {
    flex: 1;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.task-item {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: translateY(30px);
    animation: slideIn 0.5s ease forwards;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-item.completed {
    opacity: 0.7;
    background: linear-gradient(135deg, var(--bg-card), rgba(16, 185, 129, 0.1));
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.task-checkbox.checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.task-text {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

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

.delete-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.task-item:hover .delete-btn {
    opacity: 1;
    transform: scale(1);
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    margin: 50px 0;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.clear-section {
    text-align: center;
}

.clear-btn {
    padding: 12px 30px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .container {
        padding: 15px;
    }
    
    .add-task-section {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}