/* 
 * Room Rental System - Image Marquee Styles with Lightbox
 * File: assets/css/marquee.css
 */

/* ========================================
   MARQUEE CONTAINER
   ======================================== */

.rrs-marquee-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
}

/* ========================================
   MARQUEE TRACK
   ======================================== */

.rrs-marquee-track {
    display: flex;
    gap: 20px;
    align-items: center;
    width: fit-content;
    animation: marquee-scroll 40s linear infinite;
}

/* Direction Animations */
.rrs-marquee-rtl .rrs-marquee-track {
    animation-name: marquee-scroll-rtl;
}

.rrs-marquee-ltr .rrs-marquee-track {
    animation-name: marquee-scroll-ltr;
}

/* Pause on hover */
.rrs-marquee-pausable:hover .rrs-marquee-track {
    animation-play-state: paused;
}

/* ========================================
   MARQUEE IMAGES
   ======================================== */

.rrs-marquee-image {
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.rrs-marquee-image img {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
    min-height: 100%;
}

/* Hover effect */
.rrs-marquee-pausable .rrs-marquee-image:hover {
    /* transform: scale(1.05); */
    z-index: 10;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
}

/* Hover overlay to indicate clickability */
/* .rrs-marquee-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
} */

.rrs-marquee-image:hover::before {
    opacity: 1;
}

/* Zoom icon on hover */
.rrs-marquee-image::after {
    content: '🔍';
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 24px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.rrs-marquee-image:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes marquee-scroll-rtl {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes marquee-scroll-ltr {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

/* ========================================
   LIGHTBOX STYLES
   ======================================== */

.rrs-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.rrs-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.rrs-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Close Button */
.rrs-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);
    border-radius: 50%;
    color: white;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.rrs-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* Navigation Buttons */
.rrs-lightbox-prev,
.rrs-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.rrs-lightbox-prev {
    left: 20px;
}

.rrs-lightbox-next {
    right: 20px;
}

.rrs-lightbox-prev:hover,
.rrs-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

/* Image Container */
.rrs-lightbox-image-container {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rrs-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* Loader */
.rrs-lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Caption */
.rrs-lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Counter */
.rrs-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

/* ========================================
   PLACEHOLDER & MESSAGES
   ======================================== */

.rrs-marquee-placeholder,
.rrs-marquee-no-images {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    color: #666;
    font-size: 16px;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
}

.rrs-marquee-placeholder-text {
    width: 100%;
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .rrs-marquee-container {
        height: 300px !important;
    }

    .rrs-marquee-track {
        gap: 15px;
    }

    .rrs-marquee-image {
        max-height: 280px;
    }

    /* Lightbox adjustments */
    .rrs-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .rrs-lightbox-prev,
    .rrs-lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }

    .rrs-lightbox-prev {
        left: 10px;
    }

    .rrs-lightbox-next {
        right: 10px;
    }

    .rrs-lightbox-image-container {
        max-width: 95%;
    }

    .rrs-lightbox-caption {
        font-size: 14px;
        margin-top: 10px;
    }

    .rrs-lightbox-counter {
        bottom: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .rrs-marquee-container {
        height: 250px !important;
    }

    .rrs-marquee-track {
        gap: 10px;
    }

    .rrs-marquee-image {
        max-height: 230px;
    }

    .rrs-marquee-image::after {
        font-size: 20px;
        bottom: 5px;
        right: 5px;
    }
}

/* ========================================
   LOADING STATE
   ======================================== */

.rrs-marquee-container.is-loading .rrs-marquee-track {
    animation: none;
}

.rrs-marquee-container.is-loading .rrs-marquee-image {
    opacity: 0.5;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .rrs-marquee-track {
        animation: none !important;
    }

    .rrs-marquee-container {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .rrs-marquee-track {
        flex-wrap: nowrap;
    }

    .rrs-lightbox {
        animation: none;
    }
}

/* Focus styles for accessibility */
.rrs-marquee-image:focus {
    outline: 3px solid #2196F3;
    outline-offset: 2px;
}

.rrs-lightbox-close:focus,
.rrs-lightbox-prev:focus,
.rrs-lightbox-next:focus {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* ========================================
   CUSTOM STYLES FOR DIFFERENT SPEEDS
   ======================================== */

.rrs-marquee-container[data-speed="25"] .rrs-marquee-track {
    animation-duration: 25s;
}

.rrs-marquee-container[data-speed="40"] .rrs-marquee-track {
    animation-duration: 40s;
}

.rrs-marquee-container[data-speed="60"] .rrs-marquee-track {
    animation-duration: 60s;
}

/* ========================================
   SMOOTH SCROLL BEHAVIOR
   ======================================== */

.rrs-marquee-track {
    will-change: transform;
}

/* ========================================
   EDGE FADE EFFECT (Optional)
   ======================================== */

.rrs-marquee-container.has-fade::before,
.rrs-marquee-container.has-fade::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.rrs-marquee-container.has-fade::before {
    left: 0;
    background: linear-gradient(to right, rgba(245, 245, 245, 1), rgba(245, 245, 245, 0));
}

.rrs-marquee-container.has-fade::after {
    right: 0;
    background: linear-gradient(to left, rgba(245, 245, 245, 1), rgba(245, 245, 245, 0));
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .rrs-marquee-container {
        overflow: visible;
        height: auto !important;
    }

    .rrs-marquee-track {
        animation: none;
        flex-wrap: wrap;
    }

    .rrs-marquee-image {
        page-break-inside: avoid;
        margin-bottom: 10px;
    }

    .rrs-lightbox {
        display: none !important;
    }
}

/* ========================================
   TOUCH FEEDBACK
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    .rrs-marquee-image:active {
        transform: scale(0.95);
    }

    .rrs-lightbox-prev:active,
    .rrs-lightbox-next:active,
    .rrs-lightbox-close:active {
        transform: scale(0.9);
    }
}