/* ============================================================================
   MODERN ANIMATIONS - 2026 Premium Effects
   Smooth, performant, 60fps animations
   ============================================================================ */

/* ============================================================================
   PAGE & SECTION ANIMATIONS
   ============================================================================ */

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.page-enter {
    animation: pageEnter 400ms ease-out forwards;
}

.page-exit {
    animation: pageExit 300ms ease-in forwards;
}

/* ============================================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================================ */

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reveal-up {
    animation: revealUp 600ms ease-out forwards;
}

.reveal-down {
    animation: revealDown 600ms ease-out forwards;
}

.reveal-left {
    animation: revealLeft 600ms ease-out forwards;
}

.reveal-right {
    animation: revealRight 600ms ease-out forwards;
}

.scale-in {
    animation: scaleIn 500ms ease-out forwards;
}

/* Staggered animation delays */
.reveal-delay-1 { animation-delay: 100ms; }
.reveal-delay-2 { animation-delay: 200ms; }
.reveal-delay-3 { animation-delay: 300ms; }
.reveal-delay-4 { animation-delay: 400ms; }
.reveal-delay-5 { animation-delay: 500ms; }

/* ============================================================================
   HOVER EFFECTS
   ============================================================================ */

@keyframes hoverLift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-8px);
    }
}

@keyframes hoverGlow {
    from {
        box-shadow: 0 0 20px rgba(229, 57, 53, 0.3);
    }
    to {
        box-shadow: 0 0 40px rgba(229, 57, 53, 0.5);
    }
}

@keyframes tilt3d {
    from {
        transform: rotateX(0deg) rotateY(0deg);
    }
    to {
        transform: rotateX(5deg) rotateY(5deg);
    }
}

.hover-lift:hover {
    animation: hoverLift 300ms ease-out forwards;
}

.hover-glow {
    transition: box-shadow 300ms ease-out;
}

.hover-glow:hover {
    box-shadow: 0 0 40px rgba(229, 57, 53, 0.5);
}

/* ============================================================================
   BUTTON ANIMATIONS
   ============================================================================ */

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(229, 57, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
    }
}

@keyframes buttonShine {
    from {
        left: -100%;
    }
    to {
        left: 100%;
    }
}

.btn-pulse {
    animation: buttonPulse 1.5s infinite;
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: buttonShine 2s infinite;
}

/* ============================================================================
   LOADING ANIMATIONS
   ============================================================================ */

@keyframes spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinnerTrack {
    0% {
        stroke-dasharray: 0, 100;
    }
    50% {
        stroke-dasharray: 80, 20;
    }
    100% {
        stroke-dasharray: 0, 100;
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(229, 57, 53, 0.2);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

.loader-small {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(229, 57, 53, 0.2);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

.loader-large {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(229, 57, 53, 0.1);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spinner 1.2s linear infinite;
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================================
   INPUT ANIMATIONS
   ============================================================================ */

@keyframes floatLabel {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0.7;
        transform: translateY(-25px);
    }
}

@keyframes focusRing {
    from {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.3);
    }
    to {
        box-shadow: 0 0 0 8px rgba(229, 57, 53, 0);
    }
}

.input-focus-ring {
    animation: focusRing 0.5s ease-out;
}

/* Animated input underline */
.input-underline {
    position: relative;
    border: none;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--space-2);
}

.input-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width 300ms ease-out;
}

.input-underline:focus::after {
    width: 100%;
}

/* ============================================================================
   DROPDOWN & MENU ANIMATIONS
   ============================================================================ */

@keyframes dropdownOpen {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownClose {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.dropdown-menu {
    animation: dropdownOpen 200ms ease-out forwards;
}

.dropdown-menu.closing {
    animation: dropdownClose 150ms ease-in forwards;
}

/* ============================================================================
   MODAL & OVERLAY ANIMATIONS
   ============================================================================ */

@keyframes modalBackdropEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalContentEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalBackdropExit {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes modalContentExit {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
}

.modal-backdrop {
    animation: modalBackdropEnter 300ms ease-out forwards;
}

.modal-backdrop.exiting {
    animation: modalBackdropExit 300ms ease-in forwards;
}

.modal-content {
    animation: modalContentEnter 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-content.exiting {
    animation: modalContentExit 300ms ease-in forwards;
}

/* ============================================================================
   CARD ANIMATIONS
   ============================================================================ */

@keyframes cardHover {
    from {
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    to {
        transform: translateY(-8px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    }
}

@keyframes cardTilt {
    0% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    }
    50% {
        transform: perspective(1000px) rotateX(2deg) rotateY(2deg);
    }
    100% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    }
}

.card-tilt:hover {
    animation: cardTilt 600ms ease-out;
}

/* ============================================================================
   PROGRESS ANIMATIONS
   ============================================================================ */

@keyframes progressSlide {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@keyframes progressFill {
    from {
        width: 0%;
    }
}

.progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: var(--space-4) 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--accent-red) 0%,
        var(--accent-red-light) 50%,
        var(--accent-red) 100%
    );
    background-size: 200% 100%;
    animation: progressSlide 2s ease-in-out infinite;
    border-radius: 10px;
    transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.animated {
    animation: progressFill 1s ease-out forwards, progressSlide 2s ease-in-out infinite;
}

/* ============================================================================
   TOAST/NOTIFICATION ANIMATIONS
   ============================================================================ */

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.toast {
    animation: toastEnter 300ms ease-out forwards;
}

.toast.exiting {
    animation: toastExit 300ms ease-in forwards;
}

/* ============================================================================
   BACKGROUND ANIMATIONS
   ============================================================================ */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-30px);
    }
}

.bg-gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

.float {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

/* ============================================================================
   TEXT ANIMATIONS
   ============================================================================ */

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 49% {
        border-right-color: var(--accent-red);
    }
    50%, 100% {
        border-right-color: transparent;
    }
}

.text-typewriter {
    overflow: hidden;
    border-right: 3px solid var(--accent-red);
    white-space: nowrap;
    animation: typewriter 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes textGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.text-gradient {
    background: linear-gradient(90deg, var(--accent-red), var(--primary-light), var(--accent-red));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 3s ease infinite;
}

/* ============================================================================
   ICON ANIMATIONS
   ============================================================================ */

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(3deg);
    }
    75% {
        transform: rotate(-3deg);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: skewX(0deg);
    }
    25% {
        transform: skewX(-5deg);
    }
    75% {
        transform: skewX(5deg);
    }
}

.icon-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.icon-rotate {
    animation: rotate 2s linear infinite;
}

.icon-swing {
    animation: swing 2s ease-in-out infinite;
}

.icon-wiggle {
    animation: wiggle 0.5s ease-in-out infinite;
}

/* ============================================================================
   STAGGER ANIMATIONS (For Lists)
   ============================================================================ */

.list-item {
    animation: revealUp 600ms ease-out both;
}

.list-item:nth-child(1) { animation-delay: 0ms; }
.list-item:nth-child(2) { animation-delay: 100ms; }
.list-item:nth-child(3) { animation-delay: 200ms; }
.list-item:nth-child(4) { animation-delay: 300ms; }
.list-item:nth-child(5) { animation-delay: 400ms; }
.list-item:nth-child(n+6) { animation-delay: 500ms; }

/* ============================================================================
   TRANSITION UTILITIES
   ============================================================================ */

.transition-fast {
    transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-base {
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-slow {
    transition: all 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   MOBILE OPTIMIZATIONS
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    @keyframes revealUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .card-tilt:hover {
        animation: none;
        transform: translateY(-4px);
    }
}

/* ============================================================================
   END OF ANIMATIONS
   ============================================================================ */
