﻿/* ========================================
   FULLSCREEN FIREWORKS + POPUP IMAGE
   ======================================== */

/* Fireworks Canvas - Fullscreen Background */
.fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}

    .fireworks-canvas.active {
        opacity: 1;
        visibility: visible;
    }

/* Popup Overlay - Dark Semi-transparent */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5); /* Transparent - chỉ hiển thị fireworks */
    backdrop-filter: blur(1px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .popup-overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Popup Container (Holds image + close button) */
.popup-container {
    position: relative;
    max-width: 600px; /* ← Thay đổi này (trước: 90vw) */
    max-height: 80vh;
    width: 90%;
    transform: scale(0.8) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.active .popup-container {
    transform: scale(1) translateY(0);
}

/* Popup Image from Canva */
.popup-image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain; /* Giữ nguyên tỷ lệ, không bị méo */
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Close Button - Góc phải trên cùng */
.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .popup-close:hover {
        background: white;
        transform: rotate(90deg) scale(1.1);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    .popup-close:active {
        transform: rotate(90deg) scale(0.95);
    }

/* Clickable Areas on Image */
area {
    cursor: pointer;
}

    area:hover {
        cursor: pointer;
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .popup-container {
        max-width: 95vw;
        max-height: 85vh;
    }

    .popup-image {
        max-height: 85vh;
        border-radius: 16px;
    }

    .popup-close {
        top: -10px;
        right: -10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .popup-container {
        max-width: 96vw;
        max-height: 80vh;
    }

    .popup-image {
        max-height: 80vh;
        border-radius: 12px;
    }

    .popup-close {
        top: -8px;
        right: -8px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}

/* Landscape Mobile */
@media (max-width: 900px) and (orientation: landscape) {
    .popup-container {
        max-height: 90vh;
    }

    .popup-image {
        max-height: 90vh;
        max-width: 60vw;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .popup-close {
        background: rgba(30, 41, 59, 0.95);
        color: #f1f5f9;
    }

        .popup-close:hover {
            background: #1e293b;
        }
}

/* Loading State (Optional) */
.popup-image[src=""] {
    background: rgba(255, 255, 255, 0.1);
    min-width: 300px;
    min-height: 400px;
}

/* Accessibility */
.popup-close:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}
