/**
 * Micro-Upsell System Styles
 * Contextual, ethical, non-disruptive upsell UI components
 */

/* Base Upsell Card */
.micro-upsell-card {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease;
}

.micro-upsell-card:hover {
    border-color: #8B5CF6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.upsell-content {
    max-width: 600px;
    margin: 0 auto;
}

.upsell-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111827;
}

.upsell-body {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 16px;
}

.upsell-value {
    background: #F9FAFB;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    color: #374151;
    border-left: 3px solid #8B5CF6;
}

.upsell-value-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.upsell-value-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    font-size: 16px;
    color: #374151;
}

.upsell-value-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10B981;
    font-weight: bold;
}

.upsell-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-upsell-primary {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 50%, #EC4899 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-upsell-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-upsell-secondary {
    background: white;
    color: #6B7280;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid #E5E7EB;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-upsell-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.upsell-microcopy {
    font-size: 12px;
    color: #6B7280;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 0;
}

/* Type A — Module Unlock */
.module-unlock-upsell {
    border-color: #8B5CF6;
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
}

/* Type B — Personalisation Expansion (Modal) */
.micro-upsell-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.micro-upsell-modal.active {
    opacity: 1;
    pointer-events: all;
}

.upsell-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.upsell-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.micro-upsell-modal.active .upsell-modal-content {
    transform: scale(1);
}

.upsell-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    color: #6B7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.upsell-modal-close:hover {
    background: #F3F4F6;
    color: #111827;
}

.personalisation-upsell .upsell-modal-content {
    border: 2px solid #8B5CF6;
}

/* Type C — Certificate Lock (Celebration) */
.micro-upsell-celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.micro-upsell-celebration.active {
    opacity: 1;
    pointer-events: all;
}

.celebration-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.micro-upsell-celebration.active .celebration-content {
    transform: scale(1);
}

.celebration-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.celebration-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #111827;
}

.celebration-body {
    font-size: 18px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 24px;
}

.certificate-preview {
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #E5E7EB;
}

.certificate-preview.locked {
    position: relative;
}

.certificate-blur {
    filter: blur(8px);
    background: #F3F4F6;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-placeholder {
    text-align: center;
    padding: 40px;
}

.certificate-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.certificate-placeholder p {
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

/* Type D — Mentor Assist */
.mentor-assist-upsell {
    border-color: #10B981;
    background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
}

.mentor-suggestion {
    font-style: italic;
    color: #059669;
}

/* Type E — Momentum Reminder */
.momentum-reminder-upsell {
    border-color: #F59E0B;
    background: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .upsell-content {
        padding: 16px;
    }
    
    .upsell-title {
        font-size: 20px;
    }
    
    .upsell-body {
        font-size: 14px;
    }
    
    .upsell-actions {
        flex-direction: column;
    }
    
    .btn-upsell-primary,
    .btn-upsell-secondary {
        width: 100%;
    }
    
    .upsell-modal-content,
    .celebration-content {
        padding: 24px;
    }
    
    .celebration-title {
        font-size: 24px;
    }
    
    .celebration-body {
        font-size: 16px;
    }
}

/* Animation for card appearance */
@keyframes upsellSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.micro-upsell-card {
    animation: upsellSlideIn 0.3s ease;
}

