/* animations.css - Premium animations for NexusAI Assistant */

/* =========================
   Global Animation Effects
   ========================= */

/* Gradient Animation - For premium gradient backgrounds */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(270deg, #8A2BE2, #4B0082, #00CED1);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Subtle hover lift effect for cards and clickable elements */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Glow effect for premium elements */
.premium-glow {
    transition: box-shadow 0.3s ease;
}

.premium-glow:hover {
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
}

/* =========================
   Page Transition Effects
   ========================= */

/* Fade In for page elements */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Sequential fade in for lists */
.stagger-fade-in > * {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.6s; }

/* Slide transitions */
@keyframes slideInRight {
    from { 
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* =========================
   Button Animations
   ========================= */

/* Pulse effect for call-to-action buttons */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(138, 43, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Button click effect */
@keyframes buttonClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.btn-click {
    animation: buttonClick 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =========================
   AI Chat Animations
   ========================= */

/* Typing animation */
.typing-animation::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Wave animation for voice input */
@keyframes wave {
    0%, 100% { 
        height: 5px; 
    }
    50% { 
        height: 20px; 
    }
}

.wave-bar {
    width: 3px;
    background-color: #8A2BE2;
    margin: 0 2px;
    border-radius: 3px;
    animation: wave 0.5s infinite;
}

.wave-visualizer {
    display: flex;
    align-items: center;
    height: 30px;
}

.wave-bar:nth-child(1) { animation-delay: 0.0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; }
.wave-bar:nth-child(5) { animation-delay: 0.0s; }

/* Message bubble appear animation */
@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bubble-appear {
    animation: bubbleAppear 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

/* =========================
   Loading & Progress Animations
   ========================= */

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

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top: 3px solid #8A2BE2;
    animation: spin 1s linear infinite;
}

/* Progress bar animation */
@keyframes progressFill {
    0% { width: 0; }
    100% { width: 100%; }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8A2BE2, #00CED1);
    border-radius: 3px;
    animation: progressFill 2.5s ease-out forwards;
}

/* =========================
   Special UI Effects
   ========================= */

/* Floating animation for premium elements */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

.floating {
    animation: float 4s ease-in-out infinite;
}

/* Shimmer effect for skeleton loaders */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-loader {
    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: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

/* Ripple effect for buttons and interactive elements */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(138, 43, 226, 0.5);
    animation: ripple 0.6s ease-out;
    transform: scale(0);
    pointer-events: none;
}

/* Blur-in effect for modals */
@keyframes blurIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.modal-backdrop {
    animation: blurIn 0.3s ease-out forwards;
}

/* Modal content animation */
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content {
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* =========================
   Tab Bar Animation
   ========================= */

/* Tab indicator slide */
@keyframes tabSlide {
    from { transform: translateX(var(--from-pos)); }
    to { transform: translateX(var(--to-pos)); }
}

.tab-indicator {
    background: linear-gradient(145deg, #8A2BE2, #4B0082);
    height: 3px;
    position: absolute;
    bottom: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Tab item active transition */
.tab-bar-item {
    transition: color 0.3s ease, transform 0.2s ease;
}

.tab-bar-item.active {
    transform: translateY(-3px);
}

/* Tab pulse animation */
@keyframes tabPulse {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.tab-pulse {
    width: 20px;
    height: 20px;
    background: rgba(138, 43, 226, 0.3);
    border-radius: 50%;
    position: absolute;
    z-index: -1;
    animation: tabPulse 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* AI Mode Change Animation */
@keyframes modeChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: #00CED1;
    }
    100% {
        transform: scale(1);
    }
}

.mode-change {
    animation: modeChange 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================
   Device and Responsive Animations
   ========================= */

/* Active device highlight */
@keyframes deviceActivate {
    0% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.5);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(138, 43, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0);
    }
}

.active-device {
    animation: deviceActivate 0.3s ease-out;
}

/* Responsive content adjusting */
@keyframes contentExpand {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

.content-expand {
    animation: contentExpand 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    overflow: hidden;
}

/* =========================
   Utility Animation Classes
   ========================= */

/* Delay classes */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Duration classes */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }

/* Custom cubic bezier easing for premium feel */
.premium-ease {
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.smooth-ease {
    transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Animation trigger classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}