/* Dynamic Story Card Animations & Interactive Effects */

/* Story Card Hover Effects Only */
.story-card, .modern-story-card {
    position: relative;
    overflow: hidden;
}

/* No animations on page load - only on hover */
.story-card:hover, .modern-story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.2);
    transition: all 0.2s ease;
}

/* Reaction Button Dynamic Effects */
.reaction-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.reaction-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.reaction-btn:active {
    transform: scale(0.95);
}

.reaction-btn.active, .reaction-btn.reacted {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    100% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
}

/* Reaction Count Animation */
.reaction-count {
    transition: all 0.3s ease;
    display: inline-block;
}

.reaction-count.updating {
    animation: countUp 0.6s ease-out;
}

@keyframes countUp {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.4) translateY(-5px); color: #ffc107; }
    100% { transform: scale(1) translateY(0); }
}

/* Story Content Reveal Animation */
.story-excerpt {
    overflow: hidden;
    position: relative;
}

.story-card:hover .story-excerpt::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #6610f2, #e83e8c);
    animation: shimmer 2s infinite;
}

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

/* Interactive Elements */
.story-media img, .story-media video {
    transition: all 0.3s ease;
}

.story-card:hover .story-media img,
.story-card:hover .story-media video {
    transform: scale(1.05);
    filter: brightness(1.1) saturate(1.2);
}

/* Engagement Analytics Overlay */
.engagement-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.story-card:hover .engagement-overlay {
    opacity: 1;
}

/* Reaction Trail Effect */
@keyframes reactionTrail {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(1.5);
    }
}

.reaction-trail {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    animation: reactionTrail 1s ease-out forwards;
    z-index: 1000;
}

/* Community Engagement Indicators */
.engagement-indicator {
    position: absolute;
    bottom: 5px;
    left: 5px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-card:hover .engagement-indicator {
    opacity: 1;
}

.engagement-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.engagement-high { background: #28a745; }
.engagement-medium { background: #ffc107; }
.engagement-low { background: #6c757d; }

/* Trending Story Effects */
.story-card.trending {
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.story-card.trending::before {
    content: "🔥 TRENDING";
    position: absolute;
    top: -10px;
    left: 10px;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    color: white;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 10px;
    z-index: 10;
}

/* Interactive Story Timeline */
.story-timeline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.timeline-progress {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0%;
    transition: width 0.3s ease;
}

.story-card:hover .timeline-progress {
    animation: progressFill 3s ease-in-out infinite;
}

@keyframes progressFill {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    .story-card:hover,
    .reaction-btn:hover,
    .reaction-btn.active,
    .reaction-count.updating {
        animation: none;
        transition: none;
    }
}

/* Performance Optimizations */
.story-card,
.reaction-btn,
.reaction-count {
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}