/**
 * DM 3D FlipBook - Complete Cyberpunk Stylesheet
 * Dance Mogul Magazine Edition
 */

/* Container */
.dm-flipbook-wrapper {
    margin: 20px auto;
    position: relative;
}

.dm-flipbook-container {
    background: linear-gradient(135deg, #0a0a1e 0%, #1a1a2e 100%);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(255, 0, 255, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

/* Scanline Effect */
.dm-flipbook-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.03),
        rgba(0, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100;
    border-radius: 12px;
}

/* Viewport */
.dm-flipbook-viewport {
    width: 100%;
    height: calc(100% - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

/* Book */
.dm-flipbook-book {
    display: flex;
    gap: 10px;
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* Pages */
.dm-flipbook-page {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(0, 255, 255, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.dm-flipbook-page-flip {
    animation: pageFlip 0.6s ease;
}

@keyframes pageFlip {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
    }
    50% {
        transform: rotateY(90deg);
        opacity: 0.5;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Controls */
.dm-flipbook-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.dm-flipbook-controls-left,
.dm-flipbook-controls-right {
    display: flex;
    gap: 8px;
}

.dm-flipbook-controls-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Buttons */
.dm-flipbook-btn {
    background: linear-gradient(135deg, #00ffff 0%, #ff00ff 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #1a1a2e;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.dm-flipbook-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.8),
        0 0 40px rgba(255, 0, 255, 0.5);
    background: linear-gradient(135deg, #ff00ff 0%, #00ffff 100%);
}

.dm-flipbook-btn:active {
    transform: translateY(0);
}

.dm-flipbook-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #1a1a2e;
}

/* Page Info */
.dm-flipbook-page-info {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 6px;
    padding: 5px 15px;
    color: #00ffff;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    font-size: 14px;
}

.dm-flipbook-separator {
    margin: 0 5px;
    opacity: 0.7;
}

/* Loading Screen */
.dm-flipbook-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #0a0a1e 0%, #1a1a2e 100%);
    border-radius: 12px;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.dm-flipbook-loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 255, 255, 0.2);
    border-top-color: #00ffff;
    border-bottom-color: #ff00ff;
    border-radius: 50%;
    animation: cyber-spin 1s linear infinite;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(255, 0, 255, 0.3);
}

@keyframes cyber-spin {
    0% { 
        transform: rotate(0deg);
        box-shadow: 
            0 0 20px rgba(0, 255, 255, 0.5),
            0 0 40px rgba(255, 0, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(0, 255, 255, 0.8),
            0 0 60px rgba(255, 0, 255, 0.5);
    }
    100% { 
        transform: rotate(360deg);
        box-shadow: 
            0 0 20px rgba(0, 255, 255, 0.5),
            0 0 40px rgba(255, 0, 255, 0.3);
    }
}

.dm-flipbook-loading-text {
    color: #00ffff;
    margin-top: 20px;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* Fullscreen */
.dm-flipbook-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
}

.dm-flipbook-fullscreen .dm-flipbook-viewport {
    height: calc(100% - 60px);
}

/* Thumbnails */
.dm-flipbook-thumbnails {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    border-left: 1px solid rgba(0, 255, 255, 0.3);
    z-index: 20;
}

.dm-flipbook-thumbnails-header {
    padding: 15px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dm-flipbook-thumbnails-header h3 {
    color: #00ffff;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.dm-flipbook-thumbnails-close {
    background: none;
    border: none;
    color: #00ffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.dm-flipbook-thumbnails-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-y: auto;
    height: calc(100% - 60px);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .dm-flipbook-controls {
        padding: 8px 10px;
    }
    
    .dm-flipbook-btn {
        padding: 6px 10px;
        min-width: 36px;
    }
    
    .dm-flipbook-btn .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
    
    .dm-flipbook-controls-left,
    .dm-flipbook-controls-right {
        gap: 5px;
    }
    
    .dm-flipbook-page-info {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .dm-flipbook-viewport {
        padding: 10px;
    }
    
    .dm-flipbook-thumbnails {
        width: 100%;
    }
}

/* Print Protection */
@media print {
    .dm-flipbook-wrapper {
        display: none !important;
    }
}

/* Accessibility */
.dm-flipbook-btn:focus {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

/* Performance */
.dm-flipbook-container,
.dm-flipbook-page,
.dm-flipbook-book {
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}
