/**
 * Modern Animation Styles
 * Smooth, professional animations for enhanced UX
 */

/* ===========================
   SCROLL REVEAL ANIMATIONS
   =========================== */

.fade-in-up,
.fade-in-left,
.fade-in-right,
.fade-in {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up {
    transform: translateY(40px);
}

.fade-in-left {
    transform: translateX(-40px);
}

.fade-in-right {
    transform: translateX(40px);
}

.fade-in-up.visible,
.fade-in-left.visible,
.fade-in-right.visible,
.fade-in.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Stagger animation delays for cards */
.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.15s; }
.service-card:nth-child(3) { transition-delay: 0.2s; }
.service-card:nth-child(4) { transition-delay: 0.25s; }
.service-card:nth-child(5) { transition-delay: 0.3s; }
.service-card:nth-child(6) { transition-delay: 0.35s; }

.why-card:nth-child(1) { transition-delay: 0.1s; }
.why-card:nth-child(2) { transition-delay: 0.15s; }
.why-card:nth-child(3) { transition-delay: 0.2s; }
.why-card:nth-child(4) { transition-delay: 0.25s; }

/* ===========================
   BUTTON ANIMATIONS
   =========================== */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* ===========================
   CARD HOVER ANIMATIONS
   =========================== */

.service-card,
.why-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.why-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* ===========================
   TEXT ANIMATIONS
   =========================== */

/* Gradient text animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-text {
    background: linear-gradient(90deg, #0356A3, #1a73e8, #0356A3);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Typing animation for headings */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

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

.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

/* ===========================
   ICON ANIMATIONS
   =========================== */

.service-icon,
.why-icon {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-icon,
.why-card:hover .why-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-icon svg,
.why-icon svg,
.why-icon i {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon svg,
.why-card:hover .why-icon svg,
.why-card:hover .why-icon i {
    transform: scale(1.1);
}

/* ===========================
   FLOATING ANIMATION
   =========================== */

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-5px) translateX(-3px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.hero-image {
    animation: float 8s ease-in-out infinite;
}

/* ===========================
   PULSE ANIMATION
   =========================== */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* ===========================
   SLIDE IN ANIMATIONS
   =========================== */

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===========================
   SCALE ANIMATIONS
   =========================== */

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===========================
   ROTATE ANIMATIONS
   =========================== */

@keyframes rotateIn {
    from {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

.rotate-in {
    animation: rotateIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===========================
   SHIMMER EFFECT
   =========================== */

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

.shimmer {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===========================
   SMOOTH SCROLL
   =========================== */

html {
    scroll-behavior: smooth;
}

/* ===========================
   PAGE LOAD ANIMATIONS
   =========================== */

@keyframes fadeInAnimation {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-load {
    animation: fadeInAnimation 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===========================
   LINK HOVER EFFECTS
   =========================== */

.nav-menu a {
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   IMAGE HOVER EFFECTS
   =========================== */

.hero-image img,
.cta-image img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.hero-image:hover img,
.cta-image:hover img {
    transform: scale(1.05);
}

/* Grayscale to Color Effect */
.grayscale-hover,
.team-member img,
.profile-image,
.headshot {
    filter: grayscale(100%);
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s ease;
}

.grayscale-hover:hover,
.team-member:hover img,
.profile-image:hover,
.headshot:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Alternative: Start with color, go to grayscale on hover */
.color-to-grayscale {
    filter: grayscale(0%);
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-to-grayscale:hover {
    filter: grayscale(100%);
}

/* ===========================
   FORM INPUT ANIMATIONS
   =========================== */

input, textarea, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, textarea:focus, select:focus {
    transform: translateY(-2px);
}

/* ===========================
   LOADING SPINNER
   =========================== */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(3, 86, 163, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

/* ===========================
   BOUNCE ANIMATION
   =========================== */

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* ===========================
   FADE IN STAGGER
   =========================== */

.stagger-fade-in > * {
    opacity: 0;
    animation: fadeInAnimation 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }

/* ===========================
   PARALLAX EFFECT
   =========================== */

.parallax {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   RESPONSIVE ANIMATIONS
   =========================== */

@media (max-width: 768px) {
    .fade-in-up {
        transform: translateY(20px);
    }
    
    .fade-in-left,
    .fade-in-right {
        transform: translateY(20px);
    }
    
    .service-card:hover,
    .why-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

/* ===========================
   REDUCED MOTION
   =========================== */

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