/*
 * KYC document preview controls — styles for the in-modal toolbar (zoom + maximize)
 * shared by AddCustomer, ReviewCustomerDetails, and ApproveCustomer.
 */

.kyc-doc-preview-toolbar {
    margin-left: auto;
}

.kyc-doc-preview-toolbar .btn {
    background-color: transparent !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
    height: 32px;
    transition: background-color 0.2s ease;
    box-shadow: none;
}

.kyc-doc-preview-toolbar .btn i,
.kyc-doc-preview-toolbar .btn i::before {
    color: #ffffff !important;
    font-size: 1rem;
    pointer-events: none;
}

.kyc-doc-preview-toolbar .btn:hover,
.kyc-doc-preview-toolbar .btn:focus,
.kyc-doc-preview-toolbar .btn:active {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    outline: none;
    box-shadow: none;
}

.kyc-doc-preview-toolbar .kyc-doc-zoom-level {
    min-width: 3rem;
    text-align: center;
    font-weight: 600;
    color: #ffffff !important;
    font-size: 0.95rem;
}

/* Maximized state — fills the viewport. Overrides Bootstrap's modal-dialog sizing
   and any prior drag (position/left/top) so Restore / Close stay on-screen. */
.kyc-doc-modal--maximized .modal-dialog {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh;
    margin: 0 !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

.kyc-doc-modal--maximized .modal-content {
    height: 100vh;
    border-radius: 0;
}

.kyc-doc-modal--maximized .modal-body {
    max-height: calc(100vh - 56px) !important;
    height: calc(100vh - 56px);
    overflow: auto;
}

.kyc-doc-modal--maximized .approve-doc-preview-img,
.kyc-doc-modal--maximized .kyc-doc-preview,
.kyc-doc-modal--maximized #imgGSTDocAttachment,
.kyc-doc-modal--maximized #imgAttachment,
.kyc-doc-modal--maximized #checkerSavedDocImg,
.kyc-doc-modal--maximized #mpvVehicleRcModalImg,
.kyc-doc-modal--maximized #vapVehicleRcModalImg {
    max-height: none;
}

.kyc-doc-modal--maximized .approve-doc-preview-iframe,
.kyc-doc-modal--maximized #checkerSavedDocIframe,
.kyc-doc-modal--maximized #gstDocPdfFrame,
.kyc-doc-modal--maximized #vapVehicleRcModalIframe,
.kyc-doc-modal--maximized #mpvVehicleRcModalIframe {
    min-height: calc(100vh - 120px);
}

/* Modal shell — fixed size; only the body scrolls when zoomed content is taller. */
.kyc-doc-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    overflow: hidden;
}

.kyc-doc-modal .modal-header,
.kyc-doc-modal .modal-footer {
    flex-shrink: 0;
}

/* Scrollable preview area — fixed height; content zooms inside and scrolls when larger. */
.kyc-doc-modal .modal-body {
    flex: 0 0 auto;
    height: min(65vh, 680px);
    min-height: min(65vh, 680px);
    max-height: min(65vh, 680px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
}

.kyc-doc-modal .modal-body img.kyc-doc-preview,
.kyc-doc-modal .modal-body iframe.kyc-doc-preview {
    vertical-align: top;
    max-width: none !important;
    width: auto;
    height: auto;
}

.kyc-doc-modal .modal-body iframe.kyc-doc-preview:not(.d-none) {
    width: 100%;
    min-height: 420px;
    border: none;
}
