:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --border: #e5e7eb;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.app-container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.app-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.app-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.todo-form {
    display: flex;
    padding: 1.5rem 2rem;
    gap: 0.75rem;
}

.todo-input {
    flex-grow: 1;
    padding: 0.8rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.todo-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.add-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: background-color 0.2s, transform 0.1s;
}

.add-btn:hover {
    background-color: var(--primary-hover);
}

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

.filter-controls {
    display: flex;
    gap: 1.5rem;
    padding: 0 2rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-controls span {
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 500;
}

.filter-controls span:hover {
    color: var(--text-main);
}

.filter-controls span.active {
    color: var(--primary);
}

.todo-list {
    list-style: none;
    padding: 0 1rem;
    max-height: 350px;
    overflow-y: auto;
}

/* Custom Scrollbar */
.todo-list::-webkit-scrollbar {
    width: 6px;
}
.todo-list::-webkit-scrollbar-track {
    background: transparent;
}
.todo-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
    margin-bottom: 0.25rem;
    animation: fadeIn 0.3s ease;
}

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

.todo-item:hover {
    background-color: #f9fafb;
}

/* Checkbox hide and label styling for custom checkbox */
.todo-checkbox {
    display: none;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    margin-right: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.custom-checkbox i {
    color: white;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.todo-checkbox:checked + .custom-checkbox {
    background-color: var(--success);
    border-color: var(--success);
}

.todo-checkbox:checked + .custom-checkbox i {
    opacity: 1;
}

.todo-text {
    flex-grow: 1;
    font-size: 1rem;
    transition: color 0.2s, text-decoration 0.2s;
}

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

.delete-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.todo-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--danger);
}

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--danger-hover);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.back-link {
    position: absolute;
    top: 2rem;
    left: 2rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-main);
}
