@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/*
=================================================================
| TABLE OF CONTENTS
=================================================================
|
| 1. GLOBAL STYLES
| 2. LAYOUT & APP STRUCTURE
| 3. FORMS, CONTROLS & INPUTS
| 4. TASK LIST (MAIN COMPONENT)
| 5. TASK ITEM INTERNALS
| 6. TASK STATES & MODIFIERS
| 7. UTILITY & REUSABLE COMPONENTS
|
=================================================================
*/


/* =================================================================
    1. GLOBAL STYLES
================================================================= */

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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(-45deg, #3a1c71, #d76d77, #ffaf7b);
    background-size: 400% 400%;
    color: #212529;
    animation: gradient-animation 15s ease infinite;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.4s, color 0.4s;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* =================================================================
    2. LAYOUT & APP STRUCTURE
================================================================= */

.container {
    width: 100%;
    max-width: 1200px;
    padding: 25px 30px 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: background 0.4s, box-shadow 0.4s;
}

.todo-app {
    width: 100%;
}

.todo-app header {
    margin-bottom: 24px;
}

.tagline {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #002765;
}

.subheading {
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.app-footer {
    width: 100%;
    padding-top: 16px;
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #eee;
    border-radius: 15px;
    color: #555;
    font-size: 15px;
    text-align: center;
}

.app-footer a {
    margin: 0 7px;
    color: #007bff;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.18s;
}

.app-footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}


/* =================================================================
    3. FORMS, CONTROLS & INPUTS
================================================================= */

/* --- Main "Add Task" Input Row --- */
.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 20px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    transition: background 0.4s;
}

.row input,
.row select,
.row input[type="date"] {
    flex-grow: 1;
    min-width: 120px;
    padding: 12px 10px;
    border: 1px solid #ddd;
    outline: none;
    border-radius: 8px;
    background: #fff;
    color: #212529;
    font-size: 16px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

/* Update the focus state for all inputs and selects to a softer, elegant style */
.row input:focus,
.row select:focus,
.row input[type="date"]:focus,
.filter-group select:focus,
.search-full-width input:focus,
ul#list-container li.editing .edit-row input:focus,
ul#list-container li.editing .edit-row select:focus,
ul#list-container li.editing .edit-row textarea:focus {
    background: #fff;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none; /* This is key to removing the default black border */
}

#add-btn {
    flex-shrink: 0;
    min-width: 100px;
    padding: 12px 24px;
    border: none;
    outline: none;
    border-radius: 8px;
    background: #008000;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#add-btn:hover {
    background-color: #006400;
    transform: scale(1.05);
}

.row select#priority-select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%20197.973L146.2%2057.173%205.4%20197.973H287z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

/* --- Global Search Bar (Full Width) --- */
.search-full-width {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 20px;
}

.search-full-width label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

#search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- Control Bars (Filter, Sort, Actions) --- */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.left-side-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.right-side-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.filter-sort-group,
.task-delete-actions,
.file-controls {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.filter-group,
.sort-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label,
.sort-group label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select,
.sort-group select {
    width: 150px;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    font-size: 14px;
    appearance: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/*
* Consistent styling for Export and Import buttons
*/
#export-btn,
#import-file-label {
    background-color: #6c757d; /* Modern gray */
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
}

#export-btn:hover,
#import-file-label:hover {
    background-color: #5a6268; /* Slightly darker gray on hover */
}

/*
* Distinct styling for the "Enable Web Notifications" button
*/
/*
* File Management Buttons
*/
.file-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Base styling for all buttons and labels in the file-controls group */
.file-controls button,
.file-controls label {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
    color: #fff;
}

#dark-mode-toggle {
    background-color: #545454;
}

#dark-mode-toggle:hover {
    background-color: #333;
}

#export-btn {
    background-color: #6c757d; /* Modern gray */
}

#import-file-label {
    background-color: #6c757d; /* Modern gray */
}

#export-btn:hover,
#import-file-label:hover {
    background-color: #5a6268;
}


/*
* Distinct styling for the "Enable Web Notifications" button
*/
#enable-notifications-btn {
    background-color: #428bca; /* A light blue color */
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9em;
    cursor: pointer;
    width: 100%; /* This makes the button fill the width of its container */
    transition: background-color 0.3s ease;
}

#enable-notifications-btn:hover {
    background-color: #3276b1; /* A darker blue on hover */
}

/*
* Styling for the "Delete" and "Delete All" buttons
*/
/*
* Base styling for all delete buttons
*/
.task-delete-btn {
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
}

