:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

.dark-theme {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #f5f5f5;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    transition: var(--transition);
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: rotate(30deg);
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.input-group {
    display: flex;
    margin-bottom: 20px;
}

#todo-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background-color: var(--card-bg);
    color: var(--text-color);
}

#todo-input:focus {
    border-color: var(--primary-color);
}

#add-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

#add-button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.tasks-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.tasks-container::-webkit-scrollbar {
    width: 8px;
}

.tasks-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tasks-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.tasks-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

ul {
    list-style-type: none;
}

.todo-item {
    background-color: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.todo-item:hover {
    transform: translateX(3px);
}

.todo-text {
    flex: 1;
    margin-left: 15px;
    font-size: 1.05rem;
    transition: var(--transition);
}

.completed .todo-text {
    text-decoration: line-through;
    color: #888;
}

.todo-actions {
    display: flex;
    gap: 10px;
}

.checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.completed .checkbox {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.checkbox i {
    color: white;
    font-size: 12px;
    display: none;
}

.completed .checkbox i {
    display: block;
}

.btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    color: var(--text-color);
}

.btn:hover {
    transform: scale(1.2);
}

.btn.delete-btn {
    color: var(--danger-color);
}

.stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #777;
    margin-top: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: #888;
    display: none;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    opacity: 0.5;
}

@media (max-width: 500px) {
    .container {
        width: 95%;
        margin: 20px auto;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}