﻿/**
 * MEDIA COMPONENTS
 * ================
 * 
 * Book Grids, Lightboxes, Image Carousels, and Media Elements
 * Note: Mobile book carousel functionality has been removed
 */

/* Book Cover Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 0;
}

.book-cover {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

    .book-cover:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

    .book-cover img {
        width: 100%;
        height: auto;
        border-radius: 8px;
        aspect-ratio: 2/3;
        object-fit: cover;
    }

/* Book Lightbox Modal */
.book-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

    .book-lightbox-overlay.active {
        display: flex;
        flex-direction: column;
    }

.book-lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.book-lightbox-image {
    max-width: 400px;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    margin-bottom: 2rem;
}

.book-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid white;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 2001;
}

    .book-lightbox-close:hover {
        background: #ef4444;
        border-color: #ef4444;
        transform: scale(1.1);
    }

.book-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 2002;
}

    .book-lightbox-nav:hover {
        background: var(--primary);
        border-color: var(--primary);
        transform: translateY(-50%) scale(1.1);
    }

    .book-lightbox-nav:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        background: rgba(255,255,255,0.05);
    }

        .book-lightbox-nav:disabled:hover {
            transform: translateY(-50%);
            background: rgba(255,255,255,0.05);
            border-color: white;
        }

.book-lightbox-prev {
    left: -80px;
}

.book-lightbox-next {
    right: -80px;
}

.book-lightbox-counter {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.875rem;
    background: rgba(0,0,0,0.7);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    z-index: 2002;
}

.book-lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    max-width: 600px;
    background: rgba(0,0,0,0.7);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

    .book-lightbox-caption h4 {
        font-size: 1.75rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: white;
        font-family: "gelica", sans-serif;
    }

    .book-lightbox-caption p {
        font-size: 1.125rem;
        opacity: 0.95;
        line-height: 1.6;
        margin: 0;
    }

/* Image Carousel Components (for regular image carousels, not book carousels) */
.carousel-container {
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.carousel-track {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    aspect-ratio: 16/9;
    background: #f3f4f6;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    cursor: pointer;
    border-radius: 0.75rem;
    overflow: hidden;
}

    .carousel-slide.active {
        opacity: 1;
    }

    .carousel-slide.prev {
        opacity: 0;
    }

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.carousel-slide:hover .carousel-image {
    transform: scale(1.05);
}

.carousel-nav {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

    .carousel-nav:hover {
        background: var(--primary-dark);
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }

    .carousel-nav:active {
        transform: scale(0.95);
    }

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 3rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.carousel-slide:hover .carousel-caption {
    transform: translateY(0);
}

.carousel-caption h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.carousel-caption p {
    font-size: 0.875rem;
    opacity: 0.9;
    line-height: 1.4;
    margin: 0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .carousel-dot:hover {
        background: var(--primary-light);
        transform: scale(1.2);
    }

    .carousel-dot.active {
        background: var(--primary);
        transform: scale(1.3);
    }

/* Lightbox Overlay for Image Carousels */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

    .lightbox-overlay.active {
        display: flex;
        flex-direction: column;
    }

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

    .lightbox-nav:hover {
        background: var(--primary);
        border-color: var(--primary);
        transform: translateY(-50%) scale(1.1);
    }

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid white;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 2001;
}

    .lightbox-close:hover {
        background: #ef4444;
        border-color: #ef4444;
        transform: scale(1.1);
    }

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    max-width: 600px;
    background: rgba(0,0,0,0.7);
    padding: 1rem 2rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

    .lightbox-caption h4 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        color: white;
    }

    .lightbox-caption p {
        font-size: 1rem;
        opacity: 0.9;
        line-height: 1.6;
        margin: 0;
    }

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 0.875rem;
    background: rgba(0,0,0,0.7);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

/* Popup Modal System */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.popup-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

    .popup-close:hover {
        color: #333;
    }