/*
* Styling for the "Delete Completed" button (which is now "Delete")
*/
#clear-completed-btn {
    background-color: #ffc107; /* A yellow color */
}

#clear-completed-btn:hover {
    background-color: #e0a800; /* A darker yellow on hover */
}


/*
* Specific styling for the "Delete All" button
*/
#clear-all-btn {
    background-color: #dc3545; /* A red color */
}

#clear-all-btn:hover {
    background-color: #c82333; /* A darker red on hover */
}
#save-btn {
    background-color: #17a2b8;
    border-color: #17a2b8;
}
#save-btn:hover {
    background-color: #138496;
}

.file-controls .import-label {
    border-color: #6c757d;
    background-color: #6c757d;
}
.file-controls .import-label:hover {
    background-color: #5a6268;
}

.flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* --- Pagination --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.pagination-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #007bff;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.pagination-controls button:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.pagination-controls button:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.pagination-controls #page-indicator {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}


/* =================================================================
    4. TASK LIST (MAIN COMPONENT)
================================================================= */

ul#list-container {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

ul#list-container li {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 8px 12px 50px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 17px;
    user-select: none;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(.36,1.27,.59,1.02);
}

/* Styling for individual tags */
.task-tags {
    display: flex;
    flex-wrap: wrap;
    margin-top: 5px;
}

.task-tag {
    background-color: var(--tag-bg-color);
    color: var(--tag-text-color);
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    margin-right: 5px; /* Adds space to the right of each tag */
    margin-bottom: 5px; /* Adds space below each tag for wrapping */
}

/* Styling for the Notes Icon */
.task-notes-indicator {
    color: var(--icon-color);
    margin-left: 10px;
    cursor: help;
    transition: color 0.2s;
}

.task-notes-indicator:hover {
    color: var(--primary-color);
}

/* =================================================================
    5. TASK ITEM INTERNALS
================================================================= */

/* --- Content & Layout --- */
.flex-task-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}



.task-content-left {
    flex: 2 1 0%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding-right: 20px;
}

.task-content-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    min-width: 160px;
}

/* --- Typography & Info --- */
.task-name {
    display: block;
    font-weight: 500;
}

.task-info {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 4px;
    /* Optional: Add a little space between the title and metadata */
}

.task-info span {
    display: inline-block;
    margin-right: 15px;
    /* This adds space between each item in the meta-info */
}

.task-due-date {
    margin-right: 10px;
    color: #888;
    font-size: 13px;
    white-space: nowrap;
}

.task-created-date {
    display: inline-block;
    margin-left: 10px;
    color: #888;
    font-size: 12px;
}




/* --- Visual Indicators for Light Mode --- */


/*
* Final consolidated and corrected styles. This approach uses highly specific
* selectors to ensure there are no conflicts between due status and priority.
*/

/* =================================================================
    Visual Indicators & Task States
================================================================= */

/* =================================================================
    Visual Indicators & Task States
================================================================= */
/* We use the priority bar for tasks that are NOT due soon */
ul#list-container li.task-item .priority-bar {
    width: 5px;
    background-color: #ccc;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 5px 0 0 5px;
}
ul#list-container li.task-item.priority-high .priority-bar {
    background-color: #dc3545;
}
ul#list-container li.task-item.priority-medium .priority-bar {
    background-color: #ffc107;
}
ul#list-container li.task-item.priority-low .priority-bar {
    background-color: #28a745;
}

/* Eye-catching indicator for tasks due today */
ul#list-container li.task-item.due-today {
    border: 2px solid #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    background-color: rgba(231, 76, 60, 0.1);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Eye-catching indicator for tasks due this week */
ul#list-container li.task-item.due-this-week {
    border: 2px solid #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    background-color: rgba(241, 196, 15, 0.1);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

/* Glowing effect for tasks that are "due soon" (within 72 hours) */
ul#list-container li.task-item.due-glow.priority-high {
    border: 2px solid #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.01);
    transition: all 0.3s ease;
}
ul#list-container li.task-item.due-glow.priority-medium {
    border: 2px solid #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    background-color: rgba(255, 193, 7, 0.1);
    transform: scale(1.01);
    transition: all 0.3s ease;
}
ul#list-container li.task-item.due-glow.priority-low {
    border: 2px solid #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    background-color: rgba(40, 167, 69, 0.1);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

