/* =====================================================
   SINSAJO CREATORS BLOG - SPECTACULAR ANIMATIONS
   Premium animations with flying Sinsajo bird effect
   ===================================================== */

/* ============================================ */
/* Flying Sinsajo Bird - Comet Effect */
/* ============================================ */
.flying-sinsajo {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    filter: drop-shadow(0 0 20px rgba(0, 212, 170, 0.8))
            drop-shadow(0 0 40px rgba(102, 126, 234, 0.6))
            drop-shadow(0 0 60px rgba(118, 75, 162, 0.4));
}

.flying-sinsajo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Comet trail effect */
.flying-sinsajo::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 212, 170, 0.3) 20%,
        rgba(102, 126, 234, 0.6) 60%,
        rgba(118, 75, 162, 0.9) 100%);
    transform: translateY(-50%);
    border-radius: 2px;
    filter: blur(2px);
}

.flying-sinsajo::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(0, 212, 170, 1) 100%);
    transform: translateY(-50%);
    border-radius: 1px;
}

/* Flying animation */
@keyframes flyAcross {
    0% {
        left: -100px;
        top: 30%;
        opacity: 0;
        transform: rotate(-15deg) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: rotate(-10deg) scale(1);
    }
    30% {
        top: 20%;
        transform: rotate(-5deg) scale(1.1);
    }
    50% {
        top: 35%;
        transform: rotate(5deg) scale(1);
    }
    70% {
        top: 25%;
        transform: rotate(-5deg) scale(1.1);
    }
    90% {
        opacity: 1;
        transform: rotate(-10deg) scale(1);
    }
    100% {
        left: calc(100vw + 100px);
        top: 30%;
        opacity: 0;
        transform: rotate(-15deg) scale(0.5);
    }
}

.flying-sinsajo.animate {
    animation: flyAcross 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Sparkle particles */
.sparkle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, white 0%, rgba(0, 212, 170, 0.8) 50%, transparent 100%);
    pointer-events: none;
    z-index: 9998;
    animation: sparkle 0.8s ease-out forwards;
}

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

/* ============================================ */
/* Hero Gradient Animation */
/* ============================================ */
.blog-hero {
    background: linear-gradient(-45deg, #667eea, #764ba2, #00d4aa, #667eea);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles in hero */
.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.2), transparent);
    background-size: 200px 200px;
    animation: floatParticles 20s linear infinite;
    pointer-events: none;
}

@keyframes floatParticles {
    0% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-20px) translateX(10px); }
    100% { transform: translateY(0) translateX(0); }
}

