/*
 * Template Factory — Premium Patterns animation library.
 * All classes use the `tf-` prefix to avoid collisions.
 */

/* ===== keyframes ===== */
@keyframes tf-fade-up { from { opacity: 0; transform: translate3d(0, 30px, 0); } to { opacity: 1; transform: none; } }
@keyframes tf-fade-down { from { opacity: 0; transform: translate3d(0, -30px, 0); } to { opacity: 1; transform: none; } }
@keyframes tf-fade-left { from { opacity: 0; transform: translate3d(-30px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes tf-fade-right { from { opacity: 0; transform: translate3d(30px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes tf-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tf-zoom-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes tf-shine {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(200%) skewX(-15deg); }
}
@keyframes tf-pulse-soft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
@keyframes tf-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes tf-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== reveal-on-scroll triggers (set initial state, JS adds .tf-visible) ===== */
@media (prefers-reduced-motion: no-preference) {
    .tf-fade-up:not(.tf-visible),
    .tf-fade-down:not(.tf-visible),
    .tf-fade-left:not(.tf-visible),
    .tf-fade-right:not(.tf-visible),
    .tf-fade-in:not(.tf-visible),
    .tf-zoom-in:not(.tf-visible) {
        opacity: 0;
        will-change: opacity, transform;
    }
    .tf-fade-up.tf-visible { animation: tf-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .tf-fade-down.tf-visible { animation: tf-fade-down 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .tf-fade-left.tf-visible { animation: tf-fade-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .tf-fade-right.tf-visible { animation: tf-fade-right 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .tf-fade-in.tf-visible { animation: tf-fade-in 0.6s ease-out forwards; }
    .tf-zoom-in.tf-visible { animation: tf-zoom-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

    /* delays for staggered entry */
    .tf-delay-100 { animation-delay: 0.1s !important; }
    .tf-delay-200 { animation-delay: 0.2s !important; }
    .tf-delay-300 { animation-delay: 0.3s !important; }
    .tf-delay-400 { animation-delay: 0.4s !important; }
    .tf-delay-500 { animation-delay: 0.5s !important; }
    .tf-delay-600 { animation-delay: 0.6s !important; }

    /* stagger children automatically */
    .tf-stagger > *:nth-child(1) { animation-delay: 0.05s; }
    .tf-stagger > *:nth-child(2) { animation-delay: 0.15s; }
    .tf-stagger > *:nth-child(3) { animation-delay: 0.25s; }
    .tf-stagger > *:nth-child(4) { animation-delay: 0.35s; }
    .tf-stagger > *:nth-child(5) { animation-delay: 0.45s; }
    .tf-stagger > *:nth-child(6) { animation-delay: 0.55s; }
}

/* ===== continuous animations ===== */
.tf-float { animation: tf-float 4s ease-in-out infinite; }
.tf-pulse-soft { animation: tf-pulse-soft 3s ease-in-out infinite; }
.tf-gradient-animated {
    background-size: 200% 200%;
    animation: tf-gradient-shift 8s ease infinite;
}

/* ===== hover effects (work without JS) ===== */
.tf-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    border-radius: 12px;
}
.tf-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.tf-card-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    transition: transform 0.4s ease, border-color 0.4s ease;
}
.tf-card-glass:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.32);
}

.tf-shadow-soft { box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08); }
.tf-shadow-md { box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10); }
.tf-shadow-lg { box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14); }
.tf-shadow-glow { box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25), 0 18px 40px rgba(99, 102, 241, 0.20); }

.tf-rounded-md { border-radius: 8px; }
.tf-rounded-lg { border-radius: 16px; }
.tf-rounded-xl { border-radius: 24px; }
.tf-rounded-full { border-radius: 9999px; }

/* ===== gradient text fill ===== */
.tf-gradient-text-purple,
.tf-gradient-text-blue,
.tf-gradient-text-warm,
.tf-gradient-text-cyan {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}
.tf-gradient-text-purple { background-image: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); }
.tf-gradient-text-blue { background-image: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); }
.tf-gradient-text-warm { background-image: linear-gradient(135deg, #f97316 0%, #ec4899 100%); }
.tf-gradient-text-cyan { background-image: linear-gradient(135deg, #06b6d4 0%, #10b981 100%); }

/* ===== button shine effect (apply to wp:button block via className) ===== */
.tf-btn-shine .wp-block-button__link,
.tf-btn-shine.wp-block-button .wp-block-button__link,
a.tf-btn-shine {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tf-btn-shine .wp-block-button__link::before,
.tf-btn-shine.wp-block-button .wp-block-button__link::before,
a.tf-btn-shine::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%) skewX(-15deg);
    pointer-events: none;
}
.tf-btn-shine:hover .wp-block-button__link::before,
.tf-btn-shine.wp-block-button:hover .wp-block-button__link::before,
a.tf-btn-shine:hover::before {
    animation: tf-shine 0.9s ease;
}
.tf-btn-shine:hover .wp-block-button__link,
.tf-btn-shine.wp-block-button:hover .wp-block-button__link,
a.tf-btn-shine:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

/* ===== overlay helpers for cover blocks ===== */
.tf-overlay-noise::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* ===== utility tag (eyebrow text above big headings) ===== */
.tf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.10);
    color: #4f46e5;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tf-eyebrow-light {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ===== icon dot (use inside paragraph for emoji icons) ===== */
.tf-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.30);
}
.tf-icon-circle-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.5rem;
    background: rgba(99, 102, 241, 0.10);
    color: #4f46e5;
}

/* ===== big stat number ===== */
.tf-stat-number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ===== fluid spacing ===== */
.tf-section-padding { padding-top: clamp(4rem, 8vw, 7rem); padding-bottom: clamp(4rem, 8vw, 7rem); }
