/* Homepage image popup gallery */

.popup-overlay {
    cursor: pointer;
    padding: 0;
    background: rgba(8, 8, 12, 0.92);
    backdrop-filter: blur(12px);
}

.popup-overlay.show {
    cursor: pointer;
}

.popup-container {
    max-width: min(960px, 96vw);
    width: 100%;
    max-height: 96vh;
    border-radius: 20px;
    background: #0f0f12;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.popup-container--image-only {
    max-width: min(1100px, 98vw);
    background: #000;
    border-radius: 16px;
}

.popup-container--image-only .popup-content-wrapper {
    max-height: calc(96vh - 100px);
}

.popup-close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 20;
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.popup-close--ready {
    opacity: 1;
    pointer-events: auto;
    background: rgba(227, 30, 36, 0.92);
    border-color: rgba(227, 30, 36, 0.95);
}

.popup-close--ready:hover {
    background: #c41a20;
    transform: rotate(90deg) scale(1.08);
    color: #fff;
}

.popup-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 60px 14px 18px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
    pointer-events: none;
}

.popup-progress__track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.popup-progress__fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e31e24, #ff6b6b);
    border-radius: 4px;
    transition: width 0.35s ease;
}

.popup-progress__text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.popup-content-wrapper {
    max-height: calc(96vh - 88px);
    padding: 0;
}

.popup-content--image-only {
    display: flex;
    flex-direction: column;
}

.popup-image--hero {
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: min(78vh, 820px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.popup-image--hero img {
    width: 100%;
    height: auto;
    max-height: min(78vh, 820px);
    object-fit: contain;
    display: block;
    animation: popupImageIn 0.45s ease both;
}

@keyframes popupImageIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup-container--image-only .popup-body {
    display: none;
}

.popup-tap-hint {
    margin: 0;
    padding: 10px 16px 14px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    pointer-events: none;
    animation: popupHintPulse 2s ease-in-out infinite;
}

.popup-tap-hint--done {
    color: rgba(255, 255, 255, 0.9);
    animation: none;
}

@keyframes popupHintPulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.popup-navigation {
    position: relative;
    padding: 8px 16px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-container--image-only .popup-nav-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.popup-container--image-only .popup-nav-btn:hover:not(:disabled) {
    background: #e31e24;
    border-color: #e31e24;
}

.popup-container--image-only .popup-dot {
    background: rgba(255, 255, 255, 0.35);
}

.popup-container--image-only .popup-dot.active {
    background: #e31e24;
    transform: scale(1.25);
}

.popup-footer-options {
    padding: 10px 16px 14px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-footer-options label {
    color: rgba(255, 255, 255, 0.85);
}

.popup-overlay.popup-shake .popup-container {
    animation: popupShake 0.4s ease;
}

@keyframes popupShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

@media (max-width: 600px) {
    .popup-container {
        border-radius: 12px;
        max-height: 100vh;
    }

    .popup-image--hero,
    .popup-image--hero img {
        max-height: 72vh;
    }

    .popup-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .popup-progress {
        padding-right: 52px;
    }
}
