/**
 * ESTILOS POPUP UPGRADE 720 DPI → 1440 DPI
 * Diseño moderno, responsive y animado
 */

/* Overlay oscuro con blur */
.popup-upgrade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.popup-upgrade-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(144, 67, 158, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(176, 63, 176, 0.1) 0%, transparent 50%);
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.popup-upgrade-overlay.popup-upgrade-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Container principal del popup */
.popup-upgrade-container {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
    border-radius: 24px;
    max-width: 650px;
    width: 90%;
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.4),
        0 10px 40px rgba(144, 67, 158, 0.3),
        0 0 100px rgba(176, 63, 176, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
    overflow: hidden;
    border: 1px solid rgba(144, 67, 158, 0.1);
}

.popup-upgrade-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(144, 67, 158, 0.8),
        rgba(176, 63, 176, 0.8),
        rgba(144, 67, 158, 0.8),
        transparent
    );
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

.popup-upgrade-visible .popup-upgrade-container {
    transform: scale(1) translateY(0);
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.5),
        0 15px 50px rgba(144, 67, 158, 0.4),
        0 0 120px rgba(176, 63, 176, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Animación de éxito */
.popup-upgrade-success .popup-upgrade-container {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 20px 60px rgba(0, 200, 0, 0.3),
            0 0 80px rgba(0, 255, 0, 0.4);
    }
}

/* Botón cerrar (X) */
.popup-upgrade-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.popup-upgrade-close span {
    display: block;
    line-height: 36px;
}

/* Contenido del popup */
.popup-upgrade-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Imagen superior */
.popup-upgrade-imagen {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 24px 24px 0 0;
}

/* Sección de texto */
.popup-upgrade-texto {
    padding: 35px 30px;
}

/* Título */
.popup-upgrade-titulo {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #8B2E8B 0%, #B03FB0 50%, #8B2E8B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    display: inline-block;
    width: 100%;
    animation: titleGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(139, 46, 139, 0.3));
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 4px 8px rgba(139, 46, 139, 0.3));
    }
    50% {
        filter: drop-shadow(0 6px 12px rgba(176, 63, 176, 0.5));
    }
}

/* Descripción */
.popup-upgrade-descripcion {
    font-size: 18px;
    color: #333;
    text-align: center;
    margin: 0 0 25px 0;
    line-height: 1.6;
}

.popup-upgrade-precio {
    color: #B03FB0;
    font-size: 28px;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(176, 63, 176, 0.3);
    display: inline-block;
    animation: pulsePrecio 2s ease-in-out infinite;
    padding: 2px 12px;
    background: linear-gradient(135deg, rgba(144, 67, 158, 0.1), rgba(176, 63, 176, 0.1));
    border-radius: 8px;
    position: relative;
}

.popup-upgrade-precio::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #8B2E8B, #B03FB0);
    border-radius: 8px;
    z-index: -1;
    opacity: 0.2;
    animation: priceBorder 2s ease-in-out infinite;
}

@keyframes priceBorder {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.05);
    }
}

