/* Basic Reset and Variables */
:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #2196F3; /* Blue */
    --danger-color: #F44336; /* Red */
    --text-color: #333;
    --bg-color: #f4f7f6;
    --card-bg: #fff;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

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

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

.main-header h1 {
    margin-bottom: 0.25rem;
    font-size: 1.8rem;
}

.main-header p {
    font-size: 0.9rem;
}

.main-header a {
    color: #ffd700; /* Gold color for contrast */
    text-decoration: none;
    font-weight: 600;
}

.main-header a:hover {
    text-decoration: underline;
}

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

/* Input Form (Mobile-First) */
.todo-input {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

#todo-form {
    display: flex;
    gap: 0.5rem;
}

#todo-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

#add-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

#add-btn:hover {
    background-color: #1a7ae2;
}

/* Todo List Styling */
.todo-list-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

#todo-list {
    list-style: none;
    padding: 0;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 5px solid transparent;
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.todo-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    padding-right: 0.5rem;
}

.todo-content[data-action="toggle"] {
    cursor: pointer;
}

.todo-text {
    margin-left: 0.75rem;
    word-break: break-word;
    flex-grow: 1;
    transition: color 0.3s, text-decoration 0.3s;
}

/* Checkbox Styling */
.todo-checkbox {
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
}

/* Completion State */
.todo-item.completed {
    border-left-color: var(--primary-color);
    opacity: 0.8;
}

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

/* Action Buttons */
.todo-actions {
    margin-left: 1rem;
    flex-shrink: 0;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s, transform 0.2s;
    line-height: 1;
}

.delete-btn:hover {
    color: #d32f2f;
    transform: scale(1.1);
}

/* Empty State Message */
.empty-message {
    text-align: center;
    color: #888;
    margin-top: 2rem;
    font-style: italic;
}

.hidden {
    display: none !important;
}

/* Footer */
footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: white;
    background-color: var(--text-color);
    margin-top: auto; /* Pushes the footer to the bottom */
}

/* Desktop/Tablet Optimization (>= 768px) */
@media (min-width: 768px) {
    .container {
        max-width: 700px;
        padding: 2rem;
    }
    
    #todo-input {
        padding: 1rem;
    }

    #add-btn {
        padding: 1rem 1.5rem;
    }
}