/* =============================================
   TASK MANAGER — PREMIUM REDESIGN
   ============================================= */

/* =============================================
   FILTER PILLS & SORT BAR
   ============================================= */
.task-filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
    z-index: 500;
}

.task-dropdown-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .task-filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .task-filters {
        width: 100%;
    }

    .task-dropdown-controls {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .task-dropdown-controls .sort-dropdown-wrap {
        flex: 1;
    }

    .task-dropdown-controls .sort-dropdown-btn {
        width: 100%;
        justify-content: space-between;
    }
}

.task-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    flex: 1;
}

.task-filters::-webkit-scrollbar { display: none; }

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.3px;
    position: relative;
}

.filter-pill:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.filter-pill.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 55%, #4338ca 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.32);
    font-weight: 700;
    box-shadow: 0 6px 22px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.40);
}

.filter-pill.active:hover {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 55%, #4c1d95 100%);
    box-shadow: 0 8px 28px rgba(147, 51, 234, 0.60), inset 0 1px 0 rgba(255, 255, 255, 0.50);
    transform: translateY(-1px);
}



/* =============================================
   AESTHETIC SORT DROPDOWN
   ============================================= */
.sort-dropdown-wrap {
    position: relative;
    z-index: 600;
    flex-shrink: 0;
}

.sort-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.sort-dropdown-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.15);
}

.sort-dropdown-btn.active-sort {
    border-color: rgba(167, 139, 250, 0.6);
    color: var(--primary-light);
    background: rgba(139, 92, 246, 0.12);
}

.sort-chevron {
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.sort-dropdown-wrap.open .sort-chevron {
    transform: rotate(180deg);
}

.sort-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    z-index: 1000;
    width: 230px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sort-dropdown-menu::-webkit-scrollbar {
    width: 5px;
}
.sort-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#task-subject-menu {
    left: 0;
    right: auto;
    width: 290px;
    padding: 10px;
}

#task-sort-menu {
    right: 0;
    left: auto;
}

.subject-capsules-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.subject-chip-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    white-space: nowrap;
}

.subject-chip-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
}

.subject-chip-pill.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.subject-chip-pill.active-subject-chip {
    outline: 2px solid #ffffff;
    outline-offset: 1px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    #task-subject-menu {
        left: 0;
        right: auto;
        width: calc(100vw - 32px);
        max-width: 320px;
    }

    #task-sort-menu {
        right: 0;
        left: auto;
        max-width: calc(100vw - 32px);
    }
}

.sort-dropdown-wrap.open .sort-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    color: var(--text-secondary);
}

.sort-opt-icon {
    color: var(--text-muted);
    transition: color 0.18s ease;
    flex-shrink: 0;
}

.sort-opt-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sort-opt-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sort-opt-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sort-option:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.sort-option:hover .sort-opt-icon {
    color: var(--primary-light);
}

.sort-option.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(167, 139, 250, 0.35);
}

.sort-option.active .sort-opt-icon {
    color: #a78bfa;
}

.sort-option.active i {
    color: #a78bfa;
}

.sort-option.active .sort-opt-title {
    color: #ffffff;
    font-weight: 700;
}

.sort-option.active .sort-opt-sub {
    color: rgba(255, 255, 255, 0.7);
}

/* =============================================
   PAGINATION / LOAD MORE TASKS
   ============================================= */
.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 0 10px 0;
    margin-top: 10px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.83rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.85) 0%, rgba(99, 102, 241, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    letter-spacing: 0.3px;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-load-more:active {
    transform: translateY(0);
}

.load-more-count {
    font-size: 0.76rem;
    font-weight: 600;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
}

.load-more-info {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

/* =============================================
   TASK COMPOSER
   ============================================= */
.task-composer {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 200;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.task-composer:focus-within {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-lg);
}

.composer-input-row {
    position: relative;
    width: 100%;
}

.text-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 44px 12px 16px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
}

.text-input::placeholder { color: var(--text-muted); font-weight: 400; }

.text-input:focus {
    border-color: var(--primary-color);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.composer-info-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border-radius: 50%;
    transition: var(--transition);
}

.composer-info-btn:hover {
    color: var(--primary-light);
    background: rgba(124,58,237,0.12);
}

.composer-info-btn svg { width: 16px; height: 16px; }

/* Meta row */
.composer-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
}

