/* General Reset and Base Styles */
:root {
    --primary-color: #3f51b5; /* Indigo */
    --accent-color: #ff9800; /* Orange */
    --danger-color: #f44336; /* Red */
    --success-color: #4caf50; /* Green */
    --bg-color: #f7f9fc;
    --text-color: #333;
    --card-bg: #fff;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, 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 */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.app-title {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    /* Specific user request: make the title green */
    color: var(--success-color); 
}

.header p {
    font-size: 0.85rem;
}

.header a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

.header a:hover {
    color: white;
}

/* Main Container */
.container {
    flex-grow: 1;
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Form Styling */
#todo-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#todo-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 2px 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 {
    padding: 0.75rem 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#add-btn:hover {
    background-color: #303f9f; /* Darker primary */
}

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

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

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

/* Completed Task Styling */
.completed .task-text {
    text-decoration: line-through;
    color: #999;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

/* Action Buttons */
.delete-btn, .toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s;
}

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

.toggle-btn {
    color: var(--success-color);
}

.delete-btn:hover {
    background: rgba(244, 67, 54, 0.1);
}

.toggle-btn:hover {
    background: rgba(76, 175, 80, 0.1);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #todo-form {
        flex-direction: column;
    }

    #add-btn {
        width: 100%;
    }

    .container {
        width: 95%;
        padding: 1rem;
    }
    
    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.8rem;
    }

    .task-text {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Footer Styling */
.footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    background-color: #e0e0e0;
    margin-top: auto;
}