/* K-Tech PDF Flipbook Frontend CSS - 100% Pure Clean CSS (ZERO !important) */

body.ktech-pdf-zoom-active {
    overflow: hidden;
    touch-action: none;
}

.ktech-pdf-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.ktech-pdf-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    box-sizing: border-box;
}

/* Loader */
.ktech-pdf-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.94);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.ktech-pdf-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(56, 102, 41, 0.15);
    border-top-color: #386629;
    border-radius: 50%;
    animation: ktech-pdf-spin 0.8s linear infinite;
}

@keyframes ktech-pdf-spin {
    to { transform: rotate(360deg); }
}

.ktech-pdf-loading-text {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
}

/* Viewport & Book Area */
.ktech-pdf-viewport {
    position: relative;
    width: 100%;
    max-width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    box-sizing: border-box;
}

.ktech-pdf-book-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

/* Invisible Click Overlay */
.ktech-pdf-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
    background: transparent;
    user-select: none;
    touch-action: manipulation;
}

/* Sleek Emerald Green Disc Cursor Icons */
.ktech-pdf-click-overlay.cursor-flip-prev {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="18" cy="18" r="15" fill="%2322c55e" stroke="%23ffffff" stroke-width="2"/><path d="M21 12L14 18L21 24" stroke="%23ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>') 18 18, w-resize;
}

.ktech-pdf-click-overlay.cursor-flip-next {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="18" cy="18" r="15" fill="%2322c55e" stroke="%23ffffff" stroke-width="2"/><path d="M15 12L22 18L15 24" stroke="%23ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>') 18 18, e-resize;
}

.ktech-pdf-book {
    position: relative;
    margin: 0 auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border-radius: 2px;
}

/* Disable drag folding on child elements */
.ktech-pdf-book, .ktech-page-item, .ktech-page-item canvas {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Floating White Toolbar Anchored SAT to Book Top Right */
.ktech-pdf-container .ktech-pdf-toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 99999;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.ktech-pdf-container .ktech-pdf-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a202c;
    margin: 0;
    padding: 0;
    box-shadow: none;
    transition: all 0.2s ease;
    visibility: visible;
    opacity: 1;
}

.ktech-pdf-container .ktech-pdf-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #386629;
    transform: scale(1.08);
}

.ktech-pdf-container .ktech-pdf-btn svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    visibility: visible;
    opacity: 1;
}

/* Small White Side Tab Sticking Out on Upper Right Edge */
.ktech-pdf-container .ktech-pdf-side-tab {
    position: absolute;
    top: 18px;
    right: -8px;
    width: 10px;
    height: 34px;
    background: #ffffff;
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-left: none;
    z-index: 44;
}

/* Leaf badges anchored SAT to bottom corners of book (Matching Screenshot e.g. 29, 30) */
.ktech-pdf-container .ktech-pdf-page-badge {
    position: absolute;
    bottom: 12px;
    z-index: 45;
    background: #ffffff;
    color: #1a202c;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s ease;
}

.ktech-pdf-container .ktech-pdf-badge-left {
    left: 12px;
    border-radius: 14px 14px 2px 14px;
}

.ktech-pdf-container .ktech-pdf-badge-right {
    right: 12px;
    border-radius: 14px 14px 14px 2px;
}

/* Bottom Progress Scrub Bar (Exact Matching Green Scrub Bar in Reference Image) */
.ktech-pdf-bottom-bar {
    width: 100%;
    padding: 10px 20px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.ktech-pdf-progress-track {
    position: relative;
    width: 90%;
    max-width: 750px;
    height: 14px;
    background: rgba(220, 230, 205, 0.9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ktech-pdf-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #386629;
    border-radius: 20px;
    transition: width 0.2s ease-out;
}

.ktech-pdf-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

/* Thumbnails Modal */
.ktech-pdf-thumbs-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 100001;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 8px;
}

.ktech-pdf-thumbs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.ktech-pdf-thumbs-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #4a5568;
}

.ktech-pdf-thumbs-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    overflow-y: auto;
    padding: 20px 0;
}

.ktech-pdf-thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 6px;
    transition: all 0.2s ease;
}

.ktech-pdf-thumb-item:hover, .ktech-pdf-thumb-item.active {
    border-color: #386629;
    background: rgba(56, 102, 41, 0.05);
}

.ktech-pdf-thumb-item canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.ktech-pdf-thumb-num {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

/* Pure Image Slider Modal (No Top Bar, No Bottom Bar) - Luxury Dark Glassmorphism */
.ktech-pdf-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
}

/* Floating SVG Close Button at Top Right - Perfectly Centered */
.ktech-pdf-zoom-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.ktech-pdf-zoom-close svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke: currentColor;
    fill: none;
    margin: 0;
    padding: 0;
}

.ktech-pdf-zoom-close:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    transform: scale(1.1);
}

.ktech-pdf-zoom-body {
    position: relative;
    width: 100%;
    height: 100vh;
    flex: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Horizontal Image Slider Container & Track */
.ktech-zoom-slider-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.ktech-zoom-slider-track {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.ktech-zoom-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
}

.ktech-zoom-img-holder {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 90vh;
    max-width: 90vw;
}

.ktech-zoom-img {
    max-height: 90vh;
    max-width: 88vw;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #ffffff;
    user-select: none;
    -webkit-user-drag: none;
}

/* Luxury Dark Glass Floating SVG Prev & Next Slider Nav Buttons - Perfectly Centered */
.ktech-zoom-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.8);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ktech-zoom-nav svg {
    width: 26px;
    height: 26px;
    display: block;
    stroke: currentColor;
    fill: none;
    margin: 0;
    padding: 0;
}

.ktech-zoom-prev {
    left: 32px;
}

.ktech-zoom-next {
    right: 32px;
}

.ktech-zoom-nav:hover:not(.disabled) {
    background: #22c55e;
    color: #ffffff;
    border-color: #22c55e;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.5);
    transform: translateY(-50%) scale(1.12);
}

.ktech-zoom-nav.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    box-shadow: none;
}

/* Fullscreen Mode Synchronized Styling */
.ktech-pdf-wrapper:fullscreen,
.ktech-pdf-wrapper:-webkit-full-screen {
    background: #0f172a;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ktech-pdf-wrapper:fullscreen .ktech-pdf-container,
.ktech-pdf-wrapper:-webkit-full-screen .ktech-pdf-container {
    height: 100%;
    max-height: 96vh;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .ktech-pdf-container {
        height: 500px;
        min-height: 450px;
    }

    .ktech-pdf-viewport {
        padding: 10px 0;
    }

    .ktech-pdf-badge-left {
        left: 8px;
    }

    .ktech-pdf-badge-right {
        right: 8px;
    }

    .ktech-pdf-progress-track {
        width: 95%;
    }

    .ktech-zoom-prev {
        left: 10px;
    }

    .ktech-zoom-next {
        right: 10px;
    }

    .ktech-zoom-nav {
        width: 44px;
        height: 44px;
    }

    .ktech-zoom-nav svg {
        width: 22px;
        height: 22px;
    }
}
