/* assets/css/museum.css */

/* Override page content padding when in museum */
.page-content:has(.museum-wrapper) {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

body:has(.museum-wrapper) {
    overflow: hidden; /* Prevent scrolling on body */
}

.museum-wrapper {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background-color: #0c1410;
}

.museum-room {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    /* parallax base */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 1;
}

.museum-room.active {
    display: flex;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.museum-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(12,20,16,0.8) 100%);
    z-index: 2;
}

.museum-content {
    position: relative;
    z-index: 3;
    padding: 3rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
    width: 90%;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.8s 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.museum-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.museum-desc {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    color: rgba(255,255,255,0.8);
    font-weight: 300;
}

.museum-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-museum {
    background-color: #3C4238 !important;
    color: #EBDCC2 !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    border: 2px solid #2B3028 !important;
    cursor: pointer !important;
    box-shadow: 3px 3px 0 #2B3028 !important;
    transition: all 0.2s !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: none !important;
    text-decoration: none;
}

.btn-museum:hover {
    transform: translate(2px, 2px) !important;
    box-shadow: 1px 1px 0 #2B3028 !important;
    background-color: #2B3028 !important;
}

.btn-museum.secondary {
    background-color: #3C4238 !important;
}

.btn-museum.secondary:hover {
    background-color: #2B3028 !important;
}

/* Specific Room Backgrounds for Parallax */
#room-lobby {
    background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/tembok_1.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
}

#room-1 {
    background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/tembok_2.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
}

#room-2 {
    background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/tembok_3.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
}

/* Door styles */
.museum-doors {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    height: 100%;
    position: relative;
    z-index: 3;
    padding-bottom: 5vh;
}

.museum-door-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
}

.door-frame {
    position: relative;
    width: 220px;
    height: 400px;
}

.door-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    background-size: cover;
    background-position: center;
    border-radius: 15px 15px 0 0;
    z-index: 1;
    box-shadow: inset 0 0 50px rgba(0,0,0,1);
}

.room-1-bg {
    background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/preview_room_1.png');
}

.room-2-bg {
    background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/preview_room_2.png');
}

.museum-door {
    width: 100%;
    height: 100%;
    background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/door.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border-radius: 15px 15px 0 0;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    transform-origin: left;
    transform-style: preserve-3d;
    z-index: 2;
}

.museum-door.open {
    transform: perspective(1200px) rotateY(-105deg);
}

.museum-door:hover {
    box-shadow: 0 0 40px rgba(255,255,255,0.3);
}

.door-label {
    background: rgba(0,0,0,0.7);
    padding: 10px 30px;
    border-radius: 30px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
}

.museum-center-space {
    align-self: flex-end;
    width: 320px;
    height: 100%;
    z-index: 4;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.museum-logo-top {
    position: absolute;
    top: 13vh;
    width: 300px;
    z-index: 5;
    animation: float 6s ease-in-out infinite;
}

.museum-logo-top img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 40px rgba(0,0,0,0.9));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.museum-poster-frame {
    position: relative;
    width: 220px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4;
    top: -85px;
    margin-bottom: 8vh;
}

.frame-asset {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.8));
}

.poster-asset {
    width: 78%;
    height: 88%;
    object-fit: cover;
    z-index: 1;
    transform: translateY(-2%);
}


/* Horizontal scroll for small screens */
@media (max-width: 700px) {
    .museum-wrapper {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        display: block;
    }
    
    .museum-room {
        width: 1000px !important;
        min-width: 1000px !important;
        position: absolute;
        left: 0;
        top: 0;
    }
    
    body:has(.museum-wrapper) {
        overflow-y: hidden !important;
    }
}

/* Button back to explore in lobby */
.btn-back-explore {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 10;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

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

/* Light styles */
.museum-lamps-pair {
    display: flex;
    justify-content: space-between;
    width: 480px;
    margin-bottom: 25px; /* Pushed up away from the frame */
    z-index: 6;
    cursor: pointer;
}

.lamp-container {
    position: relative;
    width: 65px;
}

.lamp-prop {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.8));
    position: relative;
    z-index: 2;
}