/* Dark Mode Overrides for all task states */
body.dark-mode ul#list-container li.task-item.priority-high .priority-bar {
    background-color: #ff6b6b;
}
body.dark-mode ul#list-container li.task-item.priority-medium .priority-bar {
    background-color: #ffe66d;
}
body.dark-mode ul#list-container li.task-item.priority-low .priority-bar {
    background-color: #6c757d;
}

body.dark-mode ul#list-container li.task-item.due-today {
    border: 2px solid #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    background-color: rgba(255, 107, 107, 0.1);
    color: #fff;
}

body.dark-mode ul#list-container li.task-item.due-this-week {
    border: 2px solid #ffe66d;
    box-shadow: 0 0 10px rgba(255, 230, 109, 0.5);
    background-color: rgba(255, 230, 109, 0.1);
    color: #fff;
}
body.dark-mode ul#list-container li.task-item.due-glow.priority-high {
    border: 2px solid #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    background-color: rgba(255, 107, 107, 0.1);
    color: #fff;
}
body.dark-mode ul#list-container li.task-item.due-glow.priority-medium {
    border: 2px solid #ffe66d;
    box-shadow: 0 0 10px rgba(255, 230, 109, 0.5);
    background-color: rgba(255, 230, 109, 0.1);
    color: #fff;
}
body.dark-mode ul#list-container li.task-item.due-glow.priority-low {
    border: 2px solid #6c757d;
    box-shadow: 0 0 10px rgba(108, 117, 125, 0.5);
    background-color: rgba(108, 117, 125, 0.1);
    color: #fff;
}

/* --- Visual Indicators for Dark Mode --- */


.edit-row input[type="text"],
.edit-row input[type="date"],
.edit-row select,
.edit-row textarea {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.dark-mode .edit-row input,
.dark-mode .edit-row select,
.dark-mode .edit-row textarea {
    background-color: #495057;
    color: #e9ecef;
    border-color: #6c757d;
}

/* --- Edit Form Styles --- */
.task-item.editing {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in-out;
}

.dark-mode .task-item.editing {
    background-color: #343a40;
    box-shadow: 4px 6px rgba(0, 0, 0, 0.3);
}

.edit-form-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px; /* ✅ Add padding to keep fields off the edges */
}

.edit-row-grouped {
    display: grid;
    /* 3fr for Task Name, 1fr for Priority, 1fr for Due Date, 2fr for Tags */
    grid-template-columns: 3fr 1fr 1fr 2fr;
    gap: 15px;
    align-items: flex-start;
}
.edit-form-container input[type="text"],
.edit-form-container input[type="date"],
.edit-form-container select,
.edit-form-container textarea {
    width: 100%;
    padding: 8px 12px; /* Match search input */
    border: 1px solid #ccc; /* Match search input */
    border-radius: 8px; /* Match search input */
    background-color: #fff;
    color: #333;
    font-size: 16px; /* Match search input */
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s; /* Smooth focus effect */
}

.dark-mode .edit-form-container input,
.dark-mode .edit-form-container select,
.dark-mode .edit-form-container textarea {
    background-color: #495057;
    color: #e9ecef;
    border-color: #6c757d;
}

/* Optional: Add a subtle hover or focus style for consistency */
.edit-form-container input:focus,
.edit-form-container select:focus,
.edit-form-container textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.25);
}


/* This media query ensures the layout is still usable on smaller screens */
@media (max-width: 992px) {
    .edit-row-grouped {
        /* On smaller screens, go back to a single column */
        grid-template-columns: 1fr;
    }
}

.edit-field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.edit-field-full {
    flex: 1 1 100%;
}

.edit-field-half {
    flex: 1 1 45%;
}

.edit-row label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #495057;
    font-size: 14px;
}

.dark-mode .edit-row label {
    color: #e9ecef;
}

.edit-row input[type="text"],
.edit-row input[type="date"],
.edit-row select,


.dark-mode .edit-row input,
.dark-mode .edit-row select,


.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.edit-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.save-edit-btn {
    background-color: #28a745;
    color: white;
}

.save-edit-btn:hover {
    background-color: #218838;
}

.cancel-edit-btn {
    background-color: #dc3545;
    color: white;
}

.cancel-edit-btn:hover {
    background-color: #c82333;
}



.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.edit-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.save-edit-btn {
    background-color: #28a745;
    color: white;
}

.save-edit-btn:hover {
    background-color: #218838;
}

.cancel-edit-btn {
    background-color: #dc3545;
    color: white;
}

.cancel-edit-btn:hover {
    background-color: #c82333;
}

/* --- Priority Bar --- */
.priority-bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    border-radius: 8px 0 0 8px;
}

