/* Ktubi Custom Styles for PDF.js v5 */
/* Brand theme: teal + gold, matching ktubi.net identity */

:root {
    --ktubi-pdf-deep: #00483f;
    --ktubi-pdf-primary: #00766e;
    --ktubi-pdf-primary-2: #12998f;
    --ktubi-pdf-gold: #f2ae42;
    --ktubi-pdf-gold-soft: #ffe6b6;
    --ktubi-pdf-surface: #fbfaf5;
    --ktubi-pdf-panel: #ffffff;
    --ktubi-pdf-line: rgba(0, 72, 63, 0.16);
    --ktubi-pdf-text: #183936;
}

#editorHighlight,
#editorFreeText,
#editorInk,
#editorStamp,
#editorModeSeparator,
#secondaryToolbarToggle {
    display: none !important;
}

#sidebarToggle,
#sidebarToggleButton,
#viewFind,
#viewFindButton,
#print,
#printButton,
#download,
#downloadButton,
#secondaryPrint,
#secondaryDownload,
#sidebarContainer {
    display: none !important;
}

body {
    background:
        radial-gradient(rgba(0, 72, 63, 0.1) 0.7px, transparent 0.7px),
        var(--ktubi-pdf-surface) !important;
    background-size: 12px 12px !important;
}

#outerContainer,
#mainContainer {
    background: transparent !important;
}

#mainContainer {
    min-width: 100px;
}

#toolbarContainer {
    background: linear-gradient(90deg, var(--ktubi-pdf-deep), var(--ktubi-pdf-primary)) !important;
    border-top-right-radius: 8px;
    border-top-left-radius: 8px;
    border-bottom: 3px solid var(--ktubi-pdf-gold) !important;
    box-shadow: 0 8px 20px rgba(0, 72, 63, 0.18) !important;
}

#toolbarViewer {
    padding-inline: 6px !important;
}

.toolbarButton,
.toolbarButtonWithContainer,
.splitToolbarButton,
.toolbarField,
.dropdownToolbarButton {
    border-radius: 6px !important;
}

.toolbarButton:hover,
.toolbarButton:focus-visible,
.dropdownToolbarButton:hover,
.dropdownToolbarButton:focus-within {
    background-color: rgba(255, 255, 255, 0.14) !important;
}

.toolbarButton::before {
    filter: brightness(0) invert(1) !important;
    opacity: 0.95 !important;
}

.toolbarLabel,
#numPages,
#pageNumberLabel {
    color: #ffffff !important;
    font-weight: 700 !important;
}

#pageNumber {
    min-width: 44px !important;
    color: var(--ktubi-pdf-text) !important;
    background: #ffffff !important;
    border: 1px solid rgba(255, 230, 182, 0.8) !important;
    border-radius: 6px !important;
    box-shadow: inset 0 0 0 1px rgba(242, 174, 66, 0.18) !important;
}

#pageNumber:focus {
    outline: 2px solid var(--ktubi-pdf-gold) !important;
    outline-offset: 1px !important;
}

.dropdownToolbarButton {
    color: var(--ktubi-pdf-text) !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(255, 230, 182, 0.75) !important;
}

.dropdownToolbarButton select,
#scaleSelect {
    color: var(--ktubi-pdf-text) !important;
    background-color: #ffffff !important;
    font-weight: 700 !important;
}

.splitToolbarButtonSeparator,
.verticalToolbarSeparator {
    background-color: rgba(255, 230, 182, 0.45) !important;
}

#loadingBar {
    background-color: rgba(0, 72, 63, 0.12) !important;
}

#loadingBar .progress {
    background: linear-gradient(90deg, var(--ktubi-pdf-gold), var(--ktubi-pdf-primary-2)) !important;
}

#viewerContainer {
    background:
        radial-gradient(rgba(0, 118, 110, 0.08) 0.8px, transparent 0.8px),
        var(--ktubi-pdf-surface) !important;
    background-size: 14px 14px !important;
}

.pdfViewer .page {
    border: 1px solid var(--ktubi-pdf-line) !important;
    border-radius: 4px !important;
    box-shadow: 0 10px 26px rgba(0, 72, 63, 0.12) !important;
}

#fullscreen {
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#fullscreen::before {
    display: none !important;
    content: none !important;
}

#fullscreen img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

#logoContainer {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: #ffffff !important;
    border: 1px solid rgba(242, 174, 66, 0.55);
    border-radius: 6px;
    padding: 2px 7px;
    margin-left: 6px;
    box-shadow: 0 4px 10px rgba(0, 72, 63, 0.12);
}

#logoContainer::before {
    display: none !important;
    content: none !important;
}

#logoContainer img {
    height: 25px;
    width: 40px;
    object-fit: contain;
}

.pdfViewer .page.loadingIcon::after,
.pdfViewer .page.loading::after {
    display: none !important;
    background: none !important;
}

.doorHanger,
.doorHangerRight,
.menu,
.dialog,
.messageBar {
    border-color: var(--ktubi-pdf-line) !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 32px rgba(0, 72, 63, 0.16) !important;
}

.primaryButton,
.dialogButton {
    background: var(--ktubi-pdf-primary) !important;
    border-color: var(--ktubi-pdf-primary) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
}

.primaryButton:hover,
.dialogButton:hover {
    background: var(--ktubi-pdf-deep) !important;
    border-color: var(--ktubi-pdf-deep) !important;
}

@media (max-width: 640px) {
    #toolbarContainer {
        border-radius: 0;
    }

    #toolbarViewer {
        gap: 3px !important;
        padding-inline: 4px !important;
    }

    #pageNumber {
        min-width: 38px !important;
    }

    #logoContainer {
        padding-inline: 5px;
        margin-left: 3px;
    }
}
