/* ============================================================
   Scizu theme — component styles
   Requires _scizu-vars.css to be loaded first.
   Safe to load on every layout template.
   ============================================================ */

/* ── Page fill ────────────────────────────────────────────── */

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#react-page-app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Cards / columns ──────────────────────────────────────── */

.scizu-cg-zig-zag-container > .left-col,
.scizu-cg-zig-zag-container > .right-col {
    background-color: #fff;
    border: 1px solid var(--sz-card-border);
    border-radius: var(--sz-card-radius);
    box-shadow: var(--sz-card-shadow);
}

.bright-card {
    border-radius: var(--sz-card-radius);
    box-shadow: var(--sz-card-shadow);
}

/* ── Section headers ──────────────────────────────────────── */

.label-text-sm {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.3rem;
    text-transform: uppercase;
}

.header-text-sm {
    color: var(--sz-primary);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.3rem;
    text-transform: uppercase;
}

/* ── Dashboard action buttons ─────────────────────────────── */

.centered-button-container {
    height: auto;
}

.centered-button-container > .btn {
    background-color: #fff;
    border: 1px solid var(--sz-card-border);
    border-radius: 8px;
    color: #1c1917;
    box-shadow: var(--sz-card-shadow);
    font-size: .875rem;
    font-weight: 500;
    padding: .6rem .75rem;
    text-align: left;
    width: 100%;
    transition: border-color .12s, background-color .12s, box-shadow .12s;
}

.centered-button-container > .btn:hover,
.centered-button-container > .btn:active {
    background-color: var(--sz-primary-light);
    border-color: var(--sz-primary);
    color: var(--sz-primary-hover);
    box-shadow: 0 2px 8px rgba(37,99,235,.12);
}

/* ── List rows ────────────────────────────────────────────── */

.scizu-two-line-row {
    border-bottom: 1px solid var(--sz-card-border);
    padding-left: .5rem;
    border-left: 3px solid transparent;
    transition: border-color .12s, background-color .12s;
}

.scizu-two-line-row:hover {
    background-color: var(--sz-primary-light);
    border-left-color: var(--sz-primary);
}

/* ── Inputs ───────────────────────────────────────────────── */

.form-control {
    border-color: var(--sz-card-border);
}

.form-control:focus,
textarea.form-control:focus {
    border-color: var(--sz-primary);
    box-shadow: var(--sz-input-focus-shadow);
}

select:focus {
    border-color: var(--sz-primary);
    outline: none;
    box-shadow: var(--sz-input-focus-shadow);
}

/* ── Primary button ───────────────────────────────────────── */

.btn-primary {
    background-color: var(--sz-primary);
    border-color: var(--sz-primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: var(--sz-primary-hover);
    border-color: var(--sz-primary-hover);
    color: #fff;
}

.btn-primary:focus {
    box-shadow: var(--sz-input-focus-shadow);
    background-color: var(--sz-primary);
    border-color: var(--sz-primary);
}

/* ── Outline secondary in modals ──────────────────────────── */

.modal-body .btn-outline-secondary,
.modal-footer .btn-outline-secondary {
    border-color: var(--sz-card-border);
    color: #44403c;
}

.modal-body .btn-outline-secondary:hover,
.modal-footer .btn-outline-secondary:hover {
    background-color: var(--sz-primary-light);
    border-color: var(--sz-primary);
    color: var(--sz-primary-hover);
}

/* ── Muted text ───────────────────────────────────────────── */

.text-muted {
    color: var(--sz-text-secondary) !important;
}

/* ── Themed modal header (opt-in) ─────────────────────────── */
/* Add class sz-themed-header to .scizu-cg-dialog-box to get  */
/* the branded blue header treatment.                          */

.scizu-cg-dialog-box.sz-themed-header > .modal-header {
    background-color: var(--sz-primary);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 1rem 0;
}

.scizu-cg-dialog-box.sz-themed-header > .modal-header .modal-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.scizu-cg-dialog-box.sz-themed-header > .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: .8;
}

.scizu-cg-dialog-box.sz-themed-header > .modal-footer {
    background-color: var(--sz-modal-header-bg);
    border-top: 1px solid var(--sz-card-border);
    padding: .75rem 1.25rem;
}

/* ── OverflowMenuView ─────────────────────────────────────── */

.sz-overflow-menu {
    position: relative;
    display: flex;
    align-items: center;
}

/* Wide screens: trigger hidden, children shown inline as a row */
.sz-overflow-menu__trigger {
    display: none;
}

.sz-overflow-menu__panel {
    display: flex;
    flex-direction: row;
    gap: 4px;
}