.composer-settings-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

/* Inline capsule dropdown */
.composer-capsule-inline {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.composer-capsule-inline .capsule-select-dropdown {
    height: 32px;
    padding: 0 8px;
    font-size: 0.76rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    min-width: 85px;
    max-width: 120px;
    transition: var(--transition);
    font-family: var(--font-sans);
    appearance: none;
    -webkit-appearance: none;
}

.composer-capsule-inline .capsule-select-dropdown:hover,
.composer-capsule-inline .capsule-select-dropdown:focus {
    border-color: var(--border-hover);
    color: var(--primary-light);
    background: var(--bg-card-hover);
}

.composer-capsule-inline .capsule-select-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Priority toggle group */
.priority-toggle-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 32px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.priority-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0 9px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: capitalize;
    letter-spacing: 0.2px;
    font-family: var(--font-sans);
    position: relative;
}

.priority-toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.priority-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.priority-toggle-btn.active[data-priority="low"] {
    background: rgba(16,185,129,0.18);
    color: #34d399;
    font-weight: 700;
}

.priority-toggle-btn.active[data-priority="medium"] {
    background: rgba(245,158,11,0.18);
    color: #fbbf24;
    font-weight: 700;
}

.priority-toggle-btn.active[data-priority="high"] {
    background: rgba(239,68,68,0.18);
    color: #f87171;
    font-weight: 700;
}

/* Date picker */
.date-picker-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 6px;
    height: 32px;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
}

.date-picker-wrap:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.date-picker-wrap svg {
    width: 13px;
    height: 13px;
    stroke: var(--text-secondary);
    flex-shrink: 0;
}

.date-input {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.76rem;
    outline: none;
    cursor: pointer;
    width: 62px;
    min-width: 62px;
    text-align: center;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
    opacity: 0.6;
}

/* Schedule Popover */
.date-input-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.schedule-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 240px;
    background: rgba(14, 11, 28, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(124, 58, 237, 0.35);
    z-index: 99999;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.schedule-popover.open {
    display: flex;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.popover-quick-chips {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.chip-btn {
    flex: 1;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.chip-btn:hover, .chip-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.popover-date-picker, .popover-select {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.78rem;
    outline: none;
    box-sizing: border-box;
}

.popover-select option {
    background: #18132b;
    color: #ffffff;
}

.popover-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 2px 0;
}

/* Composer Goal Input */
.composer-goal-input {
    width: auto;
    min-width: 32px;
    max-width: 52px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    padding: 0 2px;
    margin: 0;
    line-height: 1;
    -moz-appearance: textfield;
}

.composer-goal-input::-webkit-outer-spin-button,
.composer-goal-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Compact Task Goal Capsule */
.task-goal-capsule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #f59e0b;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.12);
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.task-goal-capsule:hover {
    transform: scale(1.08);
    background: rgba(167, 139, 250, 0.22);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.task-goal-capsule.infinity {
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.35);
    color: #c084fc;
    font-size: 0.82rem;
    padding: 3px 9px;
}

.task-goal-capsule.infinity i {
    font-size: 0.8rem;
}

@keyframes taskCompletionPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.7), 0 0 25px rgba(124, 58, 237, 0.5);
        transform: translateY(-2px) scale(1.015);
        border-color: rgba(167, 139, 250, 0.8);
    }
    50% {
        box-shadow: 0 0 30px 6px rgba(167, 139, 250, 0.45), 0 0 40px rgba(245, 158, 11, 0.35);
        transform: translateY(-2px) scale(1.025);
        border-color: rgba(245, 158, 11, 0.9);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(167, 139, 250, 0);
        transform: translateY(0) scale(1);
    }
}

.task-item.task-completion-highlight {
    animation: taskCompletionPulse 1.4s ease-in-out forwards;
    z-index: 5;
    position: relative;
}

