:root {
    --primary-color: #3b82f6; /* Blue */
    --secondary-color: #10b981; /* Green */
    --delete-color: #ef4444; /* Red */
    --bg-light: #f9fafb;
    --bg-dark: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.header a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.header a:hover {
    color: white;
}

/* Main Content Layout */
.container {
    max-width: 90%;
    margin: 2rem auto;
    padding: 1rem;
    flex-grow: 1;
}

/* Todo Form */
#todo-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

#todo-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#todo-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

#add-btn:hover {
    background-color: #2563eb;
}

#add-btn:active {
    transform: scale(0.98);
}

/* Todo List */
#todo-list {
    list-style: none;
    padding: 0;
}

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background 0.3s;
}

.task-text {
    flex-grow: 1;
    margin-right: 1rem;
    word-break: break-word;
}

.todo-item.completed {
    border-left-color: var(--secondary-color);
    background: #f0fdf4; /* Very light green background */
}

.todo-item.completed .task-text {
    text-decoration: line-through;
    color: #6b7280;
}

.todo-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity 0.3s, background-color 0.3s;
}

.complete-btn {
    background-color: var(--secondary-color);
    color: white;
}

.complete-btn:hover {
    background-color: #059669;
}

.delete-btn {
    background-color: var(--delete-color);
    color: white;
}

.delete-btn:hover {
    background-color: #dc2626;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: auto; /* Push to the bottom */
}

/* --- Media Queries for larger screens (Tablet/Desktop) --- */
@media (min-width: 768px) {
    .container {
        max-width: 700px;
    }

    .header h1 {
        font-size: 2rem;
    }
    
    .todo-item {
        padding: 1.2rem 1.5rem;
    }
    
    .action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}