/* ============================================================
   Tekcom PDF Flipbook Widget
   ============================================================ */

.tekcom-flipbook-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    box-sizing: border-box;
    padding-bottom: 60px;
}

/* ── Loading ─────────────────────────────────────────────── */
.tekcom-flipbook-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 20;
    background: inherit;
    transition: opacity 0.3s ease;
}

.tekcom-flipbook-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.tekcom-flipbook-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tekcom-spin 0.9s linear infinite;
}

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

.tekcom-flipbook-loading-text {
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    opacity: 0.8;
}

/* ── Placeholder (editor, no PDF) ────────────────────────── */
.tekcom-flipbook-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 24px;
}

.tekcom-flipbook-placeholder p {
    color: #888;
    font-size: 15px;
    margin: 0;
}

/* ── Stage ───────────────────────────────────────────────── */
.tekcom-flipbook-stage {
    position: relative;
    flex-shrink: 0;
    z-index: 1;
}

.tekcom-flipbook-stage canvas {
    display: block;
}

/* ── Controls Bar ────────────────────────────────────────── */
.tekcom-flipbook-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* ── Buttons ─────────────────────────────────────────────── */
.tekcom-flipbook-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    padding: 0;
    text-decoration: none;
    flex-shrink: 0;
}

.tekcom-flipbook-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.tekcom-flipbook-btn:active {
    transform: scale(0.95);
}

.tekcom-flipbook-btn svg {
    fill: #ffffff;
    flex-shrink: 0;
}

.tekcom-flipbook-btn:disabled,
.tekcom-flipbook-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* ── Page Info ───────────────────────────────────────────── */
.tekcom-flipbook-pageinfo {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-family: inherit;
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Fullscreen mode ─────────────────────────────────────── */
.tekcom-flipbook-wrap.is-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    z-index: 99999;
    border-radius: 0;
    padding-bottom: 60px;
}

.tekcom-flipbook-wrap.is-fullscreen .tekcom-flipbook-stage {
    width: 100% !important;
    height: calc(100vh - 60px) !important;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .tekcom-flipbook-controls {
        gap: 8px;
    }
    .tekcom-flipbook-btn {
        width: 32px;
        height: 32px;
    }
}
