/* =============================================================================
   ANIMATIONS - Classcheck.in
   ============================================================================= */

/* =============================================================================
   KEYFRAME ANIMATIONS
   ============================================================================= */

/* Fade animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Marquee animation */
@keyframes marquee {
    from {
        transform: translateX(0%);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Floating animation */
@keyframes floating {
    0% {
        transform: translate(0, 0px);
    }
    50% {
        transform: translate(0, 15px);
    }
    100% {
        transform: translate(0, 0px);
    }
}

/* Text gradient animation */
@keyframes textGradientFlow {
    to {
        background-position: 200% center;
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Ping animation */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* SVG Flow Line Animation */
@keyframes flow {
    from {
        stroke-dashoffset: 100;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* SVG Pulse Dot Animations */
@keyframes pulseDot {
    0%, 100% {
        r: 2;
        opacity: 0.5;
    }
    50% {
        r: 3.5;
        opacity: 0.9;
    }
}

@keyframes pulseDotLarge {
    0%, 100% {
        r: 4;
        opacity: 0.6;
    }
    50% {
        r: 5.5;
        opacity: 1;
    }
}

/* Rotation animation */
@keyframes rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scale animation */
@keyframes scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Slide in animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Wobble animation */
@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Heart beat animation */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* =============================================================================
   SVG ANIMATIONS
   ============================================================================= */

/* Flow line animations for hero SVG */
.flow-line {
    stroke-dasharray: 100;
    animation: flow 4s ease-in-out infinite alternate;
}

/* Pulse dot animations */
.pulse-dot {
    animation: pulseDot 2.5s ease-in-out infinite;
}

.pulse-dot-large {
    animation: pulseDotLarge 3s ease-in-out infinite;
}

/* Staggered animation delays for SVG elements */
.flow-line:nth-of-type(even) {
    animation-delay: -1s;
}

.flow-line:nth-of-type(3n) {
    animation-delay: -0.5s;
}

.pulse-dot:nth-of-type(odd) {
    animation-delay: -0.8s;
}

.pulse-dot-large:nth-of-type(even) {
    animation-delay: -1.2s;
}

/* =============================================================================
   SCROLL ANIMATIONS
   ============================================================================= */

/* Base styles for scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.7s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

/* Fade in variations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.6s ease-out forwards;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    animation: slideInRight 0.6s ease-out forwards;
}

.zoom-in {
    opacity: 0;
    transform: scale(0.8);
    animation: zoomIn 0.6s ease-out forwards;
}

/* =============================================================================
   HOVER ANIMATIONS
   ============================================================================= */

/* Card hover effects */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Button hover animations */
.btn-hover-up {
    transition: all 0.3s ease;
}

.btn-hover-up:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.btn-hover-scale {
    transition: transform 0.3s ease;
}

.btn-hover-scale:hover {
    transform: scale(1.02);
}

/* Icon hover animations */
.icon-bounce:hover {
    animation: bounce 1s ease infinite;
}

.icon-spin:hover {
    animation: spin 1s linear infinite;
}

.icon-wobble:hover {
    animation: wobble 1s ease-in-out;
}

.icon-pulse:hover {
    animation: pulse 1s ease-in-out infinite;
}

/* =============================================================================
   LOADING ANIMATIONS
   ============================================================================= */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-dots div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading-dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading-dots3 0.6s infinite;
}

@keyframes loading-dots1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading-dots3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading-dots2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

/* =============================================================================
   PAGE TRANSITION ANIMATIONS
   ============================================================================= */

.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease-out;
}

.page-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-out;
}

/* =============================================================================
   MODAL ANIMATIONS
   ============================================================================= */

.modal-backdrop {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
}

.modal {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* =============================================================================
   NOTIFICATION ANIMATIONS
   ============================================================================= */

.notification {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.hide {
    transform: translateX(100%);
}

/* =============================================================================
   PARALLAX ANIMATIONS
   ============================================================================= */

.parallax-element {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* =============================================================================
   TEXT ANIMATIONS
   ============================================================================= */

.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--primary);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    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(--primary);
    }
}

.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    transform: translateX(-100%);
    animation: reveal 0.8s ease-out forwards;
}

@keyframes reveal {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* =============================================================================
   FORM ANIMATIONS
   ============================================================================= */

.form-group {
    position: relative;
}

.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.form-label-float {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #9ca3af;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-input:focus + .form-label-float,
.form-input:not(:placeholder-shown) + .form-label-float {
    top: -8px;
    left: 8px;
    font-size: 0.75rem;
    color: var(--primary);
    background: white;
    padding: 0 4px;
}

/* =============================================================================
   STAGGER ANIMATIONS
   ============================================================================= */

.stagger-animation {
    animation-delay: calc(var(--stagger-delay, 0) * 100ms);
}

/* Generate stagger delays */
.stagger-1 { --stagger-delay: 1; }
.stagger-2 { --stagger-delay: 2; }
.stagger-3 { --stagger-delay: 3; }
.stagger-4 { --stagger-delay: 4; }
.stagger-5 { --stagger-delay: 5; }

/* =============================================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================================= */

/* Hardware acceleration for smooth animations */
.hardware-accelerate {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize animations for performance */
.optimized-animation {
    will-change: transform, opacity;
}

/* =============================================================================
   ACCESSIBILITY ANIMATIONS
   ============================================================================= */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .parallax-element {
        transform: none !important;
    }
    
    .floating {
        animation: none !important;
    }
    
    .bounce,
    .pulse,
    .wobble,
    .heartbeat {
        animation: none !important;
    }
}

/* Focus animations */
.focus-ring:focus {
    animation: focusPulse 0.6s ease-out;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

/* =============================================================================
   CUSTOM ANIMATION UTILITIES
   ============================================================================= */

/* Animation play states */
.animation-paused {
    animation-play-state: paused;
}

.animation-running {
    animation-play-state: running;
}

/* Animation directions */
.animation-reverse {
    animation-direction: reverse;
}

.animation-alternate {
    animation-direction: alternate;
}

/* Animation fill modes */
.animation-forwards {
    animation-fill-mode: forwards;
}

.animation-backwards {
    animation-fill-mode: backwards;
}

.animation-both {
    animation-fill-mode: both;
}

/* Animation iteration counts */
.animation-infinite {
    animation-iteration-count: infinite;
}

.animation-once {
    animation-iteration-count: 1;
}

.animation-twice {
    animation-iteration-count: 2;
}

/* Animation timing functions */
.ease-in-out-back {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ease-in-out-circ {
    animation-timing-function: cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

.ease-in-out-expo {
    animation-timing-function: cubic-bezier(1, 0, 0, 1);
}