/* Narrow screens (<400px): trigger visible, panel hidden behind it */
@media (max-width: 399px) {
    .sz-overflow-menu__icon {
        transition: transform 0.15s ease;
    }

    .sz-overflow-menu[data-open="true"] .sz-overflow-menu__icon {
        transform: scaleX(-1);
    }

    .sz-overflow-menu__trigger {
        display: flex;
        align-items: center;
        background: none;
        border: none;
        padding: 4px 8px;
        cursor: pointer;
        color: inherit;
        line-height: 1;
    }

    .sz-overflow-menu__trigger:focus-visible {
        outline: 2px solid var(--sz-primary);
        border-radius: 4px;
    }

    .sz-overflow-menu__panel {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        right: 0;
        z-index: 100;
        background: #fff;
        border: 1px solid var(--sz-card-border);
        border-radius: var(--sz-card-radius);
        box-shadow: var(--sz-card-shadow);
        padding: 6px;
        gap: 4px;
        white-space: nowrap;
    }

    .sz-overflow-menu[data-open="true"] .sz-overflow-menu__panel {
        display: flex;
        animation: sz-overflow-menu-slide-in 0.15s ease-out;
    }
}

@keyframes sz-overflow-menu-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress overlay stages ──────────────────────────────── */

.progress-stages-list {
    margin: 20px auto 0;
    max-width: 260px;
    text-align: left;
}

.progress-stage-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 14px;
    color: #44403c;
}

.progress-stage-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.progress-stage-pending .progress-stage-icon {
    color: #d6d3d1;
}

.progress-stage-pending-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d6d3d1;
}

.progress-stage-running .progress-stage-icon {
    color: var(--sz-primary);
}

.progress-stage-running .progress-stage-label {
    color: var(--sz-primary);
    font-weight: 500;
}

.progress-stage-done .progress-stage-icon {
    color: #16a34a;
}

.progress-stage-done .progress-stage-label {
    color: #78716c;
}

.progress-stage-error .progress-stage-icon {
    color: #dc2626;
}

.progress-stage-error .progress-stage-label {
    color: #dc2626;
}

.progress-stage-message {
    font-size: 12px;
    color: #dc2626;
    margin-left: 4px;
}

.progress-overlay-error {
    margin-top: 14px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 13px;
    color: #b91c1c;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.progress-overlay-dismiss {
    align-self: flex-end;
}

/* ── Notes expanded (EditTaskModal) ───────────────────────── */

/* Mobile: full-screen overlay (hidden on desktop) */
.task-notes-mobile-overlay {
    display: none;
}

@media (max-width: 767px) {
    .task-notes-mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: #fff;
        padding: 12px;
        display: flex;
        flex-direction: column;
    }

    .task-notes-mobile-textarea {
        flex: 1;
        resize: none;
    }
}

/* Desktop: bigger in-place textarea */
@media (min-width: 768px) {
    .task-notes-desktop-expanded {
        min-height: 240px;
    }
}

/* ── Markdown headings inside task notes ─────────────────── */
/* Showdown produces raw <h1>–<h6>; scope their size so they  */
/* stay proportional to the modal rather than page-level.     */

.task-note-content h1,
.task-note-content h2,
.task-note-content h3,
.task-note-content h4,
.task-note-content h5,
.task-note-content h6 {
    margin-top: 0.75em;
    margin-bottom: 0.2em;
    line-height: 1.3;
}

.task-note-content h1 { font-size: 0.95rem; font-weight: 700; }
.task-note-content h2 { font-size: 0.9rem;  font-weight: 700; }
.task-note-content h3 { font-size: 0.875rem; font-weight: 600; }
.task-note-content h4,
.task-note-content h5,
.task-note-content h6 { font-size: 0.85rem; font-weight: 600; }

/* ── Modal tab bar (.sz-modal-tab-bar) ────────────────────── */
/* Sits at the bottom of .modal-header; the active underline  */
/* lands flush on the header's bottom border.                 */

.modal-header {
    flex-wrap: wrap;
    row-gap: 0;
    padding: 1rem 0;
}

.sz-modal-tab-bar {
    display: flex;
    flex-basis: 100%;
    gap: 0;
    margin: 4px 0 -1rem 0;   /* overlap bottom padding */
}

.modal-header:has(.sz-modal-tab-bar) {
    border-bottom: none;
}

.sz-modal-tab {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--sz-text-secondary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 4px 14px 6px;
    transition: color 0.15s, border-color 0.15s;
}

.sz-modal-tab:hover {
    color: var(--sz-primary);
}

.sz-modal-tab--active {
    border-bottom-color: var(--sz-primary);
    color: var(--sz-primary);
}
