/* Draw / Bracket Viewer — zoom/pan/fullscreen chrome wrapped around the existing
   .pro-bracket-scroll / .pro-bracket-inner bracket (see wwwroot/js/draw-bracket-viewer.js).

   Every new class here is prefixed "zpv-" (zoom-pan-viewer) so it can never collide with
   .pro-bracket-*/.pb-* names, which Views/Draw/DrawPrint.cshtml independently reuses (as
   literal string names, not this stylesheet) for its own standalone print layout. */

.zpv-wrap {
    position: relative;
}

.zpv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid #cdd5e1;
    border-radius: 10px;
    background: #f7f9fc;
    position: sticky;
    top: 0;
    z-index: 20;
}

.zpv-zoom-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.zpv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    min-width: 34px;
    padding: 0 10px;
    border: 1px solid #cdd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1a2233;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}
.zpv-btn:hover:not(:disabled) {
    background: #eff5ff;
    border-color: #9db4d6;
}
.zpv-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(59 130 246 / .35);
}
.zpv-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.zpv-zoom-out, .zpv-zoom-in {
    font-size: 18px;
    min-width: 34px;
    padding: 0;
}

.zpv-pct {
    display: inline-block;
    min-width: 48px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #1a2233;
    user-select: none;
}

.zpv-sep {
    width: 1px;
    align-self: stretch;
    background: #d7dee8;
    margin: 2px 2px;
}

.zpv-roundnav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin-inline-start: auto;
    max-width: 100%;
    padding-bottom: 2px;
}
.zpv-round-btn {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #cdd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #33415c;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.zpv-round-btn:hover {
    background: #eff5ff;
    border-color: #9db4d6;
}
.zpv-round-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(59 130 246 / .35);
}

/* The clipping viewport — was plain overflow-x:auto native scroll before this feature;
   position/zoom are now driven entirely by the transform on .pro-bracket-inner. */
.zpv-viewport {
    overflow: hidden !important;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.zpv-viewport.zpv-dragging {
    cursor: grabbing;
}
/* Suppress the base .pb-card:hover scale effect while actively dragging so it doesn't
   visually compose with the wrapper-level transform (see View.cshtml's .pb-card:hover rule). */
.zpv-dragging .pb-card:hover {
    transform: none !important;
}

.zpv-inner-transform {
    transform-origin: 0 0;
    will-change: transform;
}

/* Fullscreen: expand the wrap + its viewport to fill the screen. */
.zpv-wrap:fullscreen,
.zpv-wrap:-webkit-full-screen {
    background: #ffffff;
    padding: 10px;
    display: flex;
    flex-direction: column;
}
.zpv-wrap:fullscreen .zpv-viewport,
.zpv-wrap:-webkit-full-screen .zpv-viewport {
    flex: 1 1 auto;
    min-height: 0;
}
html.dark .zpv-wrap:fullscreen,
html.dark .zpv-wrap:-webkit-full-screen {
    background: #0b0f1a;
}

@media (max-width: 640px) {
    .zpv-toolbar {
        gap: 6px;
        padding: 6px 8px;
    }
    .zpv-btn {
        height: 40px;
        min-width: 40px;
    }
    .zpv-roundnav {
        margin-inline-start: 0;
        width: 100%;
        order: 10;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zpv-inner-transform {
        transition: none !important;
    }
}

/* Belt-and-braces guard for a raw Ctrl+P on the normal interactive page (the ?print=1
   route never builds this chrome at all — see draw-bracket-viewer.js's print-mode skip —
   but a plain browser print of the interactive view must still ignore any active zoom/pan). */
@media print {
    .zpv-toolbar {
        display: none !important;
    }
    .zpv-viewport {
        overflow: visible !important;
        cursor: default !important;
    }
    .zpv-inner-transform {
        transform: none !important;
    }
}

html.dark .zpv-toolbar {
    background: #121729;
    border-color: #2a3350;
}
html.dark .zpv-btn {
    background: #1a2036;
    border-color: #2a3350;
    color: #e6ebf5;
}
html.dark .zpv-btn:hover:not(:disabled) {
    background: #232b47;
    border-color: #3d4a75;
}
html.dark .zpv-pct {
    color: #e6ebf5;
}
html.dark .zpv-sep {
    background: #2a3350;
}
html.dark .zpv-round-btn {
    background: #1a2036;
    border-color: #2a3350;
    color: #c7d0e6;
}
html.dark .zpv-round-btn:hover {
    background: #232b47;
    border-color: #3d4a75;
}
