body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100svh;
    width: 100vw;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    animation: fadeIn 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Skeleton Loader */
.skeleton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 45%;
    background: linear-gradient(90deg, #111 25%, #222 50%, #111 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
    display: none;
    z-index: 5;
}

.image-loading .skeleton {
    display: block;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.main-photo {
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.main-photo:hover {
    transform: scale(1.02);
}

/* Precise location of the timetable in the image */
.timetable-hotspot {
    position: absolute;
    top: 68%;
    /* Center of the card in the photo */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    /* Width of the card area */
    height: 45%;
    /* Height of the card area */
    cursor: pointer;
    z-index: 10;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);

}

.timetable-hotspot:active {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
}



/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1000px;
    max-height: 85vh;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    /* Prevent browser handling of gestures */
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

/* Focus purely on the card area using object-fit and position */
.timetable-zoom {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease-out;
    /* Smooth transition for reset, but we will bypass it for active touch */
    will-change: transform;
    transform-origin: center center;
}

.timetable-zoom.active-touch {
    transition: none !important;
}

.close-btn,
.reset-btn,
.share-btn,
.install-btn,
.download-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    z-index: 110;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.close-btn {
    bottom: 40px;
    right: 40px;
    text-transform: uppercase;
    font-size: 0.85rem;
    background: white;
    color: black;
}

.reset-btn {
    bottom: 40px;
    left: 40px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    padding: 0;
}

.share-btn {
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    width: 44px;
    height: 44px;
}

.install-btn {
    top: 20px;
    left: 20px;
    background: #ffffff;
    color: #000;
    display: none;
    /* Hidden by default */
}

.download-btn {
    top: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

.close-btn:hover,
.reset-btn:hover,
.install-btn:hover,
.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
    white-space: nowrap;
    width: max-content;
    max-width: 90vw;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, -10px);
    }
}

/* Landscape Optimizations */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 10px;
    }

    .modal-content {
        width: 100%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .timetable-zoom {
        width: 100%;
        height: 100%;
        object-fit: contain;
        /* Increased base scale for mobile to feel "bigger" naturally */
        transform: scale(1.05);
    }

    .close-btn {
        bottom: 20px;
        right: 20px;
        padding: 8px 16px;
    }

    .reset-btn {
        bottom: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
    }

    .download-btn {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .hint {
        display: none;
        /* Hide hint to save space */
    }

    .share-btn {
        top: 10px;
        right: 10px;
    }

    .install-btn {
        top: 10px;
        left: 10px;
    }

    .close-btn,
    .reset-btn {
        bottom: 15px;
    }

    .modal-content {
        max-height: 95vh;
        width: 95vw;
    }

    .main-photo {
        max-height: 95%;
    }

    .download-btn {
        top: 20px;
        right: 20px;
    }
}