/* tasks/static/tasks/css/style.css */

/* --- 0. Global Reset and Variables --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #007bff; /* Muted Blue for Active/Accent */
    --color-text-dark: #333;
    --color-text-light: #999;
    --color-background-main: #F8F8F8; /* Light Gray Main Background */
    --color-background-card: #FFFFFF;
    --color-border-subtle: #EEE;
    --color-complete: #F0F0F0;
    --font-stack: 'Inter', Roboto, sans-serif;
}

body {
    font-family: var(--font-stack);
    color: var(--color-text-dark);
}

/* --- 1. Main Application Layout (3-Column Grid) --- */

.honeydew-app {
    display: grid;
    /* Default: 250px sidebar, 1fr task list (right pane is hidden) */
    grid-template-columns: 250px 1fr; 
    height: 100vh;
    background-color: var(--color-background-main);
    overflow: hidden; /* Prevent body scroll */
}

/* Rule to make the 3-column layout appear when a task is selected (triggered by JS) */
.honeydew-app.task-selected {
    /* New layout: Left (250px) | Center (flexible) | Right (350px) */
    grid-template-columns: 250px 1fr 350px; 
}

.sidebar-nav {
    background-color: var(--color-background-card);
    padding: 20px;
    border-right: 1px solid var(--color-border-subtle);
    overflow-y: auto;
}

.task-list-main {
    padding: 30px;
    overflow-y: auto; /* Allow scrolling of the task list */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between tasks (Whitespace!) */
}

.task-details-pane {
    background-color: var(--color-background-card);
    border-left: 1px solid var(--color-border-subtle);
    overflow-y: auto;
    padding: 30px 20px;
}

.task-details-pane.is-hidden {
    display: none;
}

/* --- 2. Left Navigation Panel Styles --- */

.logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--color-primary);
}

.search-bar-wrapper {
    margin-bottom: 25px;
}

.search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 4px;
    font-size: 14px;
}

.main-views-list {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 10px 0;
    font-size: 15px;
    color: #666; 
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    margin-bottom: 5px; 
}

.nav-item i {
    margin-right: 10px;
    font-size: 18px;
}

.nav-item.is-active,
.nav-item:hover {
    color: var(--color-primary); 
    font-weight: 600;
}

/* Sorting Controls */
.sorting-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--color-border-subtle);
}

.sort-button {
    background: none;
    border: 1px solid var(--color-border-subtle);
    color: #666;
    padding: 5px 10px;
    margin-right: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.sort-button:hover {
    background-color: var(--color-primary);
    color: var(--color-background-card);
}


/* --- 3. Add Task Bar Styles --- */

.add-task-bar {
    display: flex;
    margin-bottom: 20px;
    background-color: var(--color-background-card);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    pointer-events: auto;
    z-index: 1000;
}

#new-task-title {
    flex-grow: 1;
    padding: 12px 15px;
    border: none;
    font-size: 16px;
    outline: none;
    pointer-events: auto;
    z-index: 1001;
}

#add-task-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 16px;
}

#add-task-button:hover {
    background-color: #0056b3;
}

/* --- 4. Task Card Styles (The Core List) --- */

.task-card {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 15px 20px;
    background-color: var(--color-background-card);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); 
    border-left: 4px solid transparent; 
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.task-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px); 
}

/* Highlight the currently selected task */
.task-card.is-active {
    border-left-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.task-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.task-complete-checkbox {
    margin-right: 15px;
    cursor: pointer;
    /* Optional: custom checkbox styles for a flatter look */
}

.task-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-dark);
    transition: all 0.2s;
}

/* !!! CRITICAL STYLE FOR COMPLETED TASKS !!! */
.task-card.is-complete .task-title {
    text-decoration: line-through; 
    color: var(--color-text-light); /* Gray out the text */
}

.task-card.is-complete {
    background-color: var(--color-complete); /* Subtle background change */
    box-shadow: none;
}
/* ------------------------------------------- */

.task-metadata {
    display: flex;
    align-items: center;
}

/* Priority Indicators (Sleek Dots) */
.priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
}
.priority-High { background-color: #dc3545; }    /* Red */
.priority-Medium { background-color: #ffc107; } /* Yellow */
.priority-Low { background-color: #007bff; }    /* Blue */

.due-date {
    font-size: 13px;
    color: var(--color-text-light);
    margin-right: 15px;
}

.drag-handle, .task-detail-button {
    color: #CCC; 
    margin-left: 10px;
    font-size: 14px;
    cursor: grab;
    transition: color 0.2s;
}

.task-card:hover .drag-handle, 
.task-card:hover .task-detail-button {
    color: #999; 
}


/* --- 5. Details Pane Initial Styles --- */

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 15px;
}

.details-header h2 {
    font-size: 20px;
}

.close-details-button {
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text-light);
    transition: color 0.2s;
}

.close-details-button:hover {
    color: var(--color-text-dark);
}

.details-body strong {
    font-weight: 600;
}

.task-description-input {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 4px;
    font-family: var(--font-stack);
    font-size: 14px;
    resize: vertical;
    outline: none;
}

.task-description-input:focus {
    border-color: var(--color-primary);
}

/* General utility class for error messages */
.error-message {
    color: #dc3545;
    padding: 20px;
    text-align: center;
}

#subtask-list-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--color-border-subtle);
}

.subtask-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 15px;
    border-bottom: 1px dotted #F0F0F0;
}

.subtask-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    cursor: pointer;
}

.subtask-item.is-complete .subtask-title {
    text-decoration: line-through;
    color: var(--color-text-light);
}

.subtask-title {
    margin-left: 10px;
}

.subtask-add-bar {
    display: flex;
    margin-top: 15px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 4px;
    overflow: hidden;
}

#new-subtask-title {
    flex-grow: 1;
    padding: 8px 10px;
    border: none;
    outline: none;
}

.add-subtask-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.subtask-delete-button {
    color: #CCC;
    cursor: pointer;
    font-size: 12px;
    transition: color 0.2s;
}

.subtask-delete-button:hover {
    color: #dc3545; /* Red on hover */
}

/* --- SortableJS Classes for Dragging UX --- */

/* The element being dragged */
.sortable-chosen {
    opacity: 0.8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* The space where the element will be dropped */
.sortable-ghost {
    opacity: 0.2;
    background-color: var(--color-border-subtle) !important;
}
.subtask-list {
     margin-left: 24px;
     margin-top: 4px;
     padding-left: 0;
     list-style: none;
}