/* ============================================
   ANIMATIONS - Enhanced fluid animations
   @package TheCreators
   ============================================ */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */
@keyframes tc-text-clip {
    0% {
        clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes tc-letter-rotate {
    0% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    100% {
        transform: rotateX(0);
        opacity: 1;
    }
}

@keyframes tc-text-gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text {
    background-size: 200% 200%;
    animation: tc-text-gradient-flow 5s ease infinite;
}

/* ============================================
   FLOATING ANIMATIONS
   ============================================ */
@keyframes tc-float-gentle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(1deg);
    }
    75% {
        transform: translateY(5px) rotate(-1deg);
    }
}

@keyframes tc-float-rotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

/* ============================================
   GLOW EFFECTS
   ============================================ */
@keyframes tc-glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.1),
                    0 0 40px rgba(0, 212, 255, 0.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.2),
                    0 0 60px rgba(0, 212, 255, 0.1);
    }
}

@keyframes tc-border-glow {
    0%, 100% {
        border-color: rgba(0, 212, 255, 0.1);
    }
    50% {
        border-color: rgba(0, 212, 255, 0.3);
    }
}

/* ============================================
   SHAKE / ATTENTION
   ============================================ */
@keyframes tc-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes tc-rubber {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.25, 0.75); }
    40% { transform: scale(0.75, 1.25); }
    50% { transform: scale(1.15, 0.85); }
    65% { transform: scale(0.95, 1.05); }
    75% { transform: scale(1.05, 0.95); }
    100% { transform: scale(1, 1); }
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
@keyframes tc-page-enter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tc-main {
    animation: tc-page-enter 0.6s var(--tc-transition) forwards;
}

/* ============================================
   SCROLL-TRIGGERED STAGGER
   ============================================ */
.tc-stagger > *:nth-child(1) { --i: 1; }
.tc-stagger > *:nth-child(2) { --i: 2; }
.tc-stagger > *:nth-child(3) { --i: 3; }
.tc-stagger > *:nth-child(4) { --i: 4; }
.tc-stagger > *:nth-child(5) { --i: 5; }
.tc-stagger > *:nth-child(6) { --i: 6; }
.tc-stagger > *:nth-child(7) { --i: 7; }
.tc-stagger > *:nth-child(8) { --i: 8; }
.tc-stagger > *:nth-child(9) { --i: 9; }
.tc-stagger > *:nth-child(10) { --i: 10; }
.tc-stagger > *:nth-child(11) { --i: 11; }
.tc-stagger > *:nth-child(12) { --i: 12; }

/* ============================================
   MORPHING BACKGROUND SHAPES
   ============================================ */
@keyframes tc-morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
    }
    75% {
        border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
    }
}

.tc-morph-bg {
    animation: tc-morph 8s ease-in-out infinite;
}

/* ============================================
   LINE DRAWING
   ============================================ */
@keyframes tc-draw-line {
    0% {
        width: 0;
    }
    100% {
        width: 60px;
    }
}

.tc-divider {
    animation: tc-draw-line 0.8s var(--tc-transition) forwards;
    width: 0;
}

.tc-divider.revealed {
    animation: tc-draw-line 0.8s var(--tc-transition) forwards;
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.tc-stat-number {
    display: inline-block;
}

/* ============================================
   TILT / 3D CARD EFFECT
   ============================================ */
.tc-tilt {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tc-tilt:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(5deg);
}

/* ============================================
   INFINITE SCROLL TEXT
   ============================================ */
.tc-scroll-text {
    display: flex;
    white-space: nowrap;
    overflow: hidden;
}

.tc-scroll-text-inner {
    display: flex;
    animation: tc-scroll-text 20s linear infinite;
}

@keyframes tc-scroll-text {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tc-scroll-text span {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    font-family: var(--tc-font-display);
    color: rgba(255, 255, 255, 0.03);
    padding: 0 2rem;
    user-select: none;
}

/* ============================================
   LINK HOVER EFFECTS
   ============================================ */
.tc-post-content a {
    position: relative;
    color: var(--tc-accent);
    transition: color 0.3s var(--tc-transition);
}

.tc-post-content a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--tc-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--tc-transition);
}

.tc-post-content a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ============================================
   PARALLAX LAYERS
   ============================================ */
.tc-parallax-layer {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ============================================
   NOISE OVERLAY
   ============================================ */
.tc-main::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.tc-main > * {
    position: relative;
    z-index: 2;
}

/* ============================================
   PAGINATION STYLING
   ============================================ */
.nav-links {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--tc-gray-light);
    font-size: 0.9rem;
    transition: all 0.3s var(--tc-transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links .page-numbers:hover,
.nav-links .page-numbers.current {
    background: var(--tc-gradient);
    color: var(--tc-white);
    border-color: transparent;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .tc-reveal,
    .tc-reveal-left,
    .tc-reveal-right,
    .tc-reveal-scale {
        opacity: 1;
        transform: none;
    }

    .tc-loader {
        display: none;
    }
}