.complete-edit-btn {
    background-color: #2196F3;
    color: white;
}

.complete-edit-btn:hover {
    background-color: #0b7dda;
}

ul#list-container li .priority-bar.high {
    background-color: #dc3545;
}

ul#list-container li .priority-bar.medium {
    background-color: #ffc107;
}

ul#list-container li .priority-bar.low {
    background-color: #28a745;
}

/* --- Action Buttons --- */
.task-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.task-buttons span {
    display: block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.14s, color 0.14s;
}

/* Edit button styles */
.edit-btn i {
    font-size: 20px;
    color: #888;
    transition: color 0.14s;
}

.edit-btn:hover i {
    color: #007bff;
    transform: scale(1.17);
}

/* Complete button styles */
.complete-btn i {
    font-size: 20px;
    color: #888;
    transition: color 0.14s;
}

.complete-btn:hover i {
    color: #28a745;
    transform: scale(1.17);
}

/* Delete button styles */
.delete-btn i {
    font-size: 20px;
    color: #888;
    transition: color 0.14s;
}

.delete-btn:hover i {
    color: #dc3545;
    transform: scale(1.17);
}

/* Archive button styles */
.archive-btn i {
    font-size: 20px;
    color: #888;
    transition: color 0.14s;
}

.archive-btn:hover i {
    color: #6c757d;
    transform: scale(1.17);
}

/* Unarchive button styles */
.unarchive-btn i {
    font-size: 20px;
    color: #888;
    transition: color 0.14s;
}

.unarchive-btn:hover i {
    color: #6c757d;
    transform: scale(1.17);
}


/* =================================================================
    6. TASK STATES & MODIFIERS
================================================================= */

/* --- Hover, Focus & Active States --- */
ul#list-container li:not(.completed):not(.editing):hover {
    background: #f5f5f5;
    box-shadow: 0 6px 18px 0 rgba(60,60,60,0.14);
    z-index: 1;
    transition: background 0.15s, box-shadow 0.18s;
}

ul#list-container li.active,
ul#list-container li:focus {
    background: #d1f5ef;
    outline: 2px solid #20c997;
}

/* uimanager.css */
/* Add this to a pre-existing CSS file. This is a compilation of styles discussed. */

/* style.css */

/* --- Task List Container and Items --- */

#list-container {
    padding: 0;
    margin-top: 20px;
    list-style: none;
}

#list-container li.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px 12px 12px;
    font-size: 17px;
    position: relative;
    list-style: none;
    border-radius: 5px;
    margin-bottom: 10px;
    color: var(--task-text-color);
    background-color: var(--task-bg-color);
    border: 1px solid var(--task-border-color);
    transition: all 0.2s ease-in-out;
}

#list-container li.task-item.completed {
    text-decoration: line-through;
    opacity: 0.6;
    background-color: var(--task-completed-bg-color);
}

.flex-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.task-content-left {
    flex-grow: 1;
}

.task-buttons {
    display: flex;
    align-items: center;
    margin-left: 10px;
}


/* --- Button Styles --- */

.task-item-controls {
    border: none;
    background: #343a40; /* Default background for dark-mode */
    color: #fff;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
    white-space: nowrap;
    text-transform: capitalize;
}

.task-item-controls:hover {
    transform: translateY(-2px); /* A subtle lift on hover */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.task-item-controls.toggle-completion-btn {
    background-color: #28a745;
}

.task-item-controls.toggle-completion-btn:hover {
    background-color: #218838;
}

.task-item-controls.edit-btn {
    background-color: #007bff;
}

.task-item-controls.edit-btn:hover {
    background-color: #0069d9;
}

.task-item-controls.archive-btn, .task-item-controls.unarchive-btn {
    background-color: #6c757d;
}

.task-item-controls.archive-btn:hover, .task-item-controls.unarchive-btn:hover {
    background-color: #5a6268;
}

.task-item-controls.delete-btn {
    background-color: #dc3545;
}

.task-item-controls.delete-btn:hover {
    background-color: #c82333;
}

/* Add these new rules to style the icons on hover */
.task-buttons span {
    transition: transform 0.2s, color 0.2s; /* Smooth transition for all icons */
    cursor: pointer;
}

.task-buttons span:hover i {
    transform: scale(1.2); /* Makes the icon bigger */
    color: var(--icon-hover-color); /* Change this to your desired hover color */
}

/* Specific styling for the checkbox icon */
.task-checkbox-icon {
    font-size: 20px;
    margin-right: 15px;
}

.task-checkbox-icon i {
    transition: transform 0.2s, color 0.2s;
}

.task-checkbox-icon:hover i {
    transform: scale(1.2);
    color: var(--primary-color);
}
/* --- Completed State --- */
ul#list-container li.completed {
    background: #e9ecef;
    color: #6c757d;
    text-decoration: line-through;
    opacity: 0.6;
}

