/* Shared AI Floating Widget Styles */

.ai-float-btn {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    animation: aiFloat 3s ease-in-out infinite;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ai-float-btn:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.ai-theme-customer,
.ai-theme-public {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ai-theme-vendor {
    background: linear-gradient(135deg, #10b981, #059669);
}

.ai-theme-admin {
    background: linear-gradient(135deg, #2563eb, #111827);
}

.ai-pulse-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(245, 158, 11, 0.45);
    animation: aiPulse 1.8s ease-out infinite;
}

.ai-theme-vendor .ai-pulse-ring {
    border-color: rgba(16, 185, 129, 0.45);
}

.ai-theme-admin .ai-pulse-ring {
    border-color: rgba(37, 99, 235, 0.45);
}

.ai-glow {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 65%);
    animation: aiGlow 2.4s ease-in-out infinite;
}

.ai-icon-core {
    position: relative;
    color: #fff;
    font-size: 26px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-badge {
    position: absolute;
    top: -18px;
    right: -22px;
    background: #111827;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    border: 2px solid #fff;
}

.ai-orbit-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.9;
    z-index: 3;
}

.ai-dot-one {
    top: 10px;
    left: 12px;
    animation: aiBlink 1.2s infinite;
}

.ai-dot-two {
    bottom: 12px;
    right: 13px;
    animation: aiBlink 1.2s 0.4s infinite;
}

.ai-tooltip-text {
    position: absolute;
    right: 78px;
    bottom: 14px;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    padding: 9px 12px;
    border-radius: 10px;
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: 0.25s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.ai-tooltip-text::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 6px solid #111827;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.ai-float-btn:hover .ai-tooltip-text {
    opacity: 1;
    transform: translateX(0);
}

/* Chat Box Header Gradient Styles */
.ai-header-customer,
.ai-header-public {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.ai-header-vendor {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.ai-header-admin {
    background: linear-gradient(135deg, #2563eb 0%, #111827 100%) !important;
}

/* Base Chat Box overrides to fit layout safely */
.public-ai-box,
.customer-ai-box,
.vendor-ai-box,
.admin-ai-box {
    position: fixed;
    bottom: 104px;
    right: 28px;
    width: 360px;
    max-height: 480px;
    border-radius: 16px !important;
    z-index: 99998;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    transform-origin: bottom right;
}

.public-ai-box.hidden,
.customer-ai-box.hidden,
.vendor-ai-box.hidden,
.admin-ai-box.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    visibility: hidden;
    pointer-events: none;
}

@keyframes aiFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-9px);
    }
}

@keyframes aiPulse {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes aiGlow {
    0%, 100% {
        opacity: 0.45;
    }
    50% {
        opacity: 0.9;
    }
}

@keyframes aiBlink {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.25);
    }
}

@media (max-width: 576px) {
    .ai-float-btn {
        width: 58px;
        height: 58px;
        right: 18px;
        bottom: 18px;
    }
    .ai-tooltip-text {
        display: none;
    }
    .public-ai-box,
    .customer-ai-box,
    .vendor-ai-box,
    .admin-ai-box {
        width: 92%;
        right: 4%;
        bottom: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-float-btn,
    .ai-pulse-ring,
    .ai-glow,
    .ai-orbit-dot {
        animation: none !important;
    }
}
