/* ========================================
   ADVANCED ANIMATIONS & EFFECTS
   Efectos glassmorphism y animaciones fluidas
======================================== */

/* ========================================
   AOS (Animate On Scroll) Custom Styles
======================================== */

[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}

[data-aos="fade-up"] {
    transform: translate3d(0, 50px, 0);
    opacity: 0;
}

[data-aos="fade-up"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

[data-aos="fade-left"] {
    transform: translate3d(50px, 0, 0);
    opacity: 0;
}

[data-aos="fade-left"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

[data-aos="fade-right"] {
    transform: translate3d(-50px, 0, 0);
    opacity: 0;
}

[data-aos="fade-right"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

/* ========================================
   GLASSMORPHISM EFFECTS
======================================== */

.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-card-dark {
    background: rgba(26, 69, 72, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(26, 69, 72, 0.2);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(26, 69, 72, 0.1);
}

.glass-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ========================================
   FLOATING TAXI ANIMATIONS
======================================== */

.floating-taxi {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    color: rgba(230, 166, 13, 0.6);
    z-index: 1;
    transition: all 0.3s ease;
}

.floating-taxi:hover {
    color: rgba(230, 166, 13, 0.9);
    transform: scale(1.1);
}

/* Taxi driving from left to right */
@keyframes taxiDriveRight {
    0% {
        left: -5%;
        opacity: 0;
        transform: translateY(0px) scaleX(1);
    }
    10% {
        opacity: 0.6;
    }
    20% {
        transform: translateY(-5px) scaleX(1);
    }
    40% {
        transform: translateY(5px) scaleX(1);
    }
    60% {
        transform: translateY(-3px) scaleX(1);
    }
    80% {
        transform: translateY(2px) scaleX(1);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        left: 105%;
        opacity: 0;
        transform: translateY(0px) scaleX(1);
    }
}

/* Taxi driving from right to left */
@keyframes taxiDriveLeft {
    0% {
        left: 105%;
        opacity: 0;
        transform: translateY(0px) scaleX(-1);
    }
    10% {
        opacity: 0.6;
    }
    20% {
        transform: translateY(-5px) scaleX(-1);
    }
    40% {
        transform: translateY(5px) scaleX(-1);
    }
    60% {
        transform: translateY(-3px) scaleX(-1);
    }
    80% {
        transform: translateY(2px) scaleX(-1);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        left: -5%;
        opacity: 0;
        transform: translateY(0px) scaleX(-1);
    }
}

/* Special effects for taxi variations */
.floating-taxi:nth-child(odd) {
    animation-delay: 2s;
}

.floating-taxi:nth-child(even) {
    color: rgba(244, 196, 48, 0.6);
}

.floating-taxi:nth-child(3n) {
    font-size: 1.2rem;
    color: rgba(230, 166, 13, 0.8);
}

.floating-taxi:nth-child(4n) {
    font-size: 1.8rem;
    animation-duration: 12s;
}

/* Hover effect for better interactivity */
.hero-section:hover .floating-taxi {
    animation-play-state: paused;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .floating-taxi {
        font-size: 1rem;
    }
    
    .floating-taxi:nth-child(4n) {
        font-size: 1.3rem;
    }
}

/* ========================================
   ADVANCED HOVER EFFECTS
======================================== */

.hover-lift {
    transition: all var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    position: relative;
    transition: all var(--transition-normal);
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-accent);
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.hover-glow:hover::before {
    opacity: 0.7;
}

.hover-glow:hover {
    transform: scale(1.02);
}

/* ========================================
   BACKGROUND TAXI ANIMATIONS
======================================== */

.floating-background-taxi {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.floating-hero-taxi {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

/* Background taxis (slower, more subtle) */
@keyframes backgroundTaxiRight {
    0% {
        left: -10%;
        opacity: 0;
        transform: translateY(0px) scaleX(1);
    }
    5% {
        opacity: 0.4;
    }
    15% {
        transform: translateY(-3px) scaleX(1);
    }
    30% {
        transform: translateY(3px) scaleX(1);
    }
    45% {
        transform: translateY(-2px) scaleX(1);
    }
    60% {
        transform: translateY(2px) scaleX(1);
    }
    75% {
        transform: translateY(-1px) scaleX(1);
    }
    95% {
        opacity: 0.4;
    }
    100% {
        left: 110%;
        opacity: 0;
        transform: translateY(0px) scaleX(1);
    }
}

@keyframes backgroundTaxiLeft {
    0% {
        left: 110%;
        opacity: 0;
        transform: translateY(0px) scaleX(-1);
    }
    5% {
        opacity: 0.4;
    }
    15% {
        transform: translateY(-3px) scaleX(-1);
    }
    30% {
        transform: translateY(3px) scaleX(-1);
    }
    45% {
        transform: translateY(-2px) scaleX(-1);
    }
    60% {
        transform: translateY(2px) scaleX(-1);
    }
    75% {
        transform: translateY(-1px) scaleX(-1);
    }
    95% {
        opacity: 0.4;
    }
    100% {
        left: -10%;
        opacity: 0;
        transform: translateY(0px) scaleX(-1);
    }
}

/* Hero taxis (more visible, faster) */
@keyframes heroTaxiRight {
    0% {
        left: -8%;
        opacity: 0;
        transform: translateY(0px) scaleX(1);
    }
    8% {
        opacity: 0.6;
    }
    20% {
        transform: translateY(-6px) scaleX(1);
    }
    40% {
        transform: translateY(6px) scaleX(1);
    }
    60% {
        transform: translateY(-4px) scaleX(1);
    }
    80% {
        transform: translateY(3px) scaleX(1);
    }
    92% {
        opacity: 0.6;
    }
    100% {
        left: 108%;
        opacity: 0;
        transform: translateY(0px) scaleX(1);
    }
}

@keyframes heroTaxiLeft {
    0% {
        left: 108%;
        opacity: 0;
        transform: translateY(0px) scaleX(-1);
    }
    8% {
        opacity: 0.6;
    }
    20% {
        transform: translateY(-6px) scaleX(-1);
    }
    40% {
        transform: translateY(6px) scaleX(-1);
    }
    60% {
        transform: translateY(-4px) scaleX(-1);
    }
    80% {
        transform: translateY(3px) scaleX(-1);
    }
    92% {
        opacity: 0.6;
    }
    100% {
        left: -8%;
        opacity: 0;
        transform: translateY(0px) scaleX(-1);
    }
}

/* Hover effects */
.hero-section:hover .floating-background-taxi,
.hero-section:hover .floating-hero-taxi {
    animation-play-state: paused;
}

/* Different taxi variations */
.floating-background-taxi:nth-child(odd) {
    color: rgba(244, 196, 48, 0.3);
}

.floating-hero-taxi:nth-child(even) {
    color: rgba(230, 166, 13, 0.8);
}

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

.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--accent-cyan);
    white-space: nowrap;
    animation: typewriter 4s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--accent-cyan);
    }
}

/* ========================================
   LOADING ANIMATIONS
======================================== */

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots div {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: loading-dot 1.4s ease-in-out infinite both;
}

.loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.loading-dots div:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-dot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 208, 132, 0.3);
    border-top: 4px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   CARD FLIP ANIMATIONS
======================================== */

.flip-card {
    background-color: transparent;
    perspective: 1000px;
    height: 300px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: var(--spacing-lg);
}

.flip-card-front {
    background: var(--gradient-primary);
    color: var(--white);
}

.flip-card-back {
    background: var(--gradient-accent);
    color: var(--white);
    transform: rotateY(180deg);
}

/* ========================================
   PROGRESS ANIMATIONS
======================================== */

.progress-ring {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 0.5s ease-in-out;
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(0, 208, 132, 0.2);
    stroke-width: 8;
}

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

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

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

.btn-pulse {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 208, 132, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 208, 132, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 208, 132, 0);
    }
}

