/* ============ POPUP ETORO STYLES ============ */

/* Overlay di sfondo */
.promo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    display: none;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Popup principale - più compatto */
.promo-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 99999;
    width: 90%;
    max-width: 420px; /* Ridotto da 500px */
    max-height: 90vh; /* Limite altezza su mobile */
    display: none;
    animation: slideUp 0.4s ease forwards;
    overflow: hidden;
    overflow-y: auto; /* Scroll se necessario su schermi molto piccoli */
}

/* Stati di visualizzazione */
.promo-popup.show,
.promo-overlay.show {
    display: block;
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Header del popup - più compatto */
.popup-header {
    background: linear-gradient(135deg, #fbbc04, #f9ab00);
    padding: 15px 20px; /* Ridotto da 20px */
    position: relative;
}

/* Bottone di chiusura */
.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1;
}

.popup-close:hover {
    background: white;
    transform: rotate(90deg);
}

/* Badge offerta */
.popup-badge {
    display: inline-block;
    background: white;
    color: #f9ab00;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    animation: pulse 2s infinite;
}

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

/* Titolo popup */
.popup-title {
    color: white;
    font-size: 20px; /* Ridotto da 24px */
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

/* Contenuto principale - più compatto */
.popup-contents {
    padding: 20px; /* Ridotto da 30px */
    text-align: center;
}

.broker-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Ridotto da 20px */
}

/* Logo del broker */
.broker-logo-large {
    height: 40px; /* Ridotto da 50px */
    object-fit: contain;
    max-width: 180px;
}

/* Box offerta principale - più compatto */
.offer-highlight {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 15px; /* Ridotto da 20px */
    margin: 15px 0;
    width: 100%;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.offer-percentage {
    font-size: 36px; /* Ridotto da 48px */
    font-weight: 900;
    color: #2e7d32;
    margin: 0;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.offer-text {
    font-size: 16px; /* Ridotto da 18px */
    color: #1b5e20;
    font-weight: 600;
    margin: 8px 0 4px;
}

.offer-subtitle {
    font-size: 13px; /* Ridotto da 14px */
    color: #558b2f;
}

/* Testo sfida - più compatto */
.challenge-text {
    font-size: 16px; /* Ridotto da 20px */
    font-weight: 600;
    color: #333;
    margin: 15px 0;
    line-height: 1.4;
}

.challenge-text .highlight {
    color: #f9ab00;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 2px;
    display: inline-block;
    animation: wave 2s infinite;
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Features - più compatte */
.popup-features {
    display: flex;
    justify-content: center;
    gap: 10px; /* Ridotto da 15px */
    margin: 15px 0;
    flex-wrap: wrap;
}

.popup-feature {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px; /* Ridotto da 14px */
    color: #555;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 20px;
}

.popup-feature::before {
    content: '✔';
    color: #4caf50;
    font-weight: bold;
}

/* CTA Button - più compatto */
.popup-cta {
    display: inline-block;
    background: #1a73e8;
    color: white;
    padding: 12px 28px; /* Ridotto da 14px 32px */
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px; /* Ridotto da 16px */
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
}

.popup-cta:hover {
    background: #1557b0;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
    transform: translateY(-1px);
}

/* Footer del popup - più compatto */
.popup-footer {
    background: #f8f9fa;
    padding: 12px 15px; /* Ridotto da 15px */
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.popup-disclaimer {
    font-size: 10px; /* Ridotto da 11px */
    color: #666;
    margin: 0;
}

.popup-timer {
    font-size: 11px; /* Ridotto da 12px */
    color: #999;
    margin-top: 4px;
}

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

/* Smartphone piccoli (< 380px) */
@media (max-width: 380px) {
    .promo-popup {
        width: 95%;
        max-width: none;
        margin: 10px;
        border-radius: 12px;
    }
    
    .popup-header {
        padding: 12px 15px;
    }
    
    .popup-title {
        font-size: 18px;
    }
    
    .popup-content {
        padding: 15px;
    }
    
    .offer-percentage {
        font-size: 32px;
    }
    
    .offer-text {
        font-size: 14px;
    }
    
    .challenge-text {
        font-size: 14px;
    }
    
    .popup-features {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .popup-feature {
        justify-content: center;
        padding: 6px 10px;
    }
    
    .popup-cta {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Smartphone standard (380px - 480px) */
@media (min-width: 380px) and (max-width: 480px) {
    .promo-popup {
        width: 92%;
        max-width: 380px;
    }
    
    .popup-content {
        padding: 18px;
    }
    
    .offer-percentage {
        font-size: 34px;
    }
    
    .challenge-text {
        font-size: 15px;
    }
    
    .popup-cta {
        width: 100%;
        padding: 12px 24px;
    }
}

/* Phablet e tablet piccoli (480px - 768px) */
@media (min-width: 480px) and (max-width: 768px) {
    .promo-popup {
        width: 85%;
        max-width: 400px;
    }
    
    .offer-percentage {
        font-size: 38px;
    }
    
    .popup-cta {
        padding: 13px 30px;
    }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .promo-popup {
        max-width: 420px;
    }
}

/* Desktop piccoli (1024px - 1280px) */
@media (min-width: 1024px) and (max-width: 1280px) {
    .promo-popup {
        max-width: 440px;
    }
    
    .offer-percentage {
        font-size: 40px;
    }
}

/* Desktop grandi (> 1280px) */
@media (min-width: 1280px) {
    .promo-popup {
        max-width: 450px;
    }
    
    .offer-percentage {
        font-size: 42px;
    }
    
    .popup-title {
        font-size: 22px;
    }
}

/* Landscape mode su mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .promo-popup {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .popup-header {
        padding: 10px 15px;
    }
    
    .popup-content {
        padding: 15px;
    }
    
    .offer-highlight {
        padding: 10px;
        margin: 10px 0;
    }
    
    .offer-percentage {
        font-size: 28px;
    }
    
    .popup-features {
        margin: 10px 0;
    }
}

/* Accessibilità e performance */
@media (prefers-reduced-motion: reduce) {
    .promo-overlay,
    .promo-popup {
        animation: none;
    }
    
    .popup-badge,
    .challenge-text .highlight {
        animation: none;
    }
    
    .popup-close:hover {
        transform: none;
    }
}

/* Scrollbar personalizzata per il popup su overflow */
.promo-popup::-webkit-scrollbar {
    width: 6px;
}

.promo-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.promo-popup::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.promo-popup::-webkit-scrollbar-thumb:hover {
    background: #555;
}