/* General layout */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: auto;
    background-color: #f4f4f9;
}

.todo-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 600px; /* Max width for container */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2em;
    text-align: center;
    margin-bottom: 20px;
}

input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    margin-top: 5px;
    box-sizing: border-box;
    font-size: 1em;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    margin: 5px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
}

button:hover {
    background-color: #45a049;
}

button:focus {
    outline: none;
}

/* List Styles */
#task-list {
    list-style: none;
    padding: 0;
}

#task-list li {
    background-color: #f9f9f9;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em; /* Smaller font size to make everything fit */
    flex-wrap: wrap; /* Allow text to wrap within each task */
}

#task-list li .task-type,
#task-list li .priority,
#task-list li .remaining-time {
    margin: 5px 0;
    font-size: 0.8em; /* Slightly smaller font size for task details */
}

#task-list li .deadline {
    margin-left: 10px;
    font-size: 0.9em;
}

/* Button styles inside task list items */
#task-list li button {
    margin-left: 10px;
    font-size: 0.8em; /* Slightly smaller text size for buttons */
    padding: 5px 10px;
    width: auto; /* Auto-width for buttons */
}

/* Completed tasks style */
.completed {
    text-decoration: line-through;
    background-color: #d3ffd3; /* Light green background for completed tasks */
}

/* Sorting Buttons */
div > button {
    margin-top: 10px;
    font-size: 1em;
    padding: 10px;
    background-color: #007BFF;
}

div > button:hover {
    background-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .todo-container {
        padding: 15px;
        width: 90%;
    }

    h1 {
        font-size: 1.8em;
    }

    input[type="text"],
    input[type="date"],
    select {
        font-size: 0.9em;
    }

    button {
        font-size: 0.9em;
    }

    #task-list li {
        font-size: 0.85em;
        padding: 10px;
    }

    #task-list li button {
        font-size: 0.75em;
        padding: 4px 8px;
    }
}
/* Existing styles remain the same */

/* Sub-task styles */
.sub-task-form {
    margin-top: 10px;
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    display: none; /* Hidden initially */
    margin-bottom: 10px;
}

.sub-task-form input,
.sub-task-form select {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    margin-top: 5px;
    font-size: 0.9em;
}

.add-sub-task-button {
    background-color: #2196F3;
    padding: 8px 16px;
    font-size: 1em;
    color: white;
    cursor: pointer;
}

.add-sub-task-button:hover {
    background-color: #1976D2;
}

.sub-task-list {
    list-style-type: none;
    padding-left: 0;
}

.sub-task-list li {
    background-color: #e8f5e9;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 0.8em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-task-list li .sub-task-priority {
    font-size: 0.8em;
}

/* Hide sub-task section by default */
.sub-task-section {
    display: none;
    margin-top: 10px;
}

/* Add styling for buttons in task entries */
#task-list li button {
    margin-left: 10px;
    font-size: 0.8em;
    padding: 5px 10px;
}
/* Overdue tasks */
.overdue {
    background-color: #ff4d4d; /* A red shade for overdue tasks */
    color: #ff1a1a; /* A contrasting red text color for visibility */
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    padding: 10px;
    border-radius: 5px;
}

/* Update for buttons inside overdue tasks */
#task-list li.overdue button {
    background-color: #ff1a1a; /* Red button for overdue tasks */
    color: white;
    border: none;
}

#task-list li.overdue button:hover {
    background-color: #cc0000; /* Darker red when hovering */
}


/* Completed tasks style */
.completed {
    text-decoration: line-through;
    background-color: #d3ffd3; /* Light green background for completed tasks */
}

/* Search Bar Styling */
#search-bar {
    padding: 10px;
    font-size: 1em;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ddd;
}
/* Overdue task styling */
.overdue {
    color: red;
    font-weight: bold;
    font-size: 1.1em;
}

/* Completed task style */
.completed {
    text-decoration: line-through;
    background-color: lightblue; /* Light blue background */
    color: blue; /* Text becomes blue */
}

/* Completed task buttons style */
.completed button {
    background-color: blue;
    color: white;
}


