/**
 * DevRev PLuG Animated Launcher Styles
 * Adapted from snippets/customlauncher/css/plug-launcher.css
 */

/* ==========================================================================
   PLuG Ready Pulse Animation
   ========================================================================== */

@keyframes plug-ready-pulse {
    0%   { transform: scale(1);    box-shadow: 0 0 0 3px #10b981, 0 0 20px rgba(16, 185, 129, 0.6); }
    50%  { transform: scale(1.05); box-shadow: 0 0 0 6px #10b981, 0 0 30px rgba(16, 185, 129, 0.8); }
    100% { transform: scale(1);    box-shadow: 0 0 0 3px #10b981, 0 0 20px rgba(16, 185, 129, 0.6); }
}

/* ==========================================================================
   Main Launcher Button
   ========================================================================== */

.animated-plug-launcher {
    width: 80px;
    height: 80px;
    background: #FFFFFF;
    bottom: 30px;
    right: 30px;
    position: fixed;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 2px solid #e0e0e0;
    outline: none;
    overflow: hidden;
    padding: 0;
}

.animated-plug-launcher:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

.animated-plug-launcher:focus {
    outline: 3px solid #f97316;
    outline-offset: 2px;
}

.animated-plug-launcher:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Static Image / Icon
   ========================================================================== */

.plug-avatar-static {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    position: absolute;
    z-index: 10;
    pointer-events: none;
    top: 0;
    left: 0;
    opacity: 1;
    visibility: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plug-avatar-static.hidden {
    opacity: 0;
    visibility: hidden;
}

/* SVG icon fallback inside the button */
.plug-avatar-static svg {
    width: 36px;
    height: 36px;
}

/* ==========================================================================
   Sprite Sheet Animation Container
   ========================================================================== */

.plug-avatar-sprite {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 11;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    opacity: 1;
    visibility: visible;
}

.plug-avatar-sprite.hidden {
    opacity: 0;
    visibility: hidden;
}

.plug-avatar-sprite::before {
    content: '';
    position: relative;
    width: 7000%;
    height: 100%;
    background-image: url('../images/plug-idle.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

@keyframes spriteAnimation {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .animated-plug-launcher {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }
    .plug-avatar-static svg {
        width: 28px;
        height: 28px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .plug-avatar-sprite.animate::before { animation: none !important; }
    .animated-plug-launcher:hover  { transform: none; }
    .animated-plug-launcher:active { transform: none; }
}

/* ==========================================================================
   Hide default PLuG launcher (we use our own)
   ========================================================================== */

iframe[src*="plug-platform.devrev.ai"] + div,
div[data-devrev-plugin],
.devrev-plugin-launcher,
.plug-launcher-default {
    display: none !important;
}
