/* ============================================================================
   66-bulk.css - bulk actions on the board and the overdue counter on a card.

   Components/Pages/BulkBar, the selection state of TaskRow, Home.Bulk.cs.

   THE BAR TAKES THE TASKBAR'S PLACE. In selection mode it replaces .completed-section, the 40px
   strip at the foot of the tasks card, at the same height, so entering selection moves nothing
   and Home still fits one screen (55-home-fit.css). The row scrolls sideways when the card is
   narrow; the popovers hang above the strip with a fixed size per kind and scroll inside, like the
   view switcher's panel (62-views.css). Nothing sticks out of a card: the select box sits in the
   slot of the completion checkbox, the overdue chip in the label row.

   Token-driven and logical properties only, so no line in the RTL layer and no dark twin.
   ============================================================================ */

/* ---- overdue counter -------------------------------------------------------------------------- */

.overdue-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}
.overdue-chip .material-icons { font-size: 14px; }

/* ---- selection mode: the card ----------------------------------------------------------------- */

.task-row.is-selecting { cursor: pointer; }
.task-row.is-selecting .task-tools { pointer-events: none; opacity: 0.45; }
.task-row.is-picked {
    border-color: var(--chronos-violet);
    background: color-mix(in srgb, var(--chronos-violet) 8%, var(--chronos-card-inset));
    box-shadow: inset 0 0 0 1px var(--chronos-violet);
}

/* A long press must not open the text-selection handles or the callout under the finger. */
@media (pointer: coarse) {
    .task-cols .task-row {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ---- the "Выбрать" door ------------------------------------------------------------------------ */

.board-door-select { gap: 6px; }
.board-door-select .board-door-text {
    display: none;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}
.board-door-select.is-active {
    color: var(--chronos-violet);
    border-color: color-mix(in srgb, var(--chronos-violet) 45%, transparent);
}
@media (min-width: 721px) {
    .board-door-select { padding: 0 12px 0 10px; }
    .board-door-select .board-door-text { display: inline; }
}

/* ---- the bar ----------------------------------------------------------------------------------- */

.bulk-bar {
    position: relative;
    flex: none;
    margin-block-start: auto;
    height: 40px;
    box-sizing: border-box;
    background: var(--chronos-chip-bg);
    border-block-start: 1px solid var(--chronos-outline);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
}
/* Selection mode: the bar is the taskbar's replacement, same slot, same height. */
.bulk-bar ~ .completed-section { display: none; }

.bulk-row {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    box-sizing: border-box;
    padding: 4px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.bulk-row::-webkit-scrollbar { display: none; }

.bulk-count {
    flex: 0 1 auto;
    min-width: 6.5em;
    max-width: 14em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-inline: 4px 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--chronos-fg-primary);
}

.bulk-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 34px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--chronos-fg-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.bulk-btn .material-icons { font-size: 18px; }
.bulk-btn:hover:not(:disabled),
.bulk-btn.is-open {
    color: var(--chronos-fg-primary);
    border-color: color-mix(in srgb, var(--hover-ink) var(--hover-lift), transparent);
}
.bulk-btn:disabled { opacity: 0.4; cursor: default; }
.bulk-btn.is-danger { color: #DC2626; }
.bulk-btn.bulk-cancel { margin-inline-start: auto; }

/* Icons only until the card is wide enough for words; the text stays in the accessibility tree. */
.bulk-btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
@media (min-width: 1200px) {
    .bulk-btn-text {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
    }
}
@media (pointer: coarse) {
    .bulk-btn { min-width: 40px; height: 34px; }
}

/* ---- the popovers ------------------------------------------------------------------------------ */

.bulk-pop {
    position: absolute;
    z-index: 40;
    inset-block-end: calc(100% + 6px);
    inset-inline-end: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(300px, calc(100% - 16px));
    padding: 36px 12px 12px;
    overflow: hidden;
    border: 1px solid var(--chronos-outline);
    border-radius: 14px;
    background: var(--chronos-card-bg);
    color: var(--chronos-fg-primary);
    box-shadow: 0 14px 36px rgba(15, 17, 22, 0.2);
}
.bulk-pop-deadline { height: 200px; }
.bulk-pop-label { height: 232px; }
.bulk-pop-delete { height: 168px; }

.bulk-pop-close {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--chronos-fg-muted);
    cursor: pointer;
}
.bulk-pop-close .material-icons { font-size: 18px; }
.bulk-pop-close:hover { color: var(--chronos-fg-primary); }

.bulk-opt {
    flex: none;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--chronos-outline);
    border-radius: 10px;
    background: var(--chronos-chip-bg);
    color: var(--chronos-fg-primary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
}
.bulk-opt:hover:not(:disabled) { border-color: var(--chronos-violet); }
.bulk-opt:disabled { opacity: 0.4; cursor: default; }
.bulk-opt.is-danger {
    color: #fff;
    background: #DC2626;
    border-color: #DC2626;
    text-align: center;
}

.bulk-date { display: flex; gap: 8px; align-items: center; }
.bulk-date-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
    padding: 0 8px;
    border: 1px solid var(--chronos-outline);
    border-radius: 10px;
    background: var(--chronos-card-bg);
    color: var(--chronos-fg-primary);
    font: inherit;
    font-size: 13px;
}
.bulk-apply { text-align: center; }

.bulk-labels {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.bulk-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-block: 3px;
}
.bulk-label-row .label-chip { flex: 1 1 auto; min-width: 0; cursor: default; }
.bulk-mini {
    flex: none;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--chronos-outline);
    border-radius: 8px;
    background: var(--chronos-chip-bg);
    color: var(--chronos-fg-primary);
    cursor: pointer;
}
.bulk-mini .material-icons { font-size: 18px; }
.bulk-mini:hover:not(:disabled) { border-color: var(--chronos-violet); }
.bulk-mini:disabled { opacity: 0.4; cursor: default; }
.bulk-empty { padding-block: 8px; font-size: 13px; }

.bulk-confirm {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
    .bulk-btn { transition: none; }
}
