/* ===========================
   FAB CONTAINER
   =========================== */
.fab-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.fab-container .whatsapp-fab {
    position: static;
}

.fab-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 20, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #f0f0f8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(10px);
}

.whatsapp-fab:hover .fab-tooltip,
.ai-fab:hover .fab-tooltip {
    opacity: 1;
}

/* ===========================
   AI FAB BUTTON
   =========================== */
.ai-fab {
    position: relative;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-fab:hover {
    transform: scale(1.12) translateY(-3px);
    box-shadow: 0 8px 35px rgba(255, 107, 53, 0.7);
}

.ai-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 53, 0.45);
    animation: waPulse 2.2s ease-in-out infinite;
}

.ai-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================
   AI CHAT WINDOW
   =========================== */
.ai-chat-window {
    position: fixed;
    bottom: 108px;
    right: 28px;
    width: 360px;
    max-height: 520px;
    background: #0d0d18;
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 8999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 107, 53, 0.08);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.ai-chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.ai-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 215, 0, 0.05));
    border-bottom: 1px solid rgba(255, 107, 53, 0.15);
    flex-shrink: 0;
}

.ai-chat-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    flex-shrink: 0;
}

.ai-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #28c864;
    border: 2px solid #0d0d18;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(40, 200, 100, 0.5);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(40, 200, 100, 0);
    }
}

.ai-chat-info {
    flex: 1;
    min-width: 0;
}

.ai-chat-name {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0f0f8;
}

.ai-chat-status {
    display: block;
    font-size: 0.72rem;
    color: #28c864;
    font-weight: 500;
}

.ai-chat-close {
    background: none;
    border: none;
    color: #55556a;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-chat-close:hover {
    color: #f0f0f8;
    background: rgba(255, 255, 255, 0.06);
}

/* Messages area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

/* Message bubbles */
.msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.msg-row.user {
    flex-direction: row-reverse;
}

.msg-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}

.msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}

.msg-row.bot .msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #f0f0f8;
    border-bottom-left-radius: 6px;
}

.msg-row.user .msg-bubble {
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    color: #000;
    font-weight: 600;
    border-bottom-right-radius: 6px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    width: fit-content;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #55556a;
    border-radius: 50%;
    animation: typingDot 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Quick replies */
.ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.ai-chip {
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.25);
    color: #FF6B35;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ai-chip:hover {
    background: rgba(255, 107, 53, 0.18);
    border-color: rgba(255, 107, 53, 0.5);
    transform: translateY(-1px);
}

/* Input row */
.ai-chat-input-row {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    padding: 10px 16px;
    color: #f0f0f8;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.ai-chat-input:focus {
    border-color: rgba(255, 107, 53, 0.4);
    background: rgba(255, 107, 53, 0.04);
}

.ai-chat-input::placeholder {
    color: #55556a;
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.ai-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

/* Mobile */
@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 100px;
        max-height: 450px;
    }

    .fab-container {
        right: 16px;
        bottom: 20px;
    }
}