/**
 * Secrez CRO Behavioral Optimization Styles
 * Week 2: Urgency banners, social proof, progressive disclosure
 * Compatible with dark/light theme system
 */

/* ===== URGENCY BANNER STYLES ===== */
.cro-urgency-banner {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 14px 24px;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: bannerSlideDown 0.4s ease-out;
}

.cro-urgency-banner.pulse {
    animation: bannerSlideDown 0.4s ease-out, bannerPulse 2s infinite;
}

@keyframes bannerSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bannerPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 4px 25px rgba(255,255,255,0.3); }
}

.banner-icon {
    font-size: 1.2rem;
    animation: iconBounce 1s infinite;
}

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

.banner-text {
    direction: rtl;
}

.banner-countdown {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.banner-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
    margin-right: auto;
}

.banner-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* ===== SOCIAL PROOF NOTIFICATIONS ===== */
.cro-social-proof {
    position: fixed;
    bottom: 100px;
    left: 20px;
    background: var(--bg-secondary, #161d3a);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1001;
    max-width: 320px;
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* ===== PROGRESSIVE DISCLOSURE ===== */
.form-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary, #161d3a);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 12px;
    transition: all 0.4s ease;
}

.form-section.revealed {
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.1);
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(167, 139, 250, 0.2);
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.form-section:not(.revealed) .step-num {
    background: rgba(167, 139, 250, 0.3);
}

.step-title {
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.form-section:not(.revealed) .step-title {
    color: var(--text-secondary, #8892b0);
}

/* ===== SCARCITY ELEMENTS ===== */
.scarcity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff4757, #ff6348);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    animation: scarcityPulse 2s infinite;
}

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

.scarcity-count {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    font-weight: 800;
}

/* ===== EXIT INTENT MODAL ===== */
.exit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.exit-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.exit-modal {
    background: var(--bg-secondary, #161d3a);
    border: 2px solid rgba(167, 139, 250, 0.3);
    border-radius: 20px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.exit-modal-overlay.active .exit-modal {
    transform: scale(1);
}

.exit-modal h3 {
    color: var(--text-primary, #fff);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.exit-modal p {
    color: var(--text-secondary, #8892b0);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.exit-modal .btn-primary {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exit-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(167, 139, 250, 0.3);
}

.exit-modal .btn-secondary {
    background: transparent;
    color: var(--text-secondary, #8892b0);
    border: 1px solid rgba(167, 139, 250, 0.3);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.exit-modal .btn-secondary:hover {
    border-color: var(--accent-primary, #a78bfa);
    color: var(--text-primary, #fff);
}

/* ===== FOMO TICKER ===== */
.fomo-ticker {
    background: var(--bg-secondary, #161d3a);
    border-top: 1px solid rgba(167, 139, 250, 0.2);
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
}

.fomo-ticker-content {
    display: inline-flex;
    animation: tickerScroll 30s linear infinite;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.fomo-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 30px;
    color: var(--text-secondary, #8892b0);
    font-size: 0.85rem;
}

.fomo-item .user {
    color: var(--accent-primary, #a78bfa);
    font-weight: 600;
}

/* ===== COMPARISON TABLE HIGHLIGHT ===== */
.comparison-highlight {
    position: relative;
    border: 2px solid #28a745;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.2);
}

.comparison-highlight::before {
    content: '⭐ توصیه شده';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] .cro-urgency-banner {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

[data-theme="light"] .cro-social-proof {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

[data-theme="light"] .exit-modal-overlay {
    background: rgba(0,0,0,0.6);
}

/* ===== MOBILE ADAPTATIONS ===== */
@media (max-width: 768px) {
    .cro-urgency-banner {
        padding: 12px 16px;
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .cro-social-proof {
        left: 10px;
        right: 10px;
        max-width: none;
        bottom: 80px;
    }
    
    .exit-modal {
        padding: 1.5rem;
    }
    
    .banner-close {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
}
