/**
 * Animation and Chat Widget Fixes
 * Fixes issues with product animations and chat widget functionality
 */

/* Product Animation Fixes */
.animated-placeholder {
    position: relative;
    min-height: 300px;
    background-color: rgba(31, 41, 55, 0.4);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.animated-placeholder .animation-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
    z-index: 0;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
}

.animated-placeholder[data-product="operator"] .animation-background {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.15) 0%, rgba(0, 0, 0, 0) 100%);
}

.animated-placeholder[data-product="agent"] .animation-background {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(0, 0, 0, 0) 100%);
}

.animated-placeholder[data-product="content-board"] .animation-background {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(0, 0, 0, 0) 100%);
}

.animated-placeholder[data-product="model-studio"] .animation-background {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Animation Elements */
.animation-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    max-width: 100%;
    max-height: 100%;
}

.animation-element.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Fix loading text */
.animated-placeholder .loading-text {
    display: none !important;
}

/* Chat Widget Burger Menu Fixes */
.vg-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c63ff 0%, #00bfa6 100%);
    border: none;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.vg-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.vg-chat-button-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vg-logo-container {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background-color: white;
    box-shadow: 0 0 12px rgba(108, 99, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.vg-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vg-chat-button.active .vg-logo-container,
.vg-chat-button.vg-active .vg-logo-container {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Hide burger menu by default - only show on hover/active */
.vg-burger-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.vg-chat-button.active .vg-burger-menu,
.vg-chat-button.vg-active .vg-burger-menu {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.burger-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

.burger-line-1 {
    top: 0;
}

.burger-line-2 {
    top: 6px;
}

.burger-line-3 {
    top: 12px;
}

.vg-chat-button.active .burger-line-1 {
    transform: translateY(6px) rotate(45deg);
}

.vg-chat-button.active .burger-line-2 {
    opacity: 0;
}

.vg-chat-button.active .burger-line-3 {
    transform: translateY(-6px) rotate(-45deg);
}

/* Tooltip Fix */
.vg-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color, #6c63ff);
    color: white;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    visibility: visible;
}

.vg-chat-button:hover .vg-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Add pulse animation to make button more noticeable */
.vg-chat-button {
    box-shadow: 0 0 0 rgba(108, 99, 255, 0.4);
    animation: pulse-shadow 2s infinite;
}

@keyframes pulse-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(108, 99, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(108, 99, 255, 0);
    }
}

/* Chat Widget Container Fixes */
.vg-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: rgba(31, 41, 55, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform-origin: bottom right;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vg-chat-widget.vg-active {
    opacity: 1;
    transform: scale(1);
}

.vg-chat-widget.vg-closing {
    opacity: 0;
    transform: scale(0.95);
}

/* Fix for mobile */
@media (max-width: 767px) {
    .vg-chat-widget {
        width: calc(100% - 40px);
        height: 480px;
        bottom: 80px;
    }
}