.light-bulb-glow {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff, #ffd700);
    border-radius: 50%;
    box-shadow: 
        0 0 40px 10px #ffd700, 
        0 0 80px 20px #ffcc00,
        0 80px 150px 80px rgba(255, 200, 0, 0.4); 
    transition: all 0.4s ease;
    animation: flicker 4s infinite;
    z-index: 1;
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        opacity: 1;
        box-shadow: 0 0 40px 10px #ffd700, 0 0 80px 20px #ffcc00, 0 80px 150px 80px rgba(255, 200, 0, 0.4);
    }
    20%, 24%, 55% {
        opacity: 0.4;
        box-shadow: 0 0 20px 5px #ffd700, 0 0 40px 10px #ccaa00, 0 80px 150px 40px rgba(255, 200, 0, 0.1);
    }
}

#room-lobby.active {
    display: flex;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards, roomFlicker 4s infinite; /* Flicker only in lobby */
}

/* Stop flickering when modal is open */
.museum-wrapper.modal-open #room-lobby.active,
.museum-wrapper.modal-open .light-bulb-glow {
    animation: none !important;
    filter: brightness(1) !important;
}

.museum-room.active {
    display: flex;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes roomFlicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        filter: brightness(1);
    }
    20%, 24%, 55% {
        filter: brightness(0.6);
    }
}

.museum-wrapper.light-off .light-bulb-glow {
    background: transparent;
    box-shadow: none;
    animation: none;
}

.museum-wrapper.light-off #room-lobby {
    filter: brightness(0.2); /* Static dark when off */
    animation: none;
}

.museum-wrapper.light-off .museum-door-wrapper,
.museum-wrapper.light-off .museum-poster-frame {
    filter: brightness(0.5);
}
/* Gallery in Room 1 */
.gallery-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 80px;
    padding: 0 10vw 0 15vw;
    overflow-x: auto; /* Enable native scroll for touch/swipe */
    overflow-y: hidden; /* Prevent vertical scrolling */
    z-index: 3;
    scroll-behavior: smooth; /* Native smooth scroll */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.gallery-container::-webkit-scrollbar {
    display: none;
}

.gallery-frame-wrapper {
    flex: 0 0 auto;
    width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.gallery-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.8));
    pointer-events: none; /* Let clicks pass to art if needed */
}

.frame-1 { background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/frame_1.png'); }
.frame-2 { background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/frame_2.png'); }
.frame-3 { background-image: url('https://assets.warkopdki.cdn.klikfilm.com/images/museum/frame_3.png'); }

.gallery-intro-container {
    flex: 0 0 500px;
    margin-right: 150px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.window-view-wrapper {
    position: absolute;
    width: 300px;
    height: 346px; 
    z-index: 1;
    opacity: 0.6;
    left: -100px; /* Moved further left */
}

.window-frame-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    object-fit: contain;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
}

#cityCanvas {
    position: absolute;
    top: 5%; /* Inside the frame */
    left: 5%;
    width: 90%;
    height: 90%;
    z-index: 2;
    filter: blur(2px);
    border-radius: 10px;
}

.gallery-intro {
    position: relative;
    z-index: 5;
    text-align: left;
    background: none;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    width: 100%;
}

.gallery-title {
    font-size: 6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 12px;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
    font-family: 'Outfit', sans-serif;
}

.gallery-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    font-weight: 300;
    border-left: 4px solid #ffd700;
    padding-left: 30px;
    max-width: 450px;
}

.gallery-art {
    width: 78%;
    height: 78%;
    object-fit: cover;
    z-index: 1;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.gallery-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 20;
    pointer-events: none; /* Let clicks pass to gallery unless on buttons */
}

