/* Tasks View Styles */

#view-tasks {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header is shared from standard styles */

.tasks-layout {
    display: flex;
    gap: 24px;
    flex: 1;
    /* Take remaining space */
    height: 100%;
    /* Or auto if flex works, but ensure it fills */
    min-height: 0;
    /* Important for scrolling nested flex */
}

.tasks-main {
    flex: 4;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    min-width: 0;
    /* Prevent flex overflow */
}

.tasks-sidebar-right {
    flex: 6;
    /* 1:1 Ratio with tasks-main */
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Category Tabs */
.task-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    /* Split chips and date filter */
}

.task-categories-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.task-category-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.chip-count {
    font-size: 10px;
    background: rgba(128, 128, 128, 0.15);
    padding: 2px 5px;
    border-radius: 8px;
    margin-left: 6px;
    color: var(--text-primary);
    font-weight: 500;
}

.task-category-chip:hover {
    background: var(--control-bg-hover);
    color: var(--text-primary);
}

.task-category-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.task-category-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Date Date Chip */
.date-filter-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 122, 255, 0.1);
    /* Light Blue */
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Normally hidden */
    display: none;
    animation: fadeIn 0.3s ease;
}

.date-filter-chip.visible {
    display: flex;
}

/* Empty Trash Button */
.empty-trash-btn {
    padding: 8px 12px;
    border-radius: 8px;
    /* Button style */
    color: var(--accent-pink);
    font-size: 13px;
    cursor: pointer;
    display: none;
    /* Hidden by default */
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    background: rgba(255, 59, 48, 0.05);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.empty-trash-btn:hover {
    background: rgba(255, 59, 48, 0.15);
}

.empty-trash-btn.visible {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.date-filter-chip i {
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
}

.date-filter-chip i:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Full Size Calendar Card */
.calendar-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(20px);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    /* Larger header */
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(3, 1fr);
    /* Auto for labels, 3 rows for weeks */
    gap: 8px;
    text-align: center;
    flex: 1;
    /* Take remaining height */
    min-height: 0;
    /* Allow grid to shrink if needed to avoid overflow */
}

.mini-calendar-day-label {
    font-size: 13px;
    /* Slightly smaller */
    color: var(--text-secondary);
    margin-bottom: 4px;
    /* Reduced margin */
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    /* minimal padding */
}

/* Checklist Container updates */
.checklist-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
    /* Space for sticky input */
    display: flex;
    flex-direction: column;
}

/* Empty State */
.empty-tasks {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60%;
    color: var(--text-secondary);
    gap: 12px;
}

.empty-tasks i {
    font-size: 48px;
    opacity: 0.5;
}

.checklist-item.urgent {
    border-left: 3px solid var(--accent-pink);
}

/* Reusing existing checklist item styles below... */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 0;
    /* Gap handled by spacers/margins for precise control */
    padding: 12px 16px;
    /* Adjusted padding */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease-out;
    margin-bottom: 8px;
    /* Slightly tighter */
    cursor: pointer;
    /* Hand cursor for empty areas */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.checklist-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checklist-item.checked .checklist-checkbox {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checklist-item.checked .checklist-checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checklist-content {
    /* flex: 1; Removed to allow spacer to take remaining */
    font-size: 15px;
    color: var(--text-primary);
    cursor: text;
    /* Text cursor for text area */
    line-height: 1.5;
    padding: 2px 4px;
    /* Click target padding */
    border-radius: 4px;
    margin: 0 8px;
    /* Spacing around text */
}

/* Spacer to push buttons to right and act as 'hand' handle */
.checklist-spacer {
    flex: 1;
    height: 100%;
    min-height: 20px;
}

.checklist-item.checked .checklist-content {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.checklist-edit-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent-blue);
    color: var(--text-primary);
    font-size: 15px;
    padding: 4px 0;
    outline: none;
}

/* Delete button optional, but good for UX */
.checklist-delete-btn {
    opacity: 1;
    /* Always visible */
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    /* Optional: reduce opacity slightly until hover? User asked for "Always visible" 
       Usually implies full visibility or at least visible enough to see. */
    opacity: 0.6;
}