/* ============================================ */
/* Hero Title Animations */
/* ============================================ */
.blog-hero h1 {
    animation: titleReveal 1s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes titleReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    animation: subtitleReveal 1s ease-out 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes subtitleReveal {
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

.search-container {
    animation: searchReveal 1s ease-out 0.4s forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

@keyframes searchReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================ */
/* Publish Day Badges */
/* ============================================ */
.publish-day-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.publish-day-badge.marketing-monday {
    background: linear-gradient(135deg, #f472b6, #ec4899);
    color: white;
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.4);
}

.publish-day-badge.tech-thursday {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.publish-day-badge i {
    font-size: 0.7rem;
}

/* ============================================ */
/* Article Cards Animations */
/* ============================================ */
.article-card {
    opacity: 0;
    transform: translateY(40px);
    animation: cardReveal 0.6s ease-out forwards;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }
.article-card:nth-child(7) { animation-delay: 0.7s; }
.article-card:nth-child(8) { animation-delay: 0.8s; }
.article-card:nth-child(9) { animation-delay: 0.9s; }
.article-card:nth-child(10) { animation-delay: 1s; }

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card hover glow effect */
.article-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2, #00d4aa, #667eea);
    background-size: 300% 300%;
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: borderGlow 3s ease infinite;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.article-card:hover::before {
    opacity: 1;
}

.article-card {
    position: relative;
}

/* Image zoom and overlay effect */
.article-card .article-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0) 0%,
        rgba(118, 75, 162, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.article-card:hover .article-image::after {
    opacity: 1;
}

.article-image {
    position: relative;
    overflow: hidden;
}

/* ============================================ */
/* Featured Article Animation */
/* ============================================ */
.featured-card {
    position: relative;
    animation: featuredPulse 3s ease-in-out infinite;
}

@keyframes featuredPulse {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(102, 126, 234, 0.15);
    }
    50% {
        box-shadow: 0 25px 70px rgba(118, 75, 162, 0.25);
    }
}

.featured-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #667eea, #764ba2, #00d4aa, #f472b6, #667eea);
    background-size: 400% 400%;
    border-radius: 27px;
    z-index: -1;
    animation: featuredBorder 4s ease infinite;
}

@keyframes featuredBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================ */
/* Filter Buttons Animation */
/* ============================================ */
.filter-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn.active {
    animation: buttonPop 0.3s ease;
}

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

/* ============================================ */
/* Newsletter Section Animation */
/* ============================================ */
.newsletter-section {
    position: relative;
    overflow: hidden;
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: newsletterGlow 10s linear infinite;
}

@keyframes newsletterGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.newsletter-content h2 {
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% { text-shadow: 0 0 20px rgba(255,255,255,0.3); }
    50% { text-shadow: 0 0 40px rgba(255,255,255,0.6); }
}

/* ============================================ */
/* Search Input Animation */
/* ============================================ */
.search-input:focus {
    animation: searchFocus 0.3s ease forwards;
}

@keyframes searchFocus {
    0% { box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
    100% {
        box-shadow: 0 15px 50px rgba(0,0,0,0.3),
                    0 0 0 3px rgba(139, 92, 246, 0.3);
    }
}

/* ============================================ */
/* Scroll Reveal Animations */
/* ============================================ */
.section-title {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.section-title.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================ */
/* Loading Skeleton Animation */
/* ============================================ */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.1) 25%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================ */
/* Popup Animation */
/* ============================================ */
.newsletter-popup.active .popup-content {
    animation: popupBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popupBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================ */
/* Article Page Specific Animations */
/* ============================================ */
.article-hero h1 {
    animation: heroSlideIn 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(40px);
}

@keyframes heroSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-featured-image img {
    animation: imageReveal 1s ease-out 0.3s forwards;
    opacity: 0;
    transform: scale(1.1);
}

@keyframes imageReveal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.article-main h2 {
    position: relative;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease;
}

.article-main h2.visible {
    opacity: 1;
    transform: translateX(0);
}

.article-main h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s ease 0.2s;
    border-radius: 2px;
}

.article-main h2.visible::after {
    width: 60px;
}

/* Related articles stagger animation */
.related-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.related-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.related-card:nth-child(1) { transition-delay: 0.1s; }
.related-card:nth-child(2) { transition-delay: 0.2s; }
.related-card:nth-child(3) { transition-delay: 0.3s; }

/* ============================================ */
/* Cursor Trail Effect (Optional Enhancement) */
/* ============================================ */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(102, 126, 234, 0.4) 0%,
        transparent 70%);
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* ============================================ */
/* Dark Theme Animation Adjustments */
/* ============================================ */
.dark-theme .article-card::before {
    background: linear-gradient(135deg, #764ba2, #667eea, #00d4aa, #764ba2);
}

.dark-theme .featured-card::before {
    background: linear-gradient(135deg, #764ba2, #667eea, #00d4aa, #f472b6, #764ba2);
}

.dark-theme .flying-sinsajo {
    filter: drop-shadow(0 0 25px rgba(0, 212, 170, 1))
            drop-shadow(0 0 50px rgba(102, 126, 234, 0.8))
            drop-shadow(0 0 75px rgba(118, 75, 162, 0.6));
}

/* ============================================ */
/* Mobile Optimizations */
/* ============================================ */
@media (max-width: 768px) {
    .flying-sinsajo {
        width: 40px;
        height: 40px;
    }

    .flying-sinsajo::before {
        width: 80px;
    }

    .flying-sinsajo::after {
        width: 50px;
    }

    @keyframes flyAcross {
        0% {
            left: -60px;
            top: 15%;
            opacity: 0;
            transform: rotate(-15deg) scale(0.5);
        }
        10% {
            opacity: 1;
            transform: rotate(-10deg) scale(1);
        }
        100% {
            left: calc(100vw + 60px);
            top: 15%;
            opacity: 0;
            transform: rotate(-15deg) scale(0.5);
        }
    }
}

/* ============================================ */
/* Reduced Motion Preference */
/* ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .flying-sinsajo {
        display: none;
    }
}
