/* Dynamic Popup System Styles */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overflow: hidden;
}

.popup-overlay.hidden {
    display: none;
}

.popup-content {
    position: relative;
    width: 95vw;
    max-width: 600px;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 0 auto;
}

.popup-content.show {
    transform: scale(1);
    opacity: 1;
}

.popup-inner {
    padding: 0;
    text-align: center;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    color: white;
    font-weight: bold;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.popup-image {
    width: 100%;
    height: auto;
    min-height: 350px;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 24px 24px 0 0;
}

.popup-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.popup-main-text {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.2;
}

.popup-sub-text {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.popup-description {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.popup-bonus-code {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.popup-buttons {
    position: relative;
    padding: 25px 30px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 0 0 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-button {
    padding: 18px 56px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 900;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.popup-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.popup-button:hover::before {
    left: 100%;
}

.popup-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.2) inset;
}

.popup-button:active {
    transform: translateY(-2px) scale(1.02);
}

.popup-button-secondary {
    padding: 16px 48px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    border: 3px solid;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.popup-button-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.popup-button-secondary:hover::before {
    left: 100%;
}

.popup-button-secondary:hover {
    transform: translateY(-4px) scale(1.05);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.popup-button-secondary:active {
    transform: translateY(-2px) scale(1.02);
}

.popup-footer {
    font-size: 12px;
    margin-top: 20px;
    opacity: 0.7;
}

/* Desktop & Mobile Popup Visit Button */
.popup-visit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000 !important;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
}

.popup-visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
    color: #000 !important;
}

.popup-info {
    flex-shrink: 0;
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border-radius: 0 0 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    max-height: 400px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    cursor: pointer;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.popup-content.popup-modal {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: auto;
}

/* Desktop specific styles - Match friend's example */
@media (min-width: 769px) {
    .popup-content.popup-modal {
        max-width: 452px;
        width: 452px;
        height: 452px;
        border-radius: 20px;
        overflow: hidden;
        background: linear-gradient(135deg, #1a1410 0%, #2a1f10 50%, #1a1410 100%);
        border: 4px solid;
        border-image: linear-gradient(45deg, #FFD700, #D4AF37, #FFD700, #B8860B) 1;
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.6),
            0 0 60px rgba(212, 175, 55, 0.4),
            inset 0 0 30px rgba(255, 215, 0, 0.15);
        position: relative;
    }
    
    .popup-content.popup-modal::before {
        content: '';
        position: absolute;
        top: -4px;
        left: -4px;
        right: -4px;
        bottom: -4px;
        background: linear-gradient(45deg, #FFD700, #D4AF37, #FFD700, #B8860B, #FFD700);
        border-radius: 24px;
        z-index: -1;
        animation: royalGlow 4s ease-in-out infinite alternate;
    }
    
    @keyframes royalGlow {
        0% {
            box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
            filter: hue-rotate(0deg);
        }
        25% {
            box-shadow: 0 0 35px rgba(212, 175, 55, 0.8);
            filter: hue-rotate(10deg);
        }
        50% {
            box-shadow: 0 0 40px rgba(255, 215, 0, 1);
            filter: hue-rotate(0deg);
        }
        75% {
            box-shadow: 0 0 35px rgba(184, 134, 11, 0.8);
            filter: hue-rotate(-10deg);
        }
        100% {
            box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
            filter: hue-rotate(0deg);
        }
    }
    
    .popup-image {
        height: 350px;
        border-radius: 16px 16px 0 0;
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1410 100%);
        padding: 8px 8px 0 8px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .popup-image img {
        width: calc(100% - 4px);
        height: calc(100% - 4px);
        object-fit: cover;
        object-position: center;
        border-radius: 12px 12px 0 0;
        box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.1);
    }
    
    .popup-info {
        height: 102px;
        padding: 15px 20px;
        background: linear-gradient(135deg, #1a1410 0%, #2a1f10 100%);
        border-radius: 0 0 16px 16px;
        border-top: 2px solid rgba(255, 215, 0, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .popup-visit-btn {
        width: 100%;
        max-width: none;
        padding: 15px 25px;
        font-size: 16px;
        font-weight: 700;
        border-radius: 12px;
        background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
        color: #000 !important;
        text-transform: uppercase;
        letter-spacing: 1px;
        box-shadow: 
            0 4px 15px rgba(255, 215, 0, 0.4),
            inset 0 2px 0 rgba(255, 255, 255, 0.3);
        border: 2px solid rgba(255, 215, 0, 0.8);
        transition: all 0.3s ease;
    }
    
    .popup-visit-btn:hover {
        transform: translateY(-3px);
        box-shadow: 
            0 8px 25px rgba(255, 215, 0, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 0.4);
        background: linear-gradient(135deg, #FFA500 0%, #FFD700 50%, #FFA500 100%);
    }
    
    .popup-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(212, 175, 55, 0.8));
        border: 2px solid rgba(255, 215, 0, 0.6);
        border-radius: 50%;
        color: #000;
        font-weight: bold;
        box-shadow: 
            0 4px 15px rgba(255, 215, 0, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
    }
    
    .popup-close:hover {
        background: linear-gradient(135deg, rgba(255, 215, 0, 1), rgba(255, 165, 0, 0.9));
        transform: rotate(90deg) scale(1.1);
        box-shadow: 
            0 6px 20px rgba(255, 215, 0, 0.5),
            inset 0 2px 0 rgba(255, 255, 255, 0.3);
    }
}

/* Mobile responsive - Royal Gold Theme 452x452 */
@media (max-width: 768px) {
    .popup-overlay {
        padding: 10px;
        /* Align with hamburger menu and login edge */
        align-items: flex-start;
        justify-content: center;
        padding-top: 80px;
    }

    .popup-content.popup-modal {
        width: 90vw;
        max-width: 400px;
        height: 400px;
        border-radius: 18px;
        overflow: hidden;
        background: linear-gradient(135deg, #1a1410 0%, #2a1f10 50%, #1a1410 100%);
        border: 3px solid;
        border-image: linear-gradient(45deg, #FFD700, #D4AF37, #FFD700, #B8860B) 1;
        box-shadow: 
            0 0 25px rgba(255, 215, 0, 0.6),
            0 0 50px rgba(212, 175, 55, 0.4),
            inset 0 0 25px rgba(255, 215, 0, 0.15);
        position: relative;
        margin: 0;
    }
    
    .popup-content.popup-modal::before {
        content: '';
        position: absolute;
        top: -3px;
        left: -3px;
        right: -3px;
        bottom: -3px;
        background: linear-gradient(45deg, #FFD700, #D4AF37, #FFD700, #B8860B, #FFD700);
        border-radius: 21px;
        z-index: -1;
        animation: royalGlowMobile 4s ease-in-out infinite alternate;
    }
    
    @keyframes royalGlowMobile {
        0% {
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
            filter: hue-rotate(0deg);
        }
        25% {
            box-shadow: 0 0 30px rgba(212, 175, 55, 0.7);
            filter: hue-rotate(8deg);
        }
        50% {
            box-shadow: 0 0 35px rgba(255, 215, 0, 0.9);
            filter: hue-rotate(0deg);
        }
        75% {
            box-shadow: 0 0 30px rgba(184, 134, 11, 0.7);
            filter: hue-rotate(-8deg);
        }
        100% {
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
            filter: hue-rotate(0deg);
        }
    }
    
    .popup-image {
        height: 280px;
        border-radius: 15px 15px 0 0;
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1410 100%);
        padding: 6px 6px 0 6px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .popup-image img {
        width: calc(100% - 3px);
        height: calc(100% - 3px);
        object-fit: cover;
        object-position: center;
        border-radius: 10px 10px 0 0;
        box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.1);
    }
    
    .popup-info {
        height: 120px;
        padding: 12px 15px;
        background: linear-gradient(135deg, #1a1410 0%, #2a1f10 100%);
        border-radius: 0 0 15px 15px;
        border-top: 2px solid rgba(255, 215, 0, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .popup-visit-btn {
        width: 100%;
        max-width: none;
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 700;
        border-radius: 10px;
        background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
        color: #000 !important;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        box-shadow: 
            0 3px 12px rgba(255, 215, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        border: 2px solid rgba(255, 215, 0, 0.8);
        transition: all 0.3s ease;
    }
    
    .popup-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 18px;
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(212, 175, 55, 0.8));
        border: 2px solid rgba(255, 215, 0, 0.6);
        border-radius: 50%;
        color: #000;
        font-weight: bold;
        box-shadow: 
            0 3px 12px rgba(255, 215, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
    }
    
    /* Prevent body scroll when modal is open */
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}
