﻿/* ============================================================
   XMPFormViewerPage.css
   Split-pane layout: collapsible forms sidebar + full-height viewer.
   Theme: matches XManagementPro light/blue UI (MyGlass.css + Workflow.css).
   Uses the same tokens as Workflow.css and XMPFormviewer.css.
   ============================================================ */

/* ── Page shell ─────────────────────────────────────────────
   Takes over the full viewport below the app nav bar.
   Adjust the 64px offset to match your actual nav height.    */
.fvp-shell {
    display: flex;
    flex-direction: row;
    height: calc(100dvh - 64px);
    width: 100%;
    overflow: hidden;
    background: #f0f2f8;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #1e2a45;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.fvp-sidebar {
    width: 260px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #d4daea;
    overflow: hidden;
    transition: width 0.22s ease, min-width 0.22s ease;
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(30,42,69,0.06);
}

.fvp-sidebar--collapsed {
    width: 36px;
    min-width: 36px;
}

/* Sidebar header — matches the blue gradient header style */
.fvp-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 9px;
    background: linear-gradient(135deg, #2c3e72 0%, #3a5298 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    min-height: 40px;
}

.fvp-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
}

.fvp-sidebar-count {
    font-size: 10px;
    font-weight: 600;
    background: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.9);
    border-radius: 10px;
    padding: 1px 7px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.2);
}

.fvp-collapse-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

    .fvp-collapse-btn:hover {
        background: rgba(255,255,255,0.25);
        color: #ffffff;
    }

/* Sidebar toolbar: search + action buttons */
.fvp-sidebar-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 8px;
    background: #f6f8fc;
    border-bottom: 1px solid #d4daea;
    flex-shrink: 0;
}

.fvp-search {
    flex: 1;
    min-width: 0;
    height: 27px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #d4daea;
    border-radius: 5px;
    color: #1e2a45;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .fvp-search::placeholder {
        color: #a0aabf;
    }

    .fvp-search:focus {
        border-color: #5b8dee;
        box-shadow: 0 0 0 3px rgba(91,141,238,0.15);
    }

.fvp-icon-btn {
    flex-shrink: 0;
    width: 27px;
    height: 27px;
    background: #ffffff;
    border: 1px solid #d4daea;
    border-radius: 5px;
    color: #6b7a99;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .fvp-icon-btn:hover {
        background: #e8f0fd;
        border-color: #5b8dee;
        color: #3a6fd8;
    }

/* Form list — scrollable, fills remaining sidebar height */
.fvp-form-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px 6px 12px;
    background: #ffffff;
}

    .fvp-form-list::-webkit-scrollbar {
        width: 4px;
    }

    .fvp-form-list::-webkit-scrollbar-track {
        background: #f0f2f8;
    }

    .fvp-form-list::-webkit-scrollbar-thumb {
        background: #bcc5d9;
        border-radius: 2px;
    }

        .fvp-form-list::-webkit-scrollbar-thumb:hover {
            background: #8898bb;
        }

/* Individual form card */
.fvp-form-card {
    padding: 8px 9px 6px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 2px;
    transition: background 0.13s, border-color 0.13s;
}

    .fvp-form-card:hover {
        background: #f6f8fc;
        border-color: #d4daea;
    }

.fvp-form-card--active {
    background: #e8f0fd;
    border-color: #5b8dee;
}

    .fvp-form-card--active:hover {
        background: #dce8fc;
    }

.fvp-form-card-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}

.fvp-form-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e2a45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.fvp-form-card--active .fvp-form-name {
    color: #3a6fd8;
}

.fvp-form-ver {
    font-size: 10px;
    font-weight: 500;
    color: #a0aabf;
    white-space: nowrap;
    flex-shrink: 0;
}

.fvp-form-card-meta {
    font-size: 10px;
    color: #a0aabf;
    display: flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fvp-dot {
    opacity: 0.5;
}

/* Action row — hidden until card is hovered */
.fvp-form-card-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.18s ease, opacity 0.18s ease, margin-top 0.18s ease;
}

.fvp-form-card:hover .fvp-form-card-actions,
.fvp-form-card--active .fvp-form-card-actions {
    max-height: 60px;
    opacity: 1;
    margin-top: 6px;
}

.fvp-act-btn {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
    white-space: nowrap;
}

/* Match the app's badge/button colour language */
.fvp-act-view {
    background: #e8f0fd;
    border-color: #c5d8fb;
    color: #3a6fd8;
}

.fvp-act-edit {
    background: #e6f7f3;
    border-color: #a8e8d8;
    color: #1d8f70;
}

.fvp-act-reparse {
    background: #fef3e7;
    border-color: #f5cfa0;
    color: #c06e1a;
}

.fvp-act-delete {
    background: #fdeef0;
    border-color: #f5b8be;
    color: #c0404e;
}

.fvp-act-view:hover {
    background: #d5e5fc;
    border-color: #5b8dee;
}

.fvp-act-edit:hover {
    background: #c8f0e6;
    border-color: #27b08b;
}

.fvp-act-reparse:hover {
    background: #fde3c4;
    border-color: #e8943a;
}

.fvp-act-delete:hover {
    background: #fbd9dd;
    border-color: #e05c6a;
}

/* Empty state in list */
.fvp-empty {
    padding: 20px 10px;
    font-size: 11px;
    color: #a0aabf;
    text-align: center;
}

/* ── Main / viewer area ──────────────────────────────────── */
.fvp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    /* The XMPFormViewer fills the entire main area.
   Remove border-radius so it sits flush against the sidebar. */
    .fvp-main > .xfv-root {
        flex: 1;
        min-height: 0;
        border-radius: 0;
        border-top: none;
        border-bottom: none;
        border-right: none;
    }

    /* ── XMPFormViewer thumbnail panel fix ──────────────────────
   .fvp-main is a bounded flex column, so height:100% on the
   thumbnail panel now resolves correctly. Override the dvh
   fallback set in XMPFormviewer.css.                         */
    .fvp-main .fv-panel-left {
        height: 100%;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden;
    }

/* Empty state when no form is selected */
.fvp-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #a0aabf;
    padding: 40px;
    background: #f0f2f8;
}

.fvp-empty-icon {
    font-size: 48px;
    opacity: 0.35;
}

.fvp-empty-heading {
    font-size: 16px;
    font-weight: 600;
    color: #6b7a99;
}

.fvp-empty-sub {
    font-size: 12px;
    color: #a0aabf;
    text-align: center;
    max-width: 280px;
    line-height: 1.6;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .fvp-sidebar {
        width: 210px;
        min-width: 210px;
    }
}

@media (max-width: 640px) {
    .fvp-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 20;
        box-shadow: 4px 0 20px rgba(30,42,69,0.18);
    }

    .fvp-sidebar--collapsed {
        width: 0;
        min-width: 0;
    }
}
/* In the <style> section of XMPFormViewer.razor */
.fv-state-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    margin-top: 4px;
}

.fv-state-draft {
    background: #e3f2fd;
    color: #1565c0;
}

.fv-state-signatureready {
    background: #fff3e0;
    color: #e65100;
}

.fv-state-lockedforsignature {
    background: #ffebee;
    color: #c62828;
}

.fv-state-allsigned {
    background: #e8f5e9;
    color: #2e7d32;
}

.fv-state-declined {
    background: #fce4ec;
    color: #c2185b;
}

.fv-state-revoked {
    background: #f3e5f5;
    color: #6a1b9a;
}

.fv-locked-badge {
    display: inline-block;
    margin-left: 12px;
    padding: 2px 6px;
    background: #ffcdd2;
    color: #b71c1c;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}