/* ================================================
   Welcome Popup Modal - แสดงรูปตอนเปิดเว็บ
   ================================================ */

/* Overlay Background */
.welcome-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container - ใช้ flexbox เพื่อจัดปุ่มนอกกรอบ */
.welcome-popup-modal {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.8) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Slider Container - กรอบรูปมน */
.welcome-popup-slider {
    position: relative;
    flex-shrink: 0;
}

.welcome-popup-slides {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.welcome-popup-slide {
    display: none;
}

.welcome-popup-slide.active {
    display: block;
}

/* Popup Image - รูปมุมมน พอดีกรอบ */
.welcome-popup-image {
    display: block;
    width: 600px;
    height: 600px;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

/* Navigation Arrows - อยู่นอกกรอบรูป */
.welcome-popup-nav {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    transform: none;
}

.welcome-popup-nav:hover {
    background: linear-gradient(135deg, #EBCD5C 0%, #D4B14E 100%);
    color: #1f1f1f;
    transform: scale(1.1);
    box-shadow:
        0 8px 30px rgba(235, 205, 92, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.welcome-popup-nav:active {
    transform: scale(0.95);
}

/* Dots Indicator - อยู่ใต้รูป */
.welcome-popup-dots {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.welcome-popup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.welcome-popup-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.welcome-popup-dot.active {
    background: linear-gradient(135deg, #EBCD5C 0%, #D4B14E 100%);
    transform: scale(1.3);
    box-shadow: 0 2px 12px rgba(235, 205, 92, 0.5);
}

/* Close Button - มุมขวาบนของรูป */
.welcome-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #EBCD5C 0%, #D4B14E 100%);
    color: #1f1f1f;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 4px 15px rgba(235, 205, 92, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 20;
}

.welcome-popup-close:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow:
        0 6px 25px rgba(235, 205, 92, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.welcome-popup-close:active {
    transform: scale(0.95);
}

/* Close Icon */
.welcome-popup-close::before {
    content: '✕';
    line-height: 1;
}

/* Click hint text */
.welcome-popup-hint {
    position: absolute;
    bottom: -72px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.8s forwards;
    letter-spacing: 0.5px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .welcome-popup-modal {
        flex-direction: column;
        gap: 15px;
        max-width: 95%;
    }

    .welcome-popup-image {
        max-width: 90vw;
        max-height: 65vh;
    }

    .welcome-popup-slides {
        border-radius: 16px;
    }

    /* ปุ่ม nav อยู่ด้านล่างบนมือถือ */
    .welcome-popup-nav {
        width: 44px;
        height: 44px;
        font-size: 22px;
        position: absolute;
    }

    .welcome-popup-prev {
        left: -60px;
        top: 50%;
        transform: translateY(-50%);
    }

    .welcome-popup-next {
        right: -60px;
        top: 50%;
        transform: translateY(-50%);
    }

    .welcome-popup-dots {
        bottom: -30px;
        gap: 10px;
    }

    .welcome-popup-dot {
        width: 8px;
        height: 8px;
    }

    .welcome-popup-close {
        width: 38px;
        height: 38px;
        font-size: 18px;
        top: -10px;
        right: -10px;
    }

    .welcome-popup-hint {
        font-size: 11px;
        bottom: -55px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .welcome-popup-prev {
        left: -50px;
    }

    .welcome-popup-next {
        right: -50px;
    }

    .welcome-popup-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Animation for entrance */
@keyframes popupPulse {

    0%,
    100% {
        box-shadow:
            0 30px 60px rgba(0, 0, 0, 0.4),
            0 10px 30px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow:
            0 30px 60px rgba(235, 205, 92, 0.15),
            0 10px 30px rgba(235, 205, 92, 0.1),
            0 0 0 1px rgba(235, 205, 92, 0.2);
    }
}

.welcome-popup-overlay.active .welcome-popup-slides {
    animation: popupPulse 4s ease-in-out infinite;
}