/* Universal Viral Cards System - Horizontal 1:1 Premium Design */

/* Card Container for In-App Display */
.viral-cards-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    overflow: visible;
    border-radius: 28px;
    touch-action: pan-y;
    box-sizing: border-box;
    padding: 1rem;
}

.viral-cards-track {
    display: flex;
    width: 300%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.viral-card-inline {
    width: calc(100% / 3);
    flex-shrink: 0;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Base Card - Horizontal 1:1 Premium Design */
.viral-card-inline .viral-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 400px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    animation: cardReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Premium Gradient Backgrounds */
.viral-card.gradient-pink {
    background: 
        radial-gradient(circle at 20% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(249, 115, 22, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, #fce7f3 0%, #fef3c7 25%, #fed7aa 50%, #fce7f3 100%);
}

.viral-card.gradient-purple {
    background: 
        radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 25%, #ddd6fe 50%, #f3e8ff 100%);
}

.viral-card.gradient-orange {
    background: 
        radial-gradient(circle at 20% 30%, rgba(249, 115, 22, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, #fff7ed 0%, #ffedd5 25%, #fed7aa 50%, #fff7ed 100%);
}

/* Subtle grain texture */
.viral-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.01) 2px, rgba(0, 0, 0, 0.01) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 0, 0, 0.01) 2px, rgba(0, 0, 0, 0.01) 4px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

/* Soft radial glow behind content */
.viral-card::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: glowPulse 12s ease-in-out infinite;
}

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

/* Horizontal Layout Structure */
.viral-card {
    display: flex;
    flex-direction: row;
    position: relative;
    z-index: 2;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
}

/* LEFT SIDE - Hero Focus */
.card-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 3;
}

.hero-emoji {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    animation: scorePop 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

@keyframes scorePop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: #1f2937;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: scorePop 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-label {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: #1f2937;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: scorePop 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-challenge-text {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: #1f2937;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: scorePop 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-score {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: #ec4899;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 12px rgba(236, 72, 153, 0.2);
    animation: scorePop 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

.hero-percentage {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: #6b7280;
    letter-spacing: 0.02em;
    animation: scorePop 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

/* RIGHT SIDE - Context + Emotion */
.card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 3;
    padding-left: 1rem;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.context-quiz-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.8;
}

.context-commentary {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: #374151;
    font-style: italic;
}

.context-challenge {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ec4899;
    letter-spacing: 0.01em;
}

/* Footer */
.card-footer {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.02em;
    z-index: 3;
    text-align: center;
    width: 100%;
}

/* Card Navigation Dots */
.viral-card-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.viral-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(236, 72, 153, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.viral-card-dot.active {
    width: 24px;
    background: #ec4899;
    border-radius: 4px;
}

/* Action Buttons (Outside Cards) */
.viral-card-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.viral-card-btn {
    padding: 1rem 2rem;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.viral-card-btn.primary {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

.viral-card-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.viral-card-btn.primary:active {
    transform: scale(0.97);
}

.viral-card-btn.secondary {
    background: white;
    color: #ec4899;
    border: 2px solid #ec4899;
}

.viral-card-btn.secondary:hover {
    background: #fce7f3;
    transform: translateY(-2px);
}

.viral-card-btn.secondary:active {
    transform: scale(0.97);
}

.viral-card-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .viral-cards-container {
        max-width: 100%;
        padding: 0.5rem;
    }
    
    .viral-card-inline {
        padding: 0.5rem;
    }
    
    .viral-card-inline .viral-card {
        max-width: 100%;
        padding: 1.5rem 1rem;
        gap: 1rem;
    }
    
    .hero-emoji {
        font-size: 2.5rem;
    }
    
    .hero-title,
    .hero-label {
        font-size: 1.5rem;
    }
    
    .hero-challenge-text {
        font-size: 1.1rem;
    }
    
    .hero-score {
        font-size: 2.5rem;
    }
    
    .hero-percentage {
        font-size: 1.1rem;
    }
    
    .context-commentary {
        font-size: 0.85rem;
    }
    
    .context-challenge {
        font-size: 0.75rem;
    }
    
    .card-footer {
        font-size: 0.6rem;
        bottom: 0.75rem;
    }
    
    .viral-card-actions {
        flex-direction: column;
    }
    
    .viral-card-btn {
        width: 100%;
    }
}

/* Story Mode (for download) - Keep 9:16 for exports */
.viral-card:not(.viral-card-inline .viral-card) {
    aspect-ratio: 9 / 16;
    width: 1080px;
    height: 1920px;
    padding: 180px 100px 240px;
}