/* Composer Action Row (Goal counter + Add Task button) */
.composer-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .composer-action-row {
        width: 100%;
        margin-left: 0;
        margin-top: 6px;
        justify-content: space-between;
    }
    
    .composer-action-row #add-task-btn {
        flex: 1;
        max-width: 180px;
    }
}

/* Pomodoro estimate (Goal button counter) */
.pomodoro-estimate-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    height: 32px;
    transition: var(--transition);
    flex-shrink: 0;
    white-space: nowrap;
    min-width: max-content;
}

.pomodoro-estimate-wrap:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.pomodoro-estimate-wrap span {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pomo-estimate-icon {
    width: 13px;
    height: 13px;
    stroke: var(--danger-color);
    opacity: 0.7;
}

.estimate-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--transition);
    font-family: var(--font-sans);
    line-height: 1;
    border-radius: 3px;
}

.estimate-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

#add-task-btn {
    height: 32px !important;
    padding: 0 16px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border-radius: var(--radius-sm) !important;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 55%, #4338ca 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.32) !important;
    box-shadow: 0 6px 22px rgba(124, 58, 237, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.50) !important;
    transition: all 0.22s var(--ease-spring) !important;
    white-space: nowrap !important;
    align-self: center !important;
}

#add-task-btn:hover {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 55%, #4c1d95 100%) !important;
    box-shadow: 0 8px 28px rgba(147, 51, 234, 0.70), inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
    transform: translateY(-1px) !important;
}

/* =============================================
   TASK LIST
   ============================================= */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =============================================
   TASK ITEM
   ============================================= */
.task-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: var(--transition);
    animation: taskSlideIn 0.3s var(--ease-spring) forwards;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    transition: var(--transition);
}

.task-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--primary-glow);
    transform: translateX(3px);
    background: var(--bg-card-hover);
}

.task-item:hover::before {
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
}

.task-item.active-focus-task {
    border-color: var(--primary-color);
    background: var(--surface-raised);
    box-shadow: 0 0 20px var(--primary-glow);
}

.task-item.active-focus-task::before {
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
}

/* Task left section */
.task-left {
    display: flex;
    align-items: center;
    gap: 13px;
    flex: 1;
    min-width: 0;
}

