/* ============================================================
   Taskee V1 — tasks.css
   Task list component styles (loaded alongside style.css).
   Used by: Inbox, All Tasks, Subgroup view, Archive.
   ============================================================ */

/* ---- Page header additions -------------------------------- */
.page-subtitle {
    font-size: 13px;
    color: var(--color-text-secondary, #6b7280);
    margin-top: 2px;
}

.task-count-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary, #6b7280);
    background: var(--color-border, #e8eaed);
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
    margin-top: 6px;
}

/* ---- Filter bar ------------------------------------------- */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-bar-left,
.filter-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group {
    position: relative;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--color-border, #e8eaed);
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--color-text-secondary, #374151);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.filter-btn-active {
    border-color: var(--color-accent, #E07B30) !important;
    color: var(--color-accent, #E07B30) !important;
    background: rgba(224,123,48,0.06) !important;
}

.filter-btn .chevron { opacity: 0.45; }

/* Dropdowns */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #fff;
    border: 1px solid var(--color-border, #e8eaed);
    border-radius: 9px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.05);
    min-width: 150px;
    padding: 5px;
    z-index: 200;
    display: none;
}

.filter-dropdown.open {
    display: block;
    animation: ddIn 0.12s ease;
}

.filter-dropdown-right { left: auto; right: 0; }

@keyframes ddIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--color-text-secondary, #374151);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.1s;
    white-space: nowrap;
}

.filter-option:hover { background: #f3f4f6; }

.filter-option-selected {
    font-weight: 600;
    color: var(--color-accent, #E07B30) !important;
    background: rgba(224,123,48,0.07);
}

.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: rgba(192,57,43,0.07);
    color: #c0392b;
    border: 1px solid rgba(192,57,43,0.18);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.15s;
    cursor: pointer;
}

.filter-clear-btn:hover { background: rgba(192,57,43,0.13); }

/* ---- Section headers -------------------------------------- */
.task-section { margin-bottom: 6px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 2px 5px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-label-overdue { color: #c0392b !important; }

.section-label-sub {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #9ca3af;
}

.section-count {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 1px 7px;
    border-radius: 10px;
}

.section-count-overdue {
    color: #c0392b;
    background: rgba(192,57,43,0.08);
}

/* ---- Task list -------------------------------------------- */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

/* ---- Task row -------------------------------------------- */
.task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--color-border, #e8eaed);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 44px;
}

.task-row:hover {
    border-color: #c9cdd4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.task-row-overdue {
    border-left-width: 3px;
    border-left-color: rgba(192,57,43,0.35);
}

.task-row-completed { opacity: 0.65; }
.task-row-completed .task-name {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-row-archived { opacity: 0.6; }
.task-row-archived .task-name { color: #9ca3af; }

/* ---- Quick-complete checkbox ----------------------------- */
.task-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: transparent;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.task-check svg { width: 11px; height: 11px; }

.task-check:hover {
    border-color: var(--color-accent, #E07B30);
    background: rgba(224,123,48,0.08);
    color: var(--color-accent, #E07B30);
}

.task-check.checked {
    border-color: var(--color-accent, #E07B30) !important;
    background: var(--color-accent, #E07B30) !important;
    color: #fff !important;
}

.task-check-done {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--color-accent, #E07B30);
    background: var(--color-accent, #E07B30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.task-check-done svg { width: 11px; height: 11px; }

/* ---- Priority dot (row) ---------------------------------- */
.priority-dot {
    flex-shrink: 0;
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.priority-dot.now      { background-color: #e53e3e; }
.priority-dot.plan     { background-color: #E07B30; }
.priority-dot.delegate { background-color: #3b82f6; }
.priority-dot.someday  { background-color: #D4B896; }

/* Small dot for filter dropdowns */
.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-now      { background-color: #e53e3e; }
.dot-plan     { background-color: #E07B30; }
.dot-delegate { background-color: #3b82f6; }
.dot-someday  { background-color: #D4B896; }

/* ---- Task name ------------------------------------------- */
.task-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    min-width: 0;
}

/* ---- Subgroup pill --------------------------------------- */
.task-subgroup-pill {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--color-text-secondary, #6b7280);
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 500;
    white-space: nowrap;
}

/* ---- Due date -------------------------------------------- */
.task-due {
    flex-shrink: 0;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 72px;
    text-align: right;
}

.task-due-overdue {
    color: #c0392b !important;
    font-weight: 600;
}

.task-due-today {
    color: var(--color-accent, #E07B30) !important;
    font-weight: 600;
}

/* ---- Empty state ----------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 20px;
    text-align: center;
    gap: 14px;
    color: #d1d5db;
}

.empty-state svg { opacity: 0.5; }
.empty-state span { font-size: 14px; color: #9ca3af; }

/* ---- View wrappers --------------------------------------- */
.inbox-view,
.tasks-view,
.subgroup-view,
.archive-view {
    width: 100%;
}
