/* ===============================
   ANIMATIONS — Coding Tech LLC
   =============================== */

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

    100% {
        background-position: 200% center;
    }
}

@keyframes barGrow {
    from {
        height: 0;
    }

    to {
        height: var(--h);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-10vh) translateX(50px) scale(1);
        opacity: 0;
    }
}

/* Hero animations */
.animate-in {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.animate-in:nth-child(1) {
    animation-delay: 0.1s;
}

.animate-in:nth-child(2) {
    animation-delay: 0.3s;
}

.animate-in:nth-child(3) {
    animation-delay: 0.5s;
}

.animate-in:nth-child(4) {
    animation-delay: 0.7s;
}

.animate-in:nth-child(5) {
    animation-delay: 0.9s;
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--delay, 0s);
}

.reveal.visible,
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Page Transitions */
.page {
    animation: none;
}

.page.active {
    animation: fadeInUp 0.5s ease;
}

/* Button Ripple */
.btn {
    position: relative;
    overflow: hidden;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    width: 10px;
    height: 10px;
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* Hover Glow on Cards */
.service-card,
.portfolio-card,
.pricing-card,
.team-card,
.blog-card,
.ci-card,
.admin-stat-card {
    position: relative;
}

.service-card::after,
.portfolio-card::after,
.blog-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.service-card:hover::after,
.portfolio-card:hover::after,
.blog-card:hover::after {
    opacity: 1;
}

/* Particles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--blue);
    border-radius: 50%;
    animation: particleFloat linear infinite;
    opacity: 0;
}

/* Gradient border animation */
.pricing-card.popular::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(135deg, var(--blue), var(--purple), var(--cyan), var(--blue));
    background-size: 300% 300%;
    animation: gradientBorder 4s ease infinite;
    z-index: -1;
}

@keyframes gradientBorder {

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

    50% {
        background-position: 100% 50%;
    }
}

/* Navbar link underline animation */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--blue);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::before {
    width: 60%;
    left: 20%;
}

/* Stat counter animation */
.stat-item {
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

/* Service card icon bounce */
.service-card:hover .service-icon,
.service-detail-card:hover .sdc-icon {
    animation: float 1s ease-in-out infinite;
}

/* Blog card image zoom */
.blog-card-img,
.pc-image {
    transition: transform 0.4s ease;
    overflow: hidden;
}

.blog-card:hover .blog-card-img,
.portfolio-card:hover .pc-image {
    transform: scale(1.03);
}

/* Timeline animation */
.timeline-item {
    transition: transform 0.3s ease, background 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(8px);
    background: rgba(59, 130, 246, 0.05);
}

/* Dashboard mockup animations */
.dashboard-mockup {
    animation: scaleIn 1s ease 0.5s both;
}

.stat-bar {
    animation: barGrow 1.5s ease-out 1s both;
}

/* Loading shimmer for mockup */
.mockup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

/* Smooth scroll indicator */
@keyframes scrollBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* Filter tab animation */
.filter-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-tab.active {
    animation: scaleIn 0.3s ease;
}

/* Toast slide in */
.toast.show {
    animation: slideInRight 0.4s ease;
}

/* Modal enter */
.modal.show .modal-content {
    animation: scaleIn 0.3s ease;
}

/* Admin sidebar link hover */
.admin-nav-link {
    transition: all 0.2s ease;
}

.admin-nav-link:hover {
    padding-left: 24px;
}

/* Magnetic button effect placeholder */
.btn-glow {
    animation: glow 3s ease-in-out infinite;
}

/* Smooth page transitions */
.page-transitioning {
    opacity: 0;
    transform: translateY(20px);
}