ul#list-container li.completed .priority-bar {
    background-color: #555;
}

/* --- Overdue & Due Today States --- */
li.overdue {
    background: #fff0f0;
    border-left: 6px solid #e63946 !important;
}

.task-due-date.today {
    padding: 2px 10px;
    border: 2px solid #f58634;
    border-radius: 8px;
    background: #fff8ec;
    box-shadow: 0 0 0 3px #fff8ec;
    color: #f58634;
    font-weight: 700;
}

/* --- Editing State (Consolidated) --- */
ul#list-container li.editing {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
}

ul#list-container li.editing .priority-bar {
    display: none;
}

ul#list-container li.editing .edit-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 14px 20px 0;
}

ul#list-container li.editing .edit-input-group input,
ul#list-container li.editing .edit-input-group select {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    outline: none;
    font-size: 16px;
    color: #212529;
}

ul#list-container li.editing .edit-notes-group {
    width: 100%;
    padding: 0 20px;
}



ul#list-container li.editing .edit-input-notes {
    width: 100%;
    min-height: 70px;
    max-height: 200px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    font-size: 16px;
    resize: vertical;
    outline: none;
    line-height: 1.4;
    color: #212529;
}

ul#list-container li.editing .edit-buttons-wrapper {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    width: 100%;
    padding: 0 20px 14px;
}

.save-edit-btn,
.cancel-edit-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
}

.save-edit-btn {
    background-color: #28a745;
    color: #fff;
}

.save-edit-btn:hover {
    background-color: #218838;
}

.cancel-edit-btn {
    background-color: #6c757d;
    color: #fff;
}

.cancel-edit-btn:hover {
    background-color: #5a6268;
}

ul#list-container li.editing .task-buttons {
    display: none;
}

li.removed {
    transform: scale(0.96) translateY(10px);
    opacity: 0;
}



/* --- Dynamic Classes for JS functionality --- */
.show {
    display: flex;
}

.hide {
    display: none;
}


/* =================================================================
    7. UTILITY & REUSABLE COMPONENTS
================================================================= */
/* --- SortableJS Ghost Helper --- */
.sortable-ghost {
    background: #ffeeba !important;
    border: 2px dashed #e67e22 !important;
    opacity: 0.6;
}
/* =================================================================
    8. FLATICKR OVERRIDES
================================================================= */
/* =================================================================
    8. FLATPICKR OVERRIDES
================================================================= */
.flatpickr-calendar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px; /* Ensure consistency across the picker */
}

/* Month and year selectors */
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month .numInputWrapper span {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
}

/* Days */
.flatpickr-day {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    border-radius: 6px; /* Matches your inputs' rounded corners */
    transition: background 0.2s, color 0.2s;
}

/* Day hover */
.flatpickr-day:hover {
    background: #f0f4ff;
    color: #007bff;
}

/* Selected day */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

/* Today + selected */
.flatpickr-day.today.selected {
    background: #0056b3;
    border-color: #0056b3;
}

/* Today (not selected) */
.flatpickr-day.today {
    border: 1px solid #007bff;
    color: #007bff;
}

/* Dark mode overrides */
.dark-mode .flatpickr-calendar {
    background: #2c2f33;
    color: #e9ecef;
}

.dark-mode .flatpickr-day {
    color: #e9ecef;
}

.dark-mode .flatpickr-day:hover {
    background: #3a3f44;
    color: #fff;
}

.dark-mode .flatpickr-day.selected,
.dark-mode .flatpickr-day.today.selected {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}
/* Ensure flatpickr inputs match app inputs */
.flatpickr-input,
input[type="date"] {
    font-family: 'Inter', sans-serif !important; /* Force match */
    font-size: 16px !important; /* Match your app font size */
    /* Add any other styles you might have here */
}
/* CSS for Toast Notifications */

#toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}
.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 250px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Transition for animations */
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.toast-message {
    font-size: 16px;
    margin-right: 15px;
    flex-grow: 1;
}

.toast-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

/* Specific toast types */
.toast-success {
    background-color: #4CAF50;
}

.toast-error {
    background-color: #F44336;
}

.toast-warning {
    background-color: #FF9800;
}

.toast-info {
    background-color: #2196F3;
}