/* Digidaad Flipbook - Styles */

.dfb-wrapper {
    position: relative;
    margin: 2em auto;
    width: 100%;
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dfb-wrapper:fullscreen,
.dfb-wrapper:-webkit-full-screen {
    background: #111;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dfb-wrapper:fullscreen .dfb-container,
.dfb-wrapper:-webkit-full-screen .dfb-container {
    flex: 1;
    width: 100%;
    max-height: calc(100vh - 60px);
}

/* Container */
.dfb-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Flipbook element */
.dfb-flipbook {
    margin: 0 auto;
}

/* Pages */
.dfb-page {
    background: #fff;
    overflow: hidden;
}

.dfb-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Loading */
.dfb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    width: 100%;
    min-height: 300px;
}

.dfb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dfb-spin 0.8s linear infinite;
}

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

.dfb-loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Controls */
.dfb-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dfb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.dfb-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dfb-btn:active {
    transform: scale(0.94);
}

.dfb-page-info {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: center;
    user-select: none;
}

/* Mobile */
@media (max-width: 768px) {
    .dfb-wrapper {
        margin: 1em 0;
        border-radius: 0;
    }

    .dfb-container {
        min-height: 350px;
    }

    .dfb-controls {
        gap: 8px;
        padding: 10px 12px;
    }

    .dfb-btn {
        width: 44px;
        height: 44px;
    }

    .dfb-page-info {
        font-size: 13px;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .dfb-container {
        min-height: 280px;
    }
}

/* StPageFlip shadow fixes */
.stf__parent {
    margin: 0 auto !important;
}

.stf__wrapper {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

/* Hide page corner hints on touch devices */
@media (hover: none) and (pointer: coarse) {
    .stf__outerShadow,
    .stf__innerShadow {
        opacity: 0.3 !important;
    }
}
