/**
 * Marquee Gallery - Styles
 * 
 * CSS animations for scrolling gallery with lightbox
 */

/* CSS Variables */
:root {
    --mg-height: 150px;
    --mg-gap: 10px;
    --mg-speed: 30s;
}

/* Container */
.marquee-gallery-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 20px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Track - holds the scrolling content */
.marquee-gallery-track {
    display: flex;
    width: fit-content;
    animation: mg-scroll var(--mg-speed) linear infinite;
}

/* Pause on hover/touch */
.marquee-gallery-container:hover .marquee-gallery-track,
.marquee-gallery-container.paused .marquee-gallery-track {
    animation-play-state: paused;
}

/* Right direction */
.marquee-gallery-track[data-direction="right"] {
    animation-name: mg-scroll-right;
}

/* Content wrapper */
.marquee-gallery-content {
    display: flex;
    gap: var(--mg-gap);
    padding-right: var(--mg-gap);
}

/* Gallery item */
.marquee-gallery-item {
    flex-shrink: 0;
    height: var(--mg-height);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.marquee-gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.marquee-gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.marquee-gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.marquee-gallery-item img {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* Scroll animation - left to right */
@keyframes mg-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Scroll animation - right to left */
@keyframes mg-scroll-right {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* ==================== */
/* LIGHTBOX STYLES      */
/* ==================== */

.mg-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mg-lightbox.active {
    display: flex;
    opacity: 1;
}

.mg-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    animation: mg-lightbox-zoom 0.3s ease;
}

@keyframes mg-lightbox-zoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.mg-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 30px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000000;
}

.mg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Error message */
.mg-error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
    background: #fdf2f2;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .marquee-gallery-container {
        border-radius: 0;
        padding: 15px 0;
    }
    
    .marquee-gallery-item {
        border-radius: 6px;
    }
    
    .mg-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}