/* Custom Checkbox - Premium Tactile Glass Design */
.checkbox-custom {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    outline: none;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.checkbox-custom:hover {
    border-color: var(--primary-light, #a78bfa);
    background: rgba(167, 139, 250, 0.12);
    box-shadow: 0 0 14px rgba(167, 139, 250, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: scale(1.12);
}

.checkbox-custom:checked {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #c084fc 100%);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 18px rgba(167, 139, 250, 0.65), 0 2px 8px rgba(124, 58, 237, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.checkbox-custom:checked::after {
    content: '';
    position: absolute;
    top: 46%;
    left: 50%;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2.2px 2.2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 0.5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Task details */
.task-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.task-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-item.completed .task-title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.task-meta-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.meta-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: capitalize;
    letter-spacing: 0.2px;
    background: var(--surface-raised);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.meta-tag.priority-low    { background: rgba(16,185,129,0.08); color: #34d399; border-color: rgba(16,185,129,0.25); }
.meta-tag.priority-medium { background: rgba(245,158,11,0.08); color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.meta-tag.priority-high   { background: rgba(239,68,68,0.08);  color: #f87171; border-color: rgba(239,68,68,0.25); }

.meta-tag.category {
    background: var(--surface-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.meta-tag.due-date {
    background: var(--surface-raised);
    color: var(--primary-light);
    border-color: var(--border-color);
}

/* Live timer badge */
.task-timer-live-badge {
    background: var(--surface-raised);
    color: var(--primary-light);
    border: 1px solid var(--border-color);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-timer-live-badge.ticking {
    background: var(--surface-raised);
    color: var(--primary-light);
    border-color: var(--primary-color);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.8; transform: scale(0.97); }
}

/* Task right section */
.task-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pomo-run-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 4px 8px;
    background: var(--surface-subtle);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.pomo-run-badge svg {
    width: 11px;
    height: 11px;
    fill: var(--danger-color);
}

/* Task Note Button Icon (Take Notes) */
.task-note-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.task-note-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-note-btn:hover {
    color: var(--primary-light);
    border-color: var(--border-hover);
    background: var(--interactive-hover);
    box-shadow: 0 0 12px var(--primary-glow);
    transform: scale(1.05);
}

.task-note-btn.has-note {
    color: var(--primary-light);
    border-color: var(--primary-light);
    background: var(--interactive-subtle);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes taskSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.task-item.exiting {
    animation: taskSlideOut 0.22s ease forwards;
}

@keyframes taskSlideOut {
    from { opacity: 1; transform: translateX(0); max-height: 80px; margin-bottom: 7px; }
    to   { opacity: 0; transform: translateX(24px); max-height: 0; margin-bottom: 0; padding: 0; }
}

/* =============================================
   EMPTY STATE
   ============================================= */
.task-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 3rem 2rem;
    color: var(--text-muted);
    text-align: center;
}

.task-empty-state svg {
    width: 40px;
    height: 40px;
    stroke: var(--text-muted);
    opacity: 0.4;
}

.task-empty-state p {
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 220px;
    opacity: 0.6;
}

/* =============================================
   TASK METADATA CAPSUES AND BUTTON STYLING
   ============================================= */
.task-time-badge {
    font-size: 0.62rem;
    border: 1px solid rgba(255, 159, 67, 0.2);
    background: rgba(255, 159, 67, 0.05);
    color: #ff9f43;
    padding: 2px 7px;
    border-radius: 30px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.task-timer-live-badge {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 2px;
    animation: pulse 1.6s infinite;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

@keyframes pulse {
    0% { opacity: 0.9; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { opacity: 1; box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.15); }
    100% { opacity: 0.9; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
}

.task-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-toggle-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    color: rgba(255, 255, 255, 0.6);
}

.timer-toggle-btn:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.3);
    color: var(--primary-light);
    transform: scale(1.08);
}

.timer-toggle-btn.active-running {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.timer-toggle-btn.active-running:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
}

.timer-toggle-btn.active-paused {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #10b981;
}

.timer-toggle-btn.active-paused:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.45);
}

.task-right .btn-icon:not(.timer-toggle-btn) {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.task-right .btn-icon:not(.timer-toggle-btn):hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
    transform: scale(1.08);
}

/* =============================================
   MOBILE COMPOSER AND TASK LIST RESPONSIVENESS
   ============================================= */

/* Styling for the new horizontal options scroll */
.composer-options-scroll {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Composer Schedule Group (Date picker + Goal counter together) */
.composer-schedule-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .composer-meta-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .composer-settings-group {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    .composer-schedule-group {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    .composer-schedule-group .date-picker-wrap {
        flex: 0 0 auto;
        justify-content: center;
    }

    .composer-schedule-group .pomodoro-estimate-wrap {
        flex: 0 0 auto;
        justify-content: center;
    }

    #add-task-btn,
    .composer-add-task-btn {
        width: 100% !important;
        max-width: 100% !important;
        height: 38px !important;
        margin-top: 2px;
        font-size: 0.85rem !important;
        border-radius: var(--radius-md) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

@media (max-width: 600px) {
    .task-title {
        white-space: normal !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.35;
        font-size: 0.88rem;
    }

    .task-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .checkbox-custom {
        width: 22px !important;
        height: 22px !important;
    }

    .task-right {
        gap: 8px;
    }

    .task-right .btn-icon {
        width: 38px !important;
        height: 38px !important;
    }

    .task-right .btn-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .timer-toggle-btn {
        width: 38px !important;
        height: 38px !important;
    }
}

@media (max-width: 480px) {
    .task-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 14px !important;
    }

    .task-left {
        width: 100% !important;
        align-items: flex-start !important;
    }

    .task-right {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 10px;
        margin-top: 2px;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    /* Push delete and focus buttons to the far right, leaving badges on the left */
    .task-right button:first-of-type {
        margin-left: auto !important;
    }
}