.btn-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-2deg); }
    75% { transform: translateX(5px) rotate(2deg); }
}

.btn-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-25px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* ========================================
   RIPPLE EFFECT
======================================== */

.ripple {
    position: relative;
    overflow: hidden;
}

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

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   SMOOTH SCROLLBAR
======================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-grey);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* ========================================
   ZOOM EFFECTS
======================================== */

.zoom-in {
    transition: transform var(--transition-normal);
}

.zoom-in:hover {
    transform: scale(1.05);
}

.zoom-out {
    transition: transform var(--transition-normal);
}

.zoom-out:hover {
    transform: scale(0.95);
}

/* ========================================
   GRADIENT ANIMATIONS
======================================== */

.animated-gradient {
    background: linear-gradient(-45deg, #1a4548, #2a5558, #0693e3, #00d084);
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

.slide-in-left {
    transform: translateX(-100%);
    transition: transform 0.5s ease-out;
}

.slide-in-left.active {
    transform: translateX(0);
}

.slide-in-right {
    transform: translateX(100%);
    transition: transform 0.5s ease-out;
}

.slide-in-right.active {
    transform: translateX(0);
}

.slide-in-up {
    transform: translateY(100%);
    transition: transform 0.5s ease-out;
}

.slide-in-up.active {
    transform: translateY(0);
}

.slide-in-down {
    transform: translateY(-100%);
    transition: transform 0.5s ease-out;
}

.slide-in-down.active {
    transform: translateY(0);
}

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

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

/* ========================================
   MOBILE OPTIMIZED ANIMATIONS
======================================== */

@media (max-width: 768px) {
    .particle {
        display: none;
    }
    
    .morphing-bg {
        animation-duration: 15s;
    }
    
    .hover-lift:hover {
        transform: translateY(-5px);
    }
    
    .flip-card:hover .flip-card-inner {
        transform: none;
    }
    
    .flip-card:active .flip-card-inner {
        transform: rotateY(180deg);
    }
}