* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', Arial, sans-serif;
    /* Consistent font */
    background: #000;
    overflow: hidden;
    height: 100vh;
    perspective: 2000px;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    /* Align content to top */
    justify-content: center;
    transform-style: preserve-3d;
}

.photos-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 100px);
    /* Leave 200px space at bottom */
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    overflow: visible;
    /* Prevent clipping */
}

.wall-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: all 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    /* Let clicks pass through to inactive layers if needed */
}

.wall-container.active {
    pointer-events: auto;
}

.wall-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    /* gap: 50px;  Removed gap to rely on explicit centering in JS */
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Wall texture effect */
.wall-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Use the generated texture */
    background: url('/img/wall_texture.jpg');
    background-size: cover;
    background-position: center;
    /* overlay gradient for depth */
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.8);
    filter: brightness(0.6);
    /* Slightly dim the texture for ambiance */
    pointer-events: none;
    z-index: 0;
}

/* Rotations */
.wall-container.rotate-from-right {
    transform: translateX(120%) rotateY(-85deg);
    opacity: 0;
}

.wall-container.rotate-to-left {
    transform: translateX(-120%) rotateY(85deg);
    opacity: 0;
}

.wall-container.rotate-from-left {
    transform: translateX(-120%) rotateY(85deg);
    opacity: 0;
}

.wall-container.rotate-to-right {
    transform: translateX(120%) rotateY(-85deg);
    opacity: 0;
}

.wall-container.active {
    transform: translateX(0) rotateY(0deg);
    opacity: 1;
}

/* Photo Card Styles */
.photo-card {
    position: relative;
    background: transparent;
    /* Changed from #fff */
    padding: 0;
    /* Removed padding */
    padding-bottom: 40px;
    /* Keep bottom padding for caption/icon space */
    box-shadow: none;
    /* Removed heavy shadow frame */
    transition: all 0.5s ease-out;
    opacity: 1;
    transform: scale(0.85);
    /* Inactive state scale */
    border: none;
    /* Removed gray border */
    flex-shrink: 0;
    margin: 0 40px;
    /* Use Margin for spacing instead of gap */

    /* Dynamic Sizing Logic */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    /* Allow width to be driven by image */
    height: auto;
}

.photo-card::before {
    display: none;
    /* Remove frame depth */
}

.photo-card::after {
    display: none;
    /* Remove frame shadow */
}

.photo-card.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: none;
    /* Removed heavy shadow frame */
    z-index: 10;
}

.photo-card.prev {
    opacity: 0.5;
    /*transform: scale(0.75) translateX(-50px) rotateY(25deg);*/
    /* Add 3D effect to neighbors */
}

.photo-card.next {
    opacity: 0.5;
    /* transform: scale(0.75) translateX(50px) rotateY(-25deg);*/
}

.photo-img {
    /* Dynamic Image Sizing */
    display: block;
    max-height: 550px;
    /* Increased from 450px */
    width: auto;
    /* Allow width to adjust */
    max-width: 70vw;
    /* Increased from 60vw */
    object-fit: contain;
    /* Ensure full image is visible */

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    /* Enhanced shadow for depth */
    cursor: pointer;
    /* Indicate clickable */
    border: 6px solid #fff;
    /* Thin white border */
    box-sizing: border-box;
    /* Ensure border is included in dimensions */
}

.zoom-icon {
    position: absolute;
    bottom: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    background: rgba(50, 50, 50, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.zoom-icon:hover {
    background: rgba(70, 70, 70, 0.95);
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
}

.zoom-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Spotlight Effect */
.spotlight {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transition: all 0.6s ease;
}

.spotlight-1 {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    left: 20%;
    top: 30%;
}

.spotlight-2 {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    right: 15%;
    top: 25%;
}

/* Navigation */
.nav-button {
    position: absolute;
    bottom: 60px;
    /* Centered in the 200px black area */
    width: 80px;
    height: 80px;
    background: rgba(70, 90, 110, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-button:hover {
    background: rgba(70, 90, 110, 0.9);
    transform: scale(1.1);
}

.nav-button:active {
    transform: scale(0.95);
}

.nav-button.prev-btn {
    left: 40%;
}

.nav-button.next-btn {
    right: 40%;
}

.nav-button svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

/* Floor attached to wall */
.wall-floor {
    position: absolute;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%) rotateX(90deg);
    width: 400%;
    height: 1000px;
    background: linear-gradient(to bottom,
            rgba(58, 90, 122, 0.8) 0%,
            rgba(45, 74, 94, 1) 30%,
            #000 90%);
    transform-origin: top center;
    pointer-events: none;
}

/* Caption Styles */
.photo-caption {
    text-align: center;
    color: #fff;
    margin-top: 15px;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    opacity: 0.8;
    font-weight: 300;
    letter-spacing: 1px;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Back Button */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
    z-index: 200;
    font-weight: 300;
    letter-spacing: 1px;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

/* Room Title */
.room-title {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    z-index: 200;
    font-weight: 300;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-img {
    max-width: 95%;
    max-height: 95%;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.3);
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1001;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    z-index: 1001;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

.modal-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 20px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    z-index: 1001;
    letter-spacing: 1px;
}

.modal-title {
    position: absolute;
    top: 30px;
    left: 40px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    font-weight: 300;
    z-index: 1001;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

/* Counter */
.counter {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    z-index: 100;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .room-title {
        font-size: 1rem;
        top: 20px;
        right: 20px;
        max-width: 150px;
        /* Limit width to avoid back button overlap */
        text-align: right;
    }

    .back-button {
        padding: 8px 15px;
        font-size: 0.9rem;
        top: 20px;
        left: 20px;
    }

    .photos-wrapper {
        /* On mobile, give more vertical space to image, less to bottom bar */
        height: calc(100vh - 120px);
        overflow: hidden;
        /* Fix horizontal scroll on mobile */
    }

    .photo-card {
        margin: 0 10px;
        /* Reduce gap between cards */
    }

    .photo-img {
        max-width: 85vw;
        /* Allow wider images on narrow screens */
        max-height: 50vh;
        /* Prevent covering nav controls */
        border-width: 4px;
        /* Thinner border */
    }

    .nav-button {
        width: 50px;
        /* Smaller buttons */
        height: 50px;
        bottom: 30px;
    }

    .nav-button.prev-btn {
        left: 20px;
        /* Move to side */
    }

    .nav-button.next-btn {
        right: 20px;
        /* Move to side */
    }

    .nav-button svg {
        width: 20px;
        height: 20px;
    }

    /* Move counter to bottom center on mobile to avoid top overlap */
    .counter {
        top: auto;
        bottom: 40px;
        font-size: 14px;
        padding: 6px 15px;
        z-index: 101;
    }

    .wall-floor {
        bottom: -50px;
        /* Bring floor higher visually */
    }

    .modal-img {
        max-width: 100%;
    }

    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .modal-title {
        font-size: 1.2rem;
        left: 20px;
        top: 20px;
    }

    .modal-close {
        top: 20px;
        right: 20px;
    }
}