/* Modern Popup Rewards - Frontend Styles */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Cormorant+Garamond:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&family=Open+Sans:wght@300;400;600;700&family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&family=Lato:wght@300;400;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --mpr-primary: #1e3a8a;
    --mpr-secondary: #f59e0b;
    --mpr-text: #ffffff;
    --mpr-backdrop: rgba(15, 23, 42, 0.85);
    --mpr-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --mpr-shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
}

/* Overlay */
.mpr-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    /* Background será definido inline com cor e opacidade customizáveis */
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.mpr-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Modal Container */
.mpr-modal {
    position: relative;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-radius: 32px;
    padding: 0;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--mpr-shadow-xl);
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

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

/* Decorative Elements */
.mpr-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: mprFloat 6s ease-in-out infinite;
}

.mpr-modal::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: mprFloat 8s ease-in-out infinite reverse;
}

@keyframes mprFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(20px, -20px) rotate(5deg); }
    66% { transform: translate(-15px, 15px) rotate(-5deg); }
}

/* Icon Section */
.mpr-icon-section {
    position: relative;
    padding: 48px 48px 32px;
    text-align: center;
    z-index: 1;
}

.mpr-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    margin: 0 auto 24px;
    position: relative;
    animation: mprPulse 3s ease-in-out infinite;
}

/* Quando tem imagem customizada, remover o background */
.mpr-icon-wrapper:has(img) {
    background: transparent !important;
}

.mpr-icon-wrapper::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 50%;
    animation: mprRing 2s ease-in-out infinite;
}

@keyframes mprPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes mprRing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

.mpr-icon {
    font-size: 64px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

/* Custom Image Icon - GARANTIR VISIBILIDADE TOTAL */
.mpr-icon-wrapper img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 80px !important;
    height: 80px !important;
    object-fit: contain !important;
    display: block !important;
    opacity: 1 !important;
    filter: none !important;
    border-radius: 12px !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Content Section */
.mpr-content {
    position: relative;
    padding: 0 48px 48px;
    z-index: 1;
}

.mpr-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--mpr-text);
    margin: 0 0 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
}

.mpr-description {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 32px;
    line-height: 1.6;
    text-align: center;
}

/* Button */
.mpr-button {
    display: block;
    width: 100%;
    padding: 18px 32px;
    background: var(--mpr-secondary);
    /* cor removida - será aplicada via inline style */
    border: none;
    border-radius: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
    position: relative;
    overflow: hidden;
}

.mpr-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mpr-button:hover::before {
    width: 300px;
    height: 300px;
}

.mpr-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(245, 158, 11, 0.5);
}

.mpr-button:active {
    transform: translateY(0);
}

.mpr-button-text {
    position: relative;
    z-index: 1;
}

/* Sponsored Label */
.mpr-sponsored {
    position: relative;
    margin-top: 24px;
    padding-top: 20px;
    text-align: center;
    z-index: 1;
}

.mpr-sponsored::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.mpr-sponsored-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Loading State */
.mpr-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.mpr-loading.active {
    display: block;
}

.mpr-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--mpr-secondary);
    border-radius: 50%;
    animation: mprSpin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes mprSpin {
    to { transform: rotate(360deg); }
}

.mpr-loading-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 640px) {
    .mpr-modal {
        border-radius: 24px;
        max-width: 90%;
    }
    
    .mpr-icon-section {
        padding: 36px 32px 24px;
    }
    
    .mpr-content {
        padding: 0 32px 36px;
    }
    
    .mpr-icon-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .mpr-icon {
        font-size: 52px;
    }
    
    .mpr-title {
        font-size: 26px;
    }
    
    .mpr-description {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .mpr-button {
        padding: 16px 28px;
        font-size: 16px;
    }
}

/* Body lock when popup is active */
body.mpr-lock {
    overflow: hidden;
    height: 100vh;
}

/* Custom scrollbar for better aesthetics */
.mpr-modal::-webkit-scrollbar {
    width: 8px;
}

.mpr-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.mpr-modal::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.5);
    border-radius: 4px;
}

.mpr-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.7);
}
