/* To-Do List Styles — Full Redesign */

/* ===== Animations ===== */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

@keyframes checkBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes priorityPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.todo-item.anim-add {
    animation: fadeSlideIn 0.25s ease-out;
}

.todo-item.anim-delete {
    animation: fadeSlideOut 0.2s ease-in forwards;
}

.todo-item .anim-check-bounce {
    animation: checkBounce 0.2s ease;
}

.priority-badge.anim-pulse {
    animation: priorityPulse 0.15s ease;
}

/* ===== Header Section ===== */
.header-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-content p {
    margin: 0;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.header-actions .format-btn {
    margin-top: 0;
    white-space: nowrap;
}

.todo-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* ===== Smart Composer ===== */
.composer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    transition: box-shadow 0.3s;
}

.composer.expanded {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.composer-main {
    display: flex;
    gap: 0;
}

#todoInput {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Raleway', sans-serif;
    outline: none;
}

#todoInput::placeholder {
    color: var(--text-secondary);
}

.composer-add-btn {
    padding: 14px 20px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 0 7px 7px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.composer-add-btn:hover {
    background: var(--accent-secondary);
}

/* Live shorthand preview tags */
.composer-preview {
    display: none;
    padding: 0 16px 8px 16px;
    gap: 6px;
    flex-wrap: wrap;
}

.composer-preview.has-tags {
    display: flex;
}

.preview-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.preview-tag-priority {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.preview-tag-deadline {
    background: var(--warning-color);
    color: #1a1a1a;
}

.preview-tag-project {
    background: var(--info-color);
    color: #1a1a1a;
}

.preview-tag-recurrence {
    background: #9b59b6;
    color: #fff;
}

/* Composer Tray (slides open) */
.composer-tray {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
}

.composer.expanded .composer-tray {
    max-height: 500px;
    padding: 12px 16px 16px 16px;
    border-top: 1px solid var(--border-color);
}

.composer-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    align-items: flex-end;
}

.composer-row:last-child {
    margin-bottom: 0;
}

.composer-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.composer-field-auto {
    flex: 0 0 auto;
}

.composer-field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Priority Chips */
.priority-chips {
    display: flex;
    gap: 4px;
}

.priority-chip {
    padding: 5px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.priority-chip:hover {
    border-color: var(--text-secondary);
}

.priority-chip-low.active {
    background: #6ba3ff;
    color: #fff;
    border-color: #6ba3ff;
}

.priority-chip-med.active {
    background: #ffa500;
    color: #1a1a1a;
    border-color: #ffa500;
}

.priority-chip-high.active {
    background: #ff6b6b;
    color: #1a1a1a;
    border-color: #ff6b6b;
}

/* Composer Inputs */
.composer-date,
.composer-select {
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Raleway', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.composer-date:focus,
.composer-select:focus {
    border-color: var(--accent-primary);
}

.composer-date::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.composer-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    white-space: nowrap;
    padding: 6px 0;
    user-select: none;
}

.composer-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.composer-checkbox-label i {
    color: var(--accent-primary);
}

#descriptionInput {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Raleway', sans-serif;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#descriptionInput:focus {
    border-color: var(--accent-primary);
}

/* Shorthand Hints */
.composer-hints {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.hint-tag {
    font-size: 11px;
    color: var(--text-secondary);
}

.hint-tag code {
    background: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    color: var(--accent-secondary);
}

/* ===== Progress Strip ===== */
.progress-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.progress-strip-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-strip-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.progress-strip-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

.progress-strip-toggle {
    padding: 4px 8px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.progress-strip-toggle:hover,
.progress-strip-toggle.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ===== Stats Panel ===== */
.stats-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
    margin-bottom: 0;
}

.stats-panel.open {
    max-height: 200px;
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 8px;
    text-align: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    color: var(--accent-secondary);
    font-size: 22px;
    font-weight: 700;
}

.stat-overdue {
    color: var(--error-color);
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
}

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Raleway', sans-serif;
    outline: none;
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

.search-clear {
    padding: 2px 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    border-radius: 3px;
    transition: color 0.2s;
    display: none;
}

.search-clear.visible {
    display: block;
}

.search-clear:hover {
    color: var(--text-primary);
}

/* ===== Filter Section ===== */
.filter-section {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 5px 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Raleway', sans-serif;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.filter-count {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

/* ===== Task List ===== */
.todo-list-wrapper {
    margin-bottom: 16px;
    min-height: 100px;
}

#todoList,
#completedList {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-title {
    color: var(--accent-secondary);
    font-size: 14px;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Date Group Headers ===== */
.date-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 6px 4px;
    margin: 8px 0 4px 0;
    border-top: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.date-group-header:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 4px;
}

.date-group-chevron {
    font-size: 9px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.date-group-chevron.collapsed {
    transform: rotate(-90deg);
}

.date-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

.date-group-label.overdue {
    color: #ff6b6b;
}

.date-group-label.today {
    color: #ffa500;
}

.date-group-count {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ===== Task Card ===== */
.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s, opacity 0.2s;
    position: relative;
}

.todo-item:hover {
    border-color: var(--border-color);
}

.todo-item.completed {
    opacity: 0.55;
}

/* Drag Handle */
.drag-handle {
    color: var(--text-secondary);
    font-size: 12px;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 2px 0;
    margin-top: 2px;
    flex-shrink: 0;
}

.todo-item:hover .drag-handle {
    opacity: 0.5;
}

.drag-handle:hover {
    opacity: 1 !important;
    color: var(--accent-primary);
}

.todo-item.dragging {
    opacity: 0.4;
}

.todo-item.drag-over-top {
    border-top: 2px solid var(--accent-primary) !important;
}

.todo-item.drag-over-bottom {
    border-bottom: 2px solid var(--accent-primary) !important;
}

/* Three-zone layout: Status | Content | Actions */
.todo-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid var(--accent-primary);
    border-radius: 4px;
    outline: none;
    transition: background 0.2s;
    margin-top: 2px;
    flex-shrink: 0;
}

.todo-item input[type="checkbox"]:checked {
    background: var(--accent-primary);
    position: relative;
}

.todo-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Content zone */
.todo-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.todo-text {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
    cursor: default;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.todo-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.todo-description-preview {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Recurring badge */
.recurring-badge {
    font-size: 10px;
    color: #9b59b6;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.recurring-badge span {
    font-size: 9px;
    opacity: 0.8;
}

/* Deadline badges */
.deadline-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.deadline-overdue {
    background: #ff6b6b;
    color: #1a1a1a;
}

.deadline-today {
    background: #ffa500;
    color: #1a1a1a;
}

.deadline-soon {
    background: #f4d35e;
    color: #1a1a1a;
}

.deadline-future {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Actions zone */
.todo-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Priority Badge (clickable, cycles) */
.priority-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.15s;
    user-select: none;
}

.priority-badge:hover {
    transform: scale(1.1);
}

.priority-high {
    background: #ff6b6b;
    color: #1a1a1a;
}

.priority-medium {
    background: #ffa500;
    color: #1a1a1a;
}

.priority-low {
    background: #6ba3ff;
    color: #fff;
}

/* Expand chevron */
.expand-btn {
    padding: 4px 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: color 0.2s, transform 0.2s;
    border-radius: 3px;
}

.expand-btn:hover {
    color: var(--accent-primary);
}

.expand-btn.open {
    transform: rotate(180deg);
    color: var(--accent-primary);
}

/* Delete button (hidden until hover) */
.delete-btn {
    padding: 4px 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    border-radius: 3px;
}

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

.delete-btn:hover {
    color: var(--error-color);
}

/* ===== Inline Editing ===== */
.inline-edit-input {
    flex: 1;
    padding: 4px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Raleway', sans-serif;
    outline: none;
}

/* ===== Detail Panel (expands below task) ===== */
.detail-panel {
    display: none;
    padding: 12px 12px 12px 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -7px;
    margin-bottom: 6px;
}

.detail-panel.open {
    display: block;
}

.detail-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    align-items: flex-end;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-field-grow {
    flex: 1;
}

.detail-field label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-field input,
.detail-field select,
.detail-field textarea {
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Raleway', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.detail-field input:focus,
.detail-field select:focus,
.detail-field textarea:focus {
    border-color: var(--accent-primary);
}

.detail-field textarea {
    resize: vertical;
    min-height: 50px;
    width: 100%;
}

.detail-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.detail-priority-chips {
    display: flex;
    gap: 4px;
}

.detail-priority-chip {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-priority-chip:hover {
    border-color: var(--text-secondary);
}

.detail-priority-chip.chip-low.active {
    background: #6ba3ff;
    color: #fff;
    border-color: #6ba3ff;
}

.detail-priority-chip.chip-med.active {
    background: #ffa500;
    color: #1a1a1a;
    border-color: #ffa500;
}

.detail-priority-chip.chip-high.active {
    background: #ff6b6b;
    color: #1a1a1a;
    border-color: #ff6b6b;
}

.detail-project-select {
    width: 100%;
}

/* ===== Project Items ===== */
.project-item {
    border-left: 3px solid var(--accent-primary) !important;
    background: var(--bg-hover) !important;
}

.project-icon {
    color: var(--accent-primary);
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.project-progress-bar {
    width: 60px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.project-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s;
}

.project-progress-label {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Collapse chevron */
.collapse-chevron {
    cursor: pointer;
    color: var(--accent-primary);
    font-size: 10px;
    transition: transform 0.2s;
    padding: 2px;
    flex-shrink: 0;
    margin-top: 3px;
}

.collapse-chevron.collapsed {
    transform: rotate(-90deg);
}

/* Quick add subtask button */
.quick-add-btn {
    padding: 2px 6px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
    opacity: 0;
}

.todo-item:hover .quick-add-btn {
    opacity: 1;
}

.quick-add-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ===== Subtask Items ===== */
.subtask-group {
    margin-left: 28px;
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
}

.subtask-item {
    background: var(--bg-primary) !important;
}

/* Inline Subtask Input Row */
.inline-subtask-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 6px;
}

.inline-subtask-input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Raleway', sans-serif;
    outline: none;
}

.inline-subtask-hint {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== Section Divider ===== */
.section-divider {
    padding: 12px 0 6px 0;
    margin: 8px 0 4px 0;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 1px solid var(--border-color);
    list-style: none;
}

/* ===== Completed Section ===== */
.completed-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 20px;
}

.completed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
    user-select: none;
}

.completed-header:hover {
    background: var(--bg-hover);
}

.completed-chevron {
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.completed-chevron.collapsed {
    transform: rotate(-90deg);
}

.completed-count {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
}

.clear-completed-btn {
    padding: 4px 10px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: 'Raleway', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-completed-btn:hover {
    color: var(--error-color);
    border-color: var(--error-color);
}

.completed-list-wrapper {
    padding: 0 14px 14px 14px;
    max-height: 400px;
    overflow-y: auto;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.empty-state-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.4;
    color: var(--text-secondary);
}

.empty-state-msg {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== Undo Toast ===== */
.undo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    display: none;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 3000;
    animation: toastSlideUp 0.25s ease-out;
}

.undo-toast.visible {
    display: flex;
}

.undo-toast-msg {
    color: var(--text-primary);
    font-size: 13px;
    white-space: nowrap;
}

.undo-toast-btn {
    padding: 4px 12px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    transition: background 0.2s;
}

.undo-toast-btn:hover {
    background: var(--accent-secondary);
}

.undo-toast-dismiss {
    padding: 2px 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: color 0.2s;
}

.undo-toast-dismiss:hover {
    color: var(--text-primary);
}

/* ===== Keyboard Shortcuts Overlay ===== */
.shortcuts-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.shortcuts-overlay.visible {
    display: flex;
}

.shortcuts-content {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 10px;
    padding: 24px 32px;
    min-width: 300px;
}

.shortcuts-content h3 {
    color: var(--accent-secondary);
    margin: 0 0 16px 0;
    font-size: 18px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.shortcut-row:last-of-type {
    border-bottom: none;
}

.shortcut-row span {
    flex: 1;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Raleway', sans-serif;
    color: var(--accent-secondary);
    min-width: 24px;
    text-align: center;
}

.shortcuts-close {
    margin-top: 16px;
    padding: 8px 20px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Raleway', sans-serif;
    width: 100%;
}

.shortcuts-close:hover {
    background: var(--accent-secondary);
}

/* ===== Scrollbar ===== */
.todo-list-wrapper::-webkit-scrollbar,
.completed-list-wrapper::-webkit-scrollbar {
    width: 6px;
}

.todo-list-wrapper::-webkit-scrollbar-track,
.completed-list-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.todo-list-wrapper::-webkit-scrollbar-thumb,
.completed-list-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.todo-list-wrapper::-webkit-scrollbar-thumb:hover,
.completed-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .composer-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .todo-description-preview {
        max-width: 150px;
    }

    .detail-row {
        flex-direction: column;
        gap: 8px;
    }

    .subtask-group {
        margin-left: 16px;
        padding-left: 8px;
    }

    .drag-handle {
        display: none;
    }
}

@media (max-width: 540px) {
    .todo-container {
        padding: 0 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .todo-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .todo-text {
        font-size: 13px;
    }

    .header-actions {
        flex-direction: column;
    }

    .header-actions .format-btn {
        width: 100%;
    }
}