.btn-gallery {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* Re-enable for buttons */
}

.btn-gallery:hover:not(:disabled) {
    background: rgba(255,255,255,0.15);
    border-color: #ffd700;
    color: #ffd700;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.btn-gallery:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-gallery:disabled {
    opacity: 0; /* Hide if disabled for a cleaner look */
    pointer-events: none;
}

/* Timeline specific (Room 2) */
.timeline-container {
    align-items: center;
    padding: 0 10vw;
}

.timeline-intro {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-right: 80px;
    z-index: 5;
    width: 450px;
    height: 100%;
}

.timeline-table {
    width: 345px; /* Enlarged */
    height: auto;
    filter: drop-shadow(0 -10px 25px rgba(0,0,0,0.4));
    position: absolute;
    bottom: -57px; /* Pin to bottom */
    z-index: 6;
}

.timeline-text {
    text-align: center;
}

.timeline-track {
    display: flex;
    align-items: center;
    position: relative;
    height: 600px;
    gap: 150px;
    padding-right: 15vw;
}

.timeline-center-line {
    position: absolute;
    top: 50%;
    left: -50px;
    right: 0;
    height: 4px;
    background: #ffd700;
    transform: translateY(-50%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    z-index: 1;
}

.timeline-node {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.node-top {
    justify-content: flex-end;
    transform: translateY(-170px);
}

.node-bottom {
    justify-content: flex-start;
    transform: translateY(170px);
}

.timeline-connector {
    position: absolute;
    width: 2px;
    height: 170px;
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    z-index: 1;
}

.node-top .timeline-connector {
    bottom: -170px;
}

.node-bottom .timeline-connector {
    top: -170px;
}

.timeline-node::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 4px solid #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    z-index: 3;
}

.node-top::after {
    bottom: -180px;
}

.node-bottom::after {
    top: -180px;
}

.timeline-frame-wrapper {
    position: relative;
    width: 220px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: transform 0.4s ease;
}

.timeline-frame-wrapper:hover {
    transform: scale(1.1);
}

.timeline-art {
    width: 76%;
    height: 76%;
    object-fit: cover;
    z-index: 1;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.timeline-label {
    position: absolute;
    bottom: -45px;
    background: rgba(0,0,0,0.7);
    color: #ffd700;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: bold;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(4px);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.node-bottom .timeline-label {
    top: -45px;
    bottom: auto;
}
/* Poster Modal Styles */
.poster-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.poster-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.poster-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.poster-modal-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
}

.poster-modal.active .poster-modal-content {
    transform: scale(1);
}

.poster-display-box {
    background: #000;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    border-radius: 4px;
    position: relative;
}

/* Spotlight Effect behind poster */
.poster-display-box::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.poster-display-box img {
    max-height: 70vh;
    width: auto;
    display: block;
}

.poster-modal-actions {
    display: flex;
    gap: 20px;
}

.btn-action-modal {
    background-color: #3C4238 !important;
    color: #EBDCC2 !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    border: 2px solid #2B3028 !important;
    cursor: pointer !important;
    box-shadow: 3px 3px 0 #2B3028 !important;
    transition: all 0.2s !important;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: none !important;
}

.btn-action-modal:hover {
    transform: translate(2px, 2px) !important;
    box-shadow: 1px 1px 0 #2B3028 !important;
    background-color: #2B3028 !important;
}

.btn-action-modal.highlight {
    background-color: #3C4238 !important;
    color: #EBDCC2 !important;
    border-color: #2B3028 !important;
}

.btn-action-modal.highlight:hover {
    background-color: #2B3028 !important;
    box-shadow: 1px 1px 0 #2B3028 !important;
}

.btn-close-modal {
    position: absolute;
    top: -60px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.btn-close-modal:hover {
    opacity: 1;
}

.museum-poster-frame {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.museum-poster-frame:hover {
    transform: scale(1.05);
}