/* Lista de beneficios */
.popup-upgrade-beneficios {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.popup-upgrade-beneficios li {
    font-size: 16px;
    color: #444;
    padding: 14px 20px;
    margin: 10px 0;
    background: linear-gradient(to right, rgba(144, 67, 158, 0.08), rgba(144, 67, 158, 0.02));
    border-left: 4px solid #8B2E8B;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.popup-upgrade-beneficios li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(144, 67, 158, 0.15), transparent);
    transition: left 0.6s ease;
}

.popup-upgrade-beneficios li svg {
    flex-shrink: 0;
    color: #8B2E8B;
    transition: transform 0.3s ease;
}

.popup-upgrade-beneficios li:hover {
    background: linear-gradient(to right, rgba(144, 67, 158, 0.15), rgba(176, 63, 176, 0.08));
    transform: translateX(8px) scale(1.02);
    border-left-color: #B03FB0;
    box-shadow: 0 6px 20px rgba(144, 67, 158, 0.2);
}

.popup-upgrade-beneficios li:hover::before {
    left: 100%;
}

.popup-upgrade-beneficios li:hover svg {
    transform: scale(1.2) rotate(5deg);
}

.popup-upgrade-beneficios strong {
    color: #8B2E8B;
    font-weight: 700;
}

/* Contenedor de botones */
.popup-upgrade-botones {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Wrapper de botón + precio */
.popup-upgrade-btn-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Precio junto al botón principal */
.popup-upgrade-precio-cta {
    font-size: 24px;
    font-weight: 900;
    color: #8B2E8B;
    white-space: nowrap;
    min-width: 85px;
    text-align: right;
    text-shadow: 0 2px 4px rgba(139, 46, 139, 0.2);
}

/* Precio junto al botón secundario */
.popup-upgrade-precio-cta-secondary {
    font-size: 20px;
    font-weight: 700;
    color: #666;
    white-space: nowrap;
    min-width: 85px;
    text-align: right;
}

/* Botón ACEPTAR (principal) */
.btn-upgrade-aceptar {
    background: linear-gradient(135deg, #8B2E8B 0%, #B03FB0 50%, #8B2E8B 100%);
    color: white;
    border: none;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 6px 20px rgba(139, 46, 139, 0.4),
        0 0 30px rgba(176, 63, 176, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.btn-upgrade-aceptar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shineButton 3s ease-in-out infinite;
}

@keyframes shineButton {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.btn-upgrade-aceptar:hover {
    transform: scale(1.05);
    box-shadow: 
        0 8px 30px rgba(139, 46, 139, 0.6),
        0 0 40px rgba(176, 63, 176, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-upgrade-aceptar:active {
    transform: scale(0.98);
}

/* Botón RECHAZAR (secundario) */
.btn-upgrade-rechazar {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    padding: 14px 30px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.btn-upgrade-rechazar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #333;
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-upgrade-rechazar:hover {
    background: #333;
    border-color: #333;
    color: white;
    transform: scale(1.02);
}

.btn-upgrade-rechazar:hover::before {
    width: 100%;
}

.btn-upgrade-rechazar:active {
    transform: scale(0.98);
}

/* ========== RESPONSIVE ========== */

/* Laptops y pantallas medianas (1024px - 1366px) - COMPACTO */
@media (max-width: 1366px) and (min-width: 769px) {
    .popup-upgrade-container {
        max-width: 450px;
        border-radius: 18px;
    }
    
    .popup-upgrade-imagen {
        max-height: 120px;
        border-radius: 18px 18px 0 0;
    }
    
    .popup-upgrade-texto {
        padding: 20px 20px;
    }
    
    .popup-upgrade-titulo {
        font-size: 22px;
        margin-bottom: 12px;
        letter-spacing: 0.8px;
    }
    
    .popup-upgrade-descripcion {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .popup-upgrade-beneficios {
        margin-bottom: 20px;
    }
    
    .popup-upgrade-beneficios li {
        font-size: 13px;
        padding: 8px 12px;
        margin: 5px 0;
        border-radius: 8px;
    }
    
    .popup-upgrade-beneficios li svg {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    .popup-upgrade-botones {
        gap: 10px;
    }
    
    .popup-upgrade-btn-wrapper {
        gap: 10px;
    }
    
    .btn-upgrade-aceptar {
        font-size: 13px;
        padding: 12px 20px;
        letter-spacing: 0.3px;
    }
    
    .btn-upgrade-rechazar {
        font-size: 12px;
        padding: 10px 16px;
    }
    
    .popup-upgrade-precio-cta {
        font-size: 18px;
        min-width: 70px;
    }
    
    .popup-upgrade-precio-cta-secondary {
        font-size: 16px;
        min-width: 70px;
    }
    
    .popup-upgrade-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
        top: 12px;
        right: 12px;
    }
    
    .popup-upgrade-close span {
        line-height: 32px;
    }
}

@media (max-width: 768px) {
    .popup-upgrade-overlay {
        padding: 15px;
    }
    
    .popup-upgrade-container {
        border-radius: 16px;
    }
    
    .popup-upgrade-imagen {
        max-height: 180px;
        border-radius: 16px 16px 0 0;
    }
    
    .popup-upgrade-texto {
        padding: 30px 25px;
    }
    
    .popup-upgrade-titulo {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .popup-upgrade-descripcion {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .popup-upgrade-precio {
        font-size: 20px;
    }
    
    .popup-upgrade-beneficios li {
        font-size: 15px;
        padding: 10px 15px;
        margin: 6px 0;
    }
    
    .btn-upgrade-aceptar {
        font-size: 15px;
        padding: 14px 25px;
    }
    
    .btn-upgrade-rechazar {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .popup-upgrade-precio-cta {
        font-size: 20px;
        min-width: 75px;
    }
    
    .popup-upgrade-precio-cta-secondary {
        font-size: 18px;
        min-width: 75px;
    }
    
    .popup-upgrade-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
        top: 12px;
        right: 12px;
    }
    
    .popup-upgrade-close span {
        line-height: 32px;
    }
}

@media (max-width: 480px) {
    .popup-upgrade-overlay {
        padding: 10px;
    }
    
    .popup-upgrade-container {
        border-radius: 12px;
    }
    
    .popup-upgrade-imagen {
        max-height: 140px;
        border-radius: 12px 12px 0 0;
    }
    
    .popup-upgrade-texto {
        padding: 25px 20px;
    }
    
    .popup-upgrade-titulo {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .popup-upgrade-descripcion {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .popup-upgrade-precio {
        font-size: 18px;
    }
    
    .popup-upgrade-beneficios {
        margin-bottom: 20px;
    }
    
    .popup-upgrade-beneficios li {
        font-size: 14px;
        padding: 8px 12px;
        margin: 5px 0;
    }
    
    .popup-upgrade-botones {
        gap: 10px;
    }
    
    .popup-upgrade-btn-wrapper {
        gap: 10px;
    }
    
    .btn-upgrade-aceptar {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .btn-upgrade-rechazar {
        font-size: 13px;
        padding: 10px 18px;
    }
    
    .popup-upgrade-precio-cta {
        font-size: 18px;
        min-width: 65px;
    }
    
    .popup-upgrade-precio-cta-secondary {
        font-size: 16px;
        min-width: 65px;
    }
    
    .popup-upgrade-close {
        width: 32px;
        height: 32px;
        font-size: 22px;
        top: 10px;
        right: 10px;
    }
    
    .popup-upgrade-close span {
        line-height: 28px;
    }
}

/* ========== ANIMACIONES ADICIONALES ========== */

/* Efecto de entrada para cada elemento */
.popup-upgrade-visible .popup-upgrade-titulo {
    animation: fadeInUp 0.5s ease 0.1s both;
}

.popup-upgrade-visible .popup-upgrade-descripcion {
    animation: fadeInUp 0.5s ease 0.2s both;
}

.popup-upgrade-visible .popup-upgrade-beneficios li:nth-child(1) {
    animation: fadeInUp 0.5s ease 0.3s both;
}

.popup-upgrade-visible .popup-upgrade-beneficios li:nth-child(2) {
    animation: fadeInUp 0.5s ease 0.35s both;
}

.popup-upgrade-visible .popup-upgrade-beneficios li:nth-child(3) {
    animation: fadeInUp 0.5s ease 0.4s both;
}

.popup-upgrade-visible .popup-upgrade-beneficios li:nth-child(4) {
    animation: fadeInUp 0.5s ease 0.45s both;
}

.popup-upgrade-visible .popup-upgrade-botones {
    animation: fadeInUp 0.5s ease 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto de pulso en el precio */
.popup-upgrade-precio {
    animation: pulsePrecio 2s ease-in-out infinite;
}

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