/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- Loader --- */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    transition: opacity 0.5s ease;
}

.loader-content {
    width: 300px;
    text-align: center;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.2s linear;
}

.progress-text {
    font-size: 1.2rem;
    font-weight: 600;
}

/* --- Orientation Warning --- */
.orientation-warning {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    text-align: center;
}

.rotate-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: rotate-phone 2s infinite ease-in-out;
}

@keyframes rotate-phone {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(90deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@media screen and (orientation: portrait) {
    .orientation-warning {
        display: flex;
    }

    .activity-container {
        display: none !important;
    }
}

/* --- Activity Container --- */
.activity-container {
    position: relative;
    width: auto;
    height: auto;

    /* Maximum limits to ensure it fits within the viewport */
    max-width: 100%;
    max-height: 100%;

    line-height: 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Layers */
.base-layer {
    position: relative;
    display: block;

    /* JS-Fixed Viewport Height Logic */
    /* Fallback to 100vh if JS fails */
    max-height: 100vh;
    /* Use the Custom Property calculated by JS */
    /* Subtract a tiny bit to avoid exact edge collisions */
    max-height: calc(var(--vh, 1vh) * 98);

    max-width: 100vw;

    width: auto;
    height: auto;

    object-fit: contain;
}

.overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Click Hotspot */
.click-hotspot {
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
}

/* Navigation Hotspots */
.nav-hotspot {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 50;
    display: none;
    cursor: pointer;
}

.nav-next {
    right: 0;
    width: 40%;
}

.nav-prev {
    left: 0;
    width: 30%;
}

/* Transition between full slides */
.slide-fade-in {
    opacity: 1;
    transition: opacity 1.5s ease-in-out;
    pointer-events: auto;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* --- Animations --- */

/* 1. Fade In */
.fade-in {
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
    transform: scale(1);
}

/* 2. Entrance: Explosive Zoom (3rd Image) */
.zoom-explode-active {
    opacity: 1;
    animation: elastic-entrance 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes elastic-entrance {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 3. Continuous Loop: Heartbeat */
@keyframes heartbeat {
    from {
        transform: scale(1);
        transform-origin: center center;
        animation-timing-function: ease-out;
    }

    10% {
        transform: scale(0.91);
        animation-timing-function: ease-in;
    }

    17% {
        transform: scale(0.98);
        animation-timing-function: ease-out;
    }

    33% {
        transform: scale(0.87);
        animation-timing-function: ease-in;
    }

    45% {
        transform: scale(1);
        animation-timing-function: ease-out;
    }
}

.heartbeat-loop {
    opacity: 1;
    animation: heartbeat 1.3s infinite;
}

/* 4. Entrance: MEGA ZOOM (4th Image) */
.mega-zoom-active {
    opacity: 1;
    animation: mega-zoom-in 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes mega-zoom-in {
    0% {
        opacity: 0;
        transform: scale(4) translate(15%, -15%);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translate(0, 0);
        filter: blur(0);
    }
}