/**
 * KenyaTickets - Animations & Micro-interactions
 * Modern, playful but professional animations
 */

/* ===== Keyframe Animations ===== */
@keyframes breathing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@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);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 107, 53, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 53, 0.8); }
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dottedArrow {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 0;
    }
}

/* ===== Animation Classes ===== */
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.5s ease forwards;
}

.animate-bounce {
    animation: bounce 1s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.5s ease;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-slide-in-scale {
    animation: slideInScale 0.5s ease forwards;
}

/* ===== Breathing Icons ===== */
.breathing-icon {
    animation: breathing 3s ease-in-out infinite;
}

.breathing-icon:hover {
    animation-duration: 1s;
}

/* ===== Hover Effects ===== */
.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.2);
}

.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);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
}

.hover-brightness {
    transition: filter 0.3s ease;
}

.hover-brightness:hover {
    filter: brightness(1.1);
}

/* ===== Button Animations ===== */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-animate:hover::before {
    width: 300px;
    height: 300px;
}

.btn-animate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* ===== Card Animations ===== */
.card-animate {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.card-animate:hover::before {
    left: 100%;
}

.card-animate:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ===== Progress Indicators ===== */
.progress-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #E9ECEF;
    transition: all 0.3s ease;
    position: relative;
}

.progress-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.progress-dot.completed {
    background: var(--success-color);
}

.progress-dot.completed::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
}

/* ===== Dotted Arrow Background ===== */
.dotted-arrow-bg {
    position: relative;
    background-image: 
        linear-gradient(45deg, transparent 40%, var(--primary-color) 40%, var(--primary-color) 60%, transparent 60%),
        linear-gradient(45deg, transparent 40%, var(--primary-color) 40%, var(--primary-color) 60%, transparent 60%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    animation: dottedArrow 1s linear infinite;
    opacity: 0.1;
}

/* ===== Step Progress Animation ===== */
.step-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 3rem 0;
}

.step-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #E9ECEF;
    z-index: 1;
}

.step-progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    background: var(--primary-color);
    z-index: 2;
    transition: width 0.5s ease;
}

.step-item {
    position: relative;
    z-index: 3;
    text-align: center;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #E9ECEF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    transition: all 0.3s ease;
}

.step-item.active .step-icon {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    animation: pulse 2s infinite;
}

.step-item.completed .step-icon {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.step-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-color);
    transition: color 0.3s ease;
}

.step-item.active .step-title,
.step-item.completed .step-title {
    color: var(--dark-color);
}

/* ===== Loading Animations ===== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #E9ECEF;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

.loading-pulse {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: pulse 2s infinite;
}

/* ===== Success/Error Animations ===== */
.success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: slideInScale 0.5s ease;
}

.success-checkmark::after {
    content: '✓';
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.error-cross {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--danger-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: shake 0.5s ease;
}

.error-cross::after {
    content: '✕';
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

/* ===== Scroll Animations ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.scroll-animate-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease;
}

.scroll-animate-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Notification Animations ===== */
.notification-slide {
    animation: slideInDown 0.3s ease;
}

.notification-fade {
    animation: fadeIn 0.3s ease;
}

.notification-bounce {
    animation: bounce 0.5s ease;
}

/* ===== Form Field Animations ===== */
.form-field-animate {
    position: relative;
}

.form-field-animate .form-control {
    transition: all 0.3s ease;
}

.form-field-animate .form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

.form-field-animate .form-label {
    transition: all 0.3s ease;
}

.form-field-animate:focus-within .form-label {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== Image Hover Effects ===== */
.img-zoom {
    overflow: hidden;
    transition: all 0.3s ease;
}

.img-zoom img {
    transition: transform 0.3s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

.img-overlay {
    position: relative;
    overflow: hidden;
}

.img-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-overlay:hover::before {
    opacity: 1;
}

.img-overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-overlay:hover .img-overlay-content {
    opacity: 1;
}

/* ===== Responsive Animations ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 768px) {
    .hover-lift:hover {
        transform: translateY(-3px);
    }
    
    .card-animate:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .btn-animate:hover {
        transform: translateY(-1px);
    }
}

/* ===== Performance Optimizations ===== */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}
