/* assets/frontend/duties.css */

/* ===== Base table layout ===== */
.vd-duty-row td {
    vertical-align: middle;
    padding: 10px;
}

.vd-duty-cell {
    display: block;
    padding: 10px;
}

/* Accordion panel */
.vd-duty-desc {
    margin-top: 8px;
}

/* Area for duty signup button/messages (duties without tasks) */

/* Meta under title (date/time/signups) */
.vd-duty-meta,
.vd-duty-description,
.vd-duty-action,
.vd-task-item {
    margin-top: 12px;
}

.vd-duty-meta-line {
    line-height: 1.35;
    margin: 4px 0;
}

/* Signups link/text */
.vd-duty-status-link {
    color: #0a58ca;
    text-decoration: underline;
    text-decoration-skip-ink: auto;
}

.vd-duty-status-text {
    color: inherit;
}

.vd-duty-details-link {
    color: #005d8f !important;
    display: inline-block;
    margin: 6px 0px 0px 0px;
    cursor: pointer;
    color: inherit;
}

/* If your theme adds row hover background: force it off */
.vd-duty-row:hover,
.vd-duty-row:hover td {
    background: transparent !important;
}

.vd-duty-title {
    margin: 0;
    font-weight: 600;
    font-size: 18px;
}

/* ===== Task blocks inside expanded duty ===== */
.vd-task-item {
    border: 1px solid #eee;
    padding: 12px;
    background: #fafafa;
}

.vd-task-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.vd-task-meta {
    margin-top: 6px;
}

.vd-task-meta-line {
    line-height: 1.35;
}

.vd-task-action {
    margin-top: 10px;
}
/* ===== In-kind donations ===== */
.vd-donation {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e2e2;
    background: #fafafa;
}

.vd-donation-title {
    font-weight: 600;
}

.vd-donation-hint {
    margin: 4px 0 8px 0;
    /* same size and colour as the duty description */
    font-size: inherit;
    color: inherit;
}

.vd-donation-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
}

.vd-donation-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vd-donation-other {
    flex: 1 1 220px;
    min-width: 0;
}

.vd-donation-save {
    margin-top: 8px;
}

/* Task description (e.g. meeting point) */
.vd-task-description {
    margin: 4px 0 6px 0;
}

.vd-task-description > :last-child {
    margin-bottom: 0;
}

/* ===== Duty list as cards (A) + highlighted open duty (B) =====
   Scoped to .vd-duty-list so the participant tables (.vd-table) are not affected.
   !important only where themes style table cells (borders, striped rows, hover). */
.vd-duty-list,
.vd-duty-list > tbody,
.vd-duty-list > tbody > .vd-duty-row,
.vd-duty-list > tbody > .vd-duty-row > td.vd-duty-card {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.vd-duty-list {
    border: 0 !important;
    margin: 0 0 16px 0;
    background: transparent !important;
}

.vd-duty-list > tbody > .vd-duty-row > td.vd-duty-card {
    margin: 0 0 16px 0;
    padding: 0 !important;
    border: 1px solid #dcdcde !important;
    border-radius: 6px;
    background: #fff !important;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.vd-duty-list .vd-duty-cell {
    padding: 16px 18px;
}

/* Expanded duty: blue bar on the left, light tint */
.vd-duty-list > tbody > .vd-duty-row--open > td.vd-duty-card {
    border-color: #005d8f !important;
    border-left-width: 5px !important;
    background: #f2f7fa !important;
    box-shadow: 0 2px 6px rgba(0, 93, 143, 0.12);
}

/* Inner boxes stay white on the tinted card */
.vd-duty-list .vd-duty-row--open .vd-task-item,
.vd-duty-list .vd-duty-row--open .vd-donation {
    background: #fff;
    border-color: #d9e4eb;
}

/* ===== Chevron toggle (top right of each duty card) =====
   Themes style <button> heavily (background, padding, uppercase ...) -> reset with !important */
.vd-duty-list .vd-duty-cell {
    position: relative;
}

.vd-duty-list .vd-duty-title {
    padding-right: 44px; /* keep long titles clear of the chevron */
}

.vd-duty-list .vd-duty-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #005d8f !important;
    cursor: pointer;
    line-height: 1 !important;
    transition: background-color 0.15s ease;
}

.vd-duty-list .vd-duty-toggle:hover {
    background: rgba(0, 93, 143, 0.08) !important;
}

.vd-duty-list .vd-duty-toggle:focus-visible {
    outline: 2px solid #005d8f !important;
    outline-offset: 2px;
}

.vd-duty-list .vd-duty-toggle svg {
    display: block;
    transition: transform 0.2s ease;
}

.vd-duty-list .vd-duty-row--open .vd-duty-toggle svg {
    transform: rotate(180deg);
}
