/*!
 * Book Preview Modal Styles
 * Author: Toluwalase Mebaanne
 * For: The Cricket War - Sandra McTavish
 */

/* Modal Overlay */
.book-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.book-modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.book-modal-overlay.active .book-modal-container {
    transform: scale(1);
}

/* Close Button */
.book-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-modal-close:hover {
    background: #0F514E;
    transform: rotate(90deg) scale(1.1);
}

/* Page Display Area */
.book-modal-viewer {
    position: relative;
    width: 100%;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    user-select: none;
}

.book-modal-page {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

/* Navigation Arrows */
.book-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.book-modal-nav:hover:not(:disabled) {
    background: #0F514E;
    transform: translateY(-50%) scale(1.15);
}

.book-modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.book-modal-nav.prev {
    left: 1rem;
}

.book-modal-nav.next {
    right: 1rem;
}

/* Page Counter */
.book-modal-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 5;
}

/* Mobile Responsiveness */
@media (max-width: 767.98px) {
    .book-modal-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .book-modal-viewer {
        height: 80vh;
    }
    
    .book-modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .book-modal-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .book-modal-nav.prev {
        left: 0.5rem;
    }
    
    .book-modal-nav.next {
        right: 0.5rem;
    }
    
    .book-modal-counter {
        bottom: 0.5rem;
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
}

/* Prevent text selection and dragging */
.book-modal-overlay * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.book-modal-page {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}