.checklist-item:hover .checklist-delete-btn {
    opacity: 1;
}

.checklist-delete-btn:hover {
    background: rgba(255, 59, 48, 0.1);
    color: var(--accent-pink);
    opacity: 1;
}

/* Draggable */
.checklist-item[draggable="true"] {
    cursor: grab;
}

.checklist-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Calendar Date Cell Update */
.mini-calendar-day {
    font-size: 14px;
    /* Adjusted font size */
    color: var(--text-primary);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    align-items: flex-start;
    /* Align top-left */
    justify-content: flex-start;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid transparent;
    padding: 8px;
    /* Padding for content */
    overflow: hidden;
    /* Clip overflown tasks */
}

.mini-calendar-day.dim {
    opacity: 0.5;
    /* Dim the entire cell */
    background: rgba(0, 0, 0, 0.02);
}

.mini-calendar-day.dim .calendar-date-number {
    font-size: 12px;
    /* Slightly smaller maybe? */
}

/* Explicit Month Label */
.calendar-month-label {
    font-size: inherit;
    /* Match date number */
    color: inherit;
    /* Match date color */
    margin-right: 2px;
    font-weight: inherit;
    opacity: 0.8;
    /* Slight distinction? Or full same? User: "Same font" */
}

.mini-calendar-day.drag-over {
    background: rgba(0, 122, 255, 0.3);
    border: 1px dashed var(--accent-blue);
    transform: scale(1.02);
    /* Slight scale */
}

/* Date Number */
.calendar-date-number {
    font-weight: 600;
    margin-bottom: 6px;
    width: auto;
    min-width: 24px;
    height: auto;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* Boxier for text */
}

.mini-calendar-day.today .calendar-date-number {
    background: var(--accent-blue);
    color: white;
}

.mini-calendar-day.today {
    border: 1px solid var(--card-border);
    /* Subtle border for today cell frame */
}

/* Task Item in Calendar */
.calendar-task-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    overflow-y: auto;
    /* Allow scrolling if too many? or just hide */
    /* Hide scrollbar for cleaner look */
    scrollbar-width: none;
}

.calendar-task-list::-webkit-scrollbar {
    display: none;
}

.calendar-task-item {
    font-size: 12px;
    /* Increased from 11px */
    font-weight: 600;
    /* Added Bold */
    line-height: 1.4;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    /* Transparent Light */
    color: var(--text-primary);
    border-radius: 4px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    transition: background 0.2s;
}

.calendar-task-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.calendar-task-item.urgent {
    background: rgba(255, 59, 48, 0.12);
    /* Lighter tint */
    color: #ff453a;
    /* Dark Red / Bright Red text */
    border-left: 2px solid var(--accent-pink);
    font-weight: 600;
}

.calendar-task-item.completed {
    text-decoration: line-through;
    opacity: 0.6;
}


/* Updated Task Input Container to be absolutely positioned within relative tasks-main */
.task-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    /* Adjust padding */
    z-index: 50;
    background: linear-gradient(to bottom, transparent, var(--macos-bg) 20%);
    pointer-events: none;
}

.task-input-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 9999px;
    /* Pill shape */
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 60px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    transition: all 0.2s ease;
}

.task-input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.15);
}

.task-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    height: 100%;
}

.task-input-field::placeholder {
    color: var(--text-secondary);
}

.task-enter-hint {
    color: var(--text-secondary);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 12px;
}

/* Schedule Item Styles */
.checklist-item.schedule {
    background: rgba(175, 82, 222, 0.12);
    /* Purple tint */
    border-color: rgba(175, 82, 222, 0.3);
}

.checklist-item.schedule:hover {
    background: rgba(175, 82, 222, 0.2);
    border-color: rgba(175, 82, 222, 0.5);
}

/* Replaces Checkbox */
.checklist-schedule-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
    font-size: 16px;
    margin-right: 0;
}

/* Schedule item in Mini Calendar */
.calendar-task-item.schedule {
    background: rgba(175, 82, 222, 0.12);
    color: #bf5af2;
    border-left: 2px solid var(--accent-purple);
    font-weight: 500;
}