/**
 * G-CERTI Argentina - QUANTUM ANIMATIONS
 * Version: 2026.5.0 UX PRO
 * 
 * Premium Micro-Interactions & Animations
 * Living Red (#E63935) Visual Identity
 */

/* ============================================================================
   ANIMATION TIMING FUNCTIONS
   ============================================================================ */
:root {
    /* Quantum Easing Curves */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-quantum: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

    /* Animation Durations */
    --duration-instant: 0.1s;
    --duration-fast: 0.2s;
    --duration-medium: 0.4s;
    --duration-slow: 0.6s;
    --duration-glacial: 1s;
}

/* ============================================================================
   ENTRANCE ANIMATIONS
   ============================================================================ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

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

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

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

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

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

    70% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================================
   LIVING RED GLOW PULSE
   ============================================================================ */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(230, 57, 53, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(230, 57, 53, 0.6);
    }
}

@keyframes glowPulseIntense {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(230, 57, 53, 0.4), 0 0 60px rgba(230, 57, 53, 0.2);
    }

    50% {
        box-shadow: 0 0 50px rgba(230, 57, 53, 0.7), 0 0 80px rgba(230, 57, 53, 0.3);
    }
}

/* ============================================================================
   FLOATING ANIMATIONS
   ============================================================================ */
@keyframes float {

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

    25% {
        transform: translateY(-10px) rotate(1deg);
    }

    75% {
        transform: translateY(5px) rotate(-1deg);
    }
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(20px, -20px) scale(1.02);
    }

    50% {
        transform: translate(-10px, 10px) scale(0.98);
    }

    75% {
        transform: translate(15px, 5px) scale(1.01);
    }
}

/* ============================================================================
   SHIMMER & SHINE EFFECTS
   ============================================================================ */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

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

.q-shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ============================================================================
   BORDER GLOW ANIMATION
   ============================================================================ */
@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(230, 57, 53, 0.3);
    }

    50% {
        border-color: rgba(230, 57, 53, 0.8);
    }
}

/* ============================================================================
   ANIMATION UTILITY CLASSES
   ============================================================================ */
.q-animate-fade-up {
    animation: fadeUp var(--duration-slow) var(--ease-quantum) forwards;
    opacity: 0;
}

.q-animate-fade-in {
    animation: fadeIn var(--duration-medium) var(--ease-smooth) forwards;
    opacity: 0;
}

.q-animate-slide-left {
    animation: slideInLeft var(--duration-slow) var(--ease-quantum) forwards;
    opacity: 0;
}

.q-animate-slide-right {
    animation: slideInRight var(--duration-slow) var(--ease-quantum) forwards;
    opacity: 0;
}

.q-animate-scale-in {
    animation: scaleIn var(--duration-medium) var(--ease-bounce) forwards;
    opacity: 0;
}

.q-animate-pop-in {
    animation: popIn var(--duration-medium) var(--ease-bounce) forwards;
    opacity: 0;
}

.q-animate-float {
    animation: float 6s ease-in-out infinite;
}

.q-animate-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

/* Animation Delays */
.q-delay-1 {
    animation-delay: 0.1s;
}

.q-delay-2 {
    animation-delay: 0.2s;
}

.q-delay-3 {
    animation-delay: 0.3s;
}

.q-delay-4 {
    animation-delay: 0.4s;
}

.q-delay-5 {
    animation-delay: 0.5s;
}

.q-delay-6 {
    animation-delay: 0.6s;
}

/* ============================================================================
   BUTTON MICRO-INTERACTIONS
   ============================================================================ */
.q-btn {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-fast) var(--ease-smooth);
}

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

.q-btn:active::before {
    width: 300px;
    height: 300px;
}

.q-btn-primary {
    position: relative;
}

.q-btn-primary::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #E63935, #EF5350, #B71C1C, #E63935);
    background-size: 300% 300%;
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--duration-fast);
    animation: gradientShift 3s ease infinite;
}

.q-btn-primary:hover::after {
    opacity: 1;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

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

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

/* ============================================================================
   CARD HOVER EFFECTS
   ============================================================================ */
.q-card-hover {
    transition: all var(--duration-medium) var(--ease-quantum);
}

.q-card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(230, 57, 53, 0.15);
}

/* Tilt effect on hover */
.q-tilt {
    transition: transform var(--duration-fast) var(--ease-smooth);
    transform-style: preserve-3d;
}

.q-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* ============================================================================
   ICON ANIMATIONS
   ============================================================================ */
.q-icon-bounce:hover svg {
    animation: iconBounce 0.5s var(--ease-bounce);
}

@keyframes iconBounce {

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

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

.q-icon-spin:hover svg {
    animation: iconSpin 0.6s var(--ease-smooth);
}

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

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

.q-icon-pulse:hover svg {
    animation: iconPulse 0.5s var(--ease-bounce);
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

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

.q-loading {
    position: relative;
    pointer-events: none;
}

.q-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--gc-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

/* ============================================================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================================================ */
.q-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all var(--duration-slow) var(--ease-quantum);
}

.q-reveal.q-visible {
    opacity: 1;
    transform: translateY(0);
}

.q-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all var(--duration-slow) var(--ease-quantum);
}

.q-reveal-left.q-visible {
    opacity: 1;
    transform: translateX(0);
}

.q-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all var(--duration-slow) var(--ease-quantum);
}

.q-reveal-right.q-visible {
    opacity: 1;
    transform: translateX(0);
}

.q-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all var(--duration-slow) var(--ease-bounce);
}

.q-reveal-scale.q-visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for children */
.q-stagger>*:nth-child(1) {
    transition-delay: 0.1s;
}

.q-stagger>*:nth-child(2) {
    transition-delay: 0.2s;
}

.q-stagger>*:nth-child(3) {
    transition-delay: 0.3s;
}

.q-stagger>*:nth-child(4) {
    transition-delay: 0.4s;
}

.q-stagger>*:nth-child(5) {
    transition-delay: 0.5s;
}

.q-stagger>*:nth-child(6) {
    transition-delay: 0.6s;
}

/* ============================================================================
   FOCUS STATES (Accessibility)
   ============================================================================ */
.q-btn:focus-visible,
.q-input:focus-visible,
.q-card:focus-visible,
a:focus-visible {
    outline: 2px solid var(--gc-primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(230, 57, 53, 0.2);
}

/* ============================================================================
   REDUCED MOTION PREFERENCE
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .q-animate-fade-up,
    .q-animate-fade-in,
    .q-animate-slide-left,
    .q-animate-slide-right,
    .q-animate-scale-in,
    .q-animate-pop-in,
    .q-reveal,
    .q-reveal-left,
    .q-reveal-right,
    .q-reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================================
   MAGNETIC BUTTON EFFECT (requires JS)
   ============================================================================ */
.q-magnetic {
    transition: transform var(--duration-fast) var(--ease-smooth);
}

/* ============================================================================
   TEXT GRADIENT ANIMATION
   ============================================================================ */
.q-text-gradient-animate {
    background: linear-gradient(90deg,
            #E63935,
            #EF5350,
            #FFFFFF,
            #EF5350,
            #E63935);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 4s linear infinite;
}

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

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

/* ============================================================================
   CURSOR EFFECTS
   ============================================================================ */
.q-cursor-glow {
    position: relative;
}

.q-cursor-glow::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(230, 57, 53, 0.15) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.q-cursor-glow:hover::before {
    opacity: 1;
}