/**
 * Room Image Gallery Styles
 * 
 * Styles for room image galleries with navigation and thumbnails
 */

.room-image-gallery {
    position: relative;
    width: 100%;
    border-radius: 8px; /* BS-5865 round 6 (row 24): room photos are 8px inside the 12px card */
    overflow: visible;
    box-shadow: none;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

/* Figma has no hover lift on the gallery frame (fine-rooms-cards.md #3/#5). */
.room-image-gallery:hover {
    box-shadow: none;
    transform: none;
}

.room-gallery-main {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
}

.room-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 8px;
    opacity: 0;
    animation: fadeInImage 0.6s ease-out forwards;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.room-gallery-main:hover .room-main-image {
    transform: none;
    filter: none;
}

.room-main-image:hover {
    cursor: pointer;
}

/* Navigation Controls */
.room-gallery-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-50%);
    z-index: 10;
}

.room-gallery-main:hover .room-gallery-nav {
    opacity: 1;
}

.room-gallery-prev,
.room-gallery-next {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px; /* BS-5865 round 8 (OL canvas row 42): same 18px chevron as the hotel gallery */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.room-gallery-prev i,
.room-gallery-next i {
    font-size: 18px;
    line-height: 1;
}

.room-gallery-prev:hover,
.room-gallery-next:hover {
    background: color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 90%, transparent);
    border-color: color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 30%, transparent);
    color: var(--event-on-secondary-color, #000000);
    transform: scale(1.15);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 40%, transparent);
}

.room-gallery-prev:active,
.room-gallery-next:active {
    transform: scale(1.05);
}

/* Image Counter */
.room-gallery-counter {
    position: absolute;
    top: 8px;
    right: 16px;
    background: rgba(20, 20, 22, 0.7);
    color: #ffffff;
    padding: 4.5px 8px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: none;
    box-shadow: none;
    pointer-events: none;
    z-index: 5;
    transition: all 0.3s ease;
}

.room-gallery-main:hover .room-gallery-counter {
    background: rgba(20, 20, 22, 0.7);
    border-color: transparent;
}

/* Thumbnail Navigation */
.room-image-gallery .room-gallery-thumbs {
    display: flex !important;
    gap: 6px !important;
    padding: 4px 0 0 !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    width: 100% !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    margin: 0 !important;
    margin-top: 0 !important;
}

.room-gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.room-image-gallery .room-gallery-thumb {
    flex: 1 !important;
    min-width: 40px !important;
    height: 30px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    opacity: 0.6 !important;
    border: 2px solid transparent !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

.room-image-gallery .room-gallery-thumb:hover {
    opacity: 0.85 !important;
    border-color: color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 50%, transparent) !important;
    transform: scale(1.02) !important;
}

.room-image-gallery .room-gallery-thumb.active {
    opacity: 1 !important;
    border-color: var(--event-accent-color, #4FF6B1) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 30%, transparent) !important;
}

/* Clickable image cursor */
.clickable-image {
    cursor: pointer;
}

.clickable-image:hover {
    opacity: 0.9;
}

/* Modal Styles */
.room-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.room-image-modal.show {
    opacity: 1;
}

.room-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.room-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* BS-5865 round 7 (OL canvas row 38): the same 34px round utility close as the details and filters
   modals, sat above the top-right corner of the photo. */
#room-image-modal .room-modal-close {
    position: absolute;
    top: -46px;
    right: 0;
    background: var(--event-surface-secondary-color, #EAEAEC);
    border: none;
    border-radius: 999px;
    color: var(--event-text-primary-color, #000000);
    cursor: pointer;
    z-index: 10001;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s ease;
}

#room-image-modal .room-modal-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

#room-image-modal .room-modal-close:hover {
    background: var(--event-hairline-color, #CBCDD3);
}

.room-modal-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.room-modal-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    pointer-events: none;
}

/* BS-5865 round 10 (OL canvas row 50): the same 40px round buttons with 18px chevron icons as the
   hotel gallery arrows (was 50px circles around a 20px text glyph). Size and icon size are
   !important like the hotel gallery arrows: the theme's global `button:not(...)` rule (14px from
   768px up) otherwise outranks a single class. */
.room-modal-prev,
.room-modal-next {
    background: rgba(26, 26, 28, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px !important;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* The visible circle stays 40px like the hotel gallery arrows; the hit area is 44x44 (WCAG 2.5.8). */
.room-modal-prev::before,
.room-modal-next::before {
    content: '';
    position: absolute;
    inset: -2px;
}

.room-modal-prev:hover,
.room-modal-next:hover {
    background: color-mix(in srgb, var(--event-cta-color, #8B5CF6) 90%, transparent);
    transform: scale(1.1);
}

.room-modal-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 28, 0.8);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .room-image-gallery {
        border-radius: 8px;
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12);
    }
    
    .room-gallery-main {
        height: 180px;
        border-radius: 8px;
    }
    
    .room-main-image {
        border-radius: 8px;
    }
    
    /* BS-5865: arrows give way to touch swipe on mobile -- thumbnails and the
       counter stay for keyboard/visual access. */
    .room-gallery-nav {
        display: none;
    }

    .room-gallery-counter {
        top: 12px;
        right: 12px;
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 16px;
    }
    
    .room-image-gallery .room-gallery-thumbs {
        gap: 4px !important;
        padding: 3px 0 0 !important;
    }
    
    .room-image-gallery .room-gallery-thumb {
        min-width: 36px !important;
        height: 26px !important;
        border-radius: 4px !important;
    }
}
    
    
    .room-modal-prev,
    .room-modal-next {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    
    .room-modal-counter {
        bottom: -35px;
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Prevent body scroll when modal is open */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    height: 100%;
}

/* Hotel Details Modal */
#hotel-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000 !important;
    display: none;
}

#hotel-details-modal.show {
    display: flex !important;
}

.hotel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.hotel-modal-content {
    background: var(--event-surface-secondary-color, #1a1a1c);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.hotel-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--event-hairline-color, #CBCDD3) 10%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hotel-modal-header h3 {
    margin: 0;
    color: var(--event-text-primary-color, #ffffff);
    font-size: 24px;
    font-weight: 600;
}

.hotel-modal-close {
    background: transparent;
    border: none;
    color: var(--event-text-primary-color, #ffffff);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.hotel-modal-close:hover {
    color: var(--event-accent-color, #4FF6B1);
}

.hotel-modal-body {
    padding: 24px;
    overflow-y: auto;
}
