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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.todo-wrapper {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    animation: slideIn 0.3s ease;
}

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

h1 {
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    font-size: 28px;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.todo-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.todo-input:focus {
    outline: none;
    border-color: #667eea;
}

.add-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    display: block;
    color: #667eea;
    font-size: 24px;
    font-weight: 700;
}

.filter-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.todo-list {
    list-style: none;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
    border-left: 4px solid #667eea;
}

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

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #999;
}

.checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.todo-text {
    flex: 1;
    color: #333;
    font-size: 16px;
    word-break: break-word;
}

.todo-time {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

.delete-btn {
    padding: 6px 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s, transform 0.2s;
}

.delete-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

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

.action-section {
    text-align: center;
    margin-bottom: 15px;
}

.clear-btn {
    padding: 10px 20px;
    background: #ffa500;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: #ff8c00;
}

.clear-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
    display: none;
}

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

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

.todo-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .todo-wrapper {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .input-section {
        flex-direction: column;
    }

    .add-btn {
        width: 100%;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .filter-section {
        flex-wrap: wrap;
    }

    .todo-item {
        flex-wrap: wrap;
    }

    .todo-time {
        margin-left: 0;
        width: 100%;
    }
}