/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    margin-top: 100px; /* Added to account for fixed header height */
}

/* Header styles */
header {
    background-color: #000;
    color: white;
    padding: 8px 0; /* Reduced vertical padding to half of current amount */
    text-align: center;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1 {
    font-size: 1.2rem; /* Reduced size */
    font-weight: 600;
    letter-spacing: -0.2px;
    padding-top: 8px; /* Reduced to half of current amount */
    padding-bottom: 8px; /* Reduced to half of current amount */
}

/* Add task section */
.add-task {
    display: flex;
    margin-bottom: 30px;
    gap: 10px;
}

#taskInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#taskInput:focus {
    border-color: #000;
}

button {
    padding: 12px 24px;
    background-color: #000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #333;
}

/* Filter buttons */
.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filters button {
    padding: 8px 16px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #000; /* Ensure black text for unselected buttons */
    transition: all 0.3s ease;
}

.filters button.active {
    background-color: #000;
    color: white;
    border-color: #000;
}

/* Sort options */
.sort-options {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

#sortBy {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #fff;
}

/* Task list */
.task-list {
    margin-top: 20px;
}

#tasks {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.task-item:hover {
    background-color: #f5f5f5;
}

.task-item.completed {
    opacity: 0.7;
}

.task-text {
    flex: 1;
    font-size: 1rem;
}

.task-date {
    color: #888;
    font-size: 0.8rem;
    margin-right: 20px;
}

.task-actions {
    display: flex;
    gap: 5px;
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .add-task {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .filters {
        flex-wrap: wrap;
    }

    .sort-options {
        flex-direction: column;
        align-items: stretch;
    }

    #sortBy {
        width: 100%;
    }
}
