/* ==========================================================================
   The Paschall Group - Animations Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base Animation Classes
   -------------------------------------------------------------------------- */

/* Fade In */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up */
.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Down */
.animate-slide-down {
    opacity: 0;
    transform: translateY(-30px);
    animation: slideDown 0.8s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Left */
.animate-slide-left {
    opacity: 0;
    transform: translateX(30px);
    animation: slideLeft 0.8s ease forwards;
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Right */
.animate-slide-right {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideRight 0.8s ease forwards;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.8s ease forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --------------------------------------------------------------------------
   Animation Delays
   -------------------------------------------------------------------------- */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }
.delay-9 { animation-delay: 0.9s; }
.delay-10 { animation-delay: 1s; }

/* --------------------------------------------------------------------------
   Scroll-Triggered Animations (Initial States)
   -------------------------------------------------------------------------- */
[data-animate="fade-in"],
[data-animate="slide-up"],
[data-animate="slide-down"],
[data-animate="slide-left"],
[data-animate="slide-right"],
[data-animate="scale-in"],
[data-animate="counter"] {
    opacity: 0;
}

[data-animate="slide-up"] {
    transform: translateY(40px);
}

[data-animate="slide-down"] {
    transform: translateY(-40px);
}

[data-animate="slide-left"] {
    transform: translateX(40px);
}

[data-animate="slide-right"] {
    transform: translateX(-40px);
}

[data-animate="scale-in"] {
    transform: scale(0.9);
}

/* Animated State */
[data-animate].animated {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* --------------------------------------------------------------------------
   Staggered Animations
   -------------------------------------------------------------------------- */
[data-animate-stagger] > * {
    opacity: 0;
    transform: translateY(20px);
}

[data-animate-stagger].animated > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate-stagger].animated > *:nth-child(1) { transition-delay: 0.1s; }
[data-animate-stagger].animated > *:nth-child(2) { transition-delay: 0.2s; }
[data-animate-stagger].animated > *:nth-child(3) { transition-delay: 0.3s; }
[data-animate-stagger].animated > *:nth-child(4) { transition-delay: 0.4s; }
[data-animate-stagger].animated > *:nth-child(5) { transition-delay: 0.5s; }
[data-animate-stagger].animated > *:nth-child(6) { transition-delay: 0.6s; }
[data-animate-stagger].animated > *:nth-child(7) { transition-delay: 0.7s; }
[data-animate-stagger].animated > *:nth-child(8) { transition-delay: 0.8s; }

/* --------------------------------------------------------------------------
   Special Animations
   -------------------------------------------------------------------------- */

/* Pulse Animation */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Float Animation */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Shimmer Effect */
.animate-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Glow Animation */
.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(232, 119, 34, 0.2);
    }
    to {
        box-shadow: 0 0 40px rgba(232, 119, 34, 0.4);
    }
}

/* Rotate Animation */
.animate-rotate {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Bounce Animation */
.animate-bounce {
    animation: bounce 2s ease infinite;
}

/* Text Typing Animation */
.animate-typing {
    overflow: hidden;
    border-right: 2px solid var(--color-accent);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-accent);
    }
}

/* Draw Line Animation */
.animate-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw 2s ease forwards;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Counter Animation */
.animate-count {
    display: inline-block;
}

/* --------------------------------------------------------------------------
   Hover Animations
   -------------------------------------------------------------------------- */

/* Lift on Hover */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Scale on Hover */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Glow on Hover */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(232, 119, 34, 0.3);
}

/* Underline on Hover */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Page Transitions
   -------------------------------------------------------------------------- */

/* Page Enter Animation */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Page Exit Animation */
.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --------------------------------------------------------------------------
   Loading Animations
   -------------------------------------------------------------------------- */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 102, 204, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dots Loading */
.dots-loading {
    display: inline-flex;
    gap: 4px;
}

.dots-loading span {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: dots 1.4s ease-in-out infinite both;
}

.dots-loading span:nth-child(1) { animation-delay: -0.32s; }
.dots-loading span:nth-child(2) { animation-delay: -0.16s; }
.dots-loading span:nth-child(3) { animation-delay: 0; }

@keyframes dots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 0%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 100%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* --------------------------------------------------------------------------
   Reduced Motion Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    [data-animate],
    [data-animate-stagger] > * {
        opacity: 1;
        transform: none;
    }
}

