/* ═══════════════════════════════════════════════════════════
   CHATBOT WIDGET — Floating Chat
   ═══════════════════════════════════════════════════════════ */

/* ═══ FAB BUTTON ═══ */
.chatbot-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 5000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d7ff 0%, #00e676 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0, 215, 255, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(0, 215, 255, 0.5);
}

.chatbot-fab .fab-icon {
    font-size: 1.6rem;
    transition: transform 0.3s ease;
}

.chatbot-fab.active .fab-icon {
    transform: rotate(90deg);
}

/* ═══ NOTIFICATION BADGE ═══ */
.chatbot-fab .fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #ff4757;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--bg-primary, #0a0a0f);
}

/* ═══ CHAT PANEL ═══ */
.chatbot-panel {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 28px;
    z-index: 5000;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 540px;
    max-height: calc(100vh - 140px);
    background: #16161e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    animation: chatSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-panel.active {
    display: flex;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ HEADER ═══ */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 215, 255, 0.08) 0%, rgba(0, 230, 118, 0.04) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d7ff, #00e676);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chatbot-header-text h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f0f0f5;
    margin: 0;
}

.chatbot-header-text span {
    font-size: 0.72rem;
    color: #00e676;
    font-weight: 500;
}

.chatbot-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #6c6c85;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 71, 87, 0.12);
    color: #ff4757;
}

/* ═══ MESSAGES AREA ═══ */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }

/* ═══ MESSAGE BUBBLES ═══ */
.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: msgFadeIn 0.25s ease;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-msg.bot .chat-msg-avatar {
    background: linear-gradient(135deg, #00d7ff, #00e676);
}

.chat-msg.user .chat-msg-avatar {
    background: rgba(255, 255, 255, 0.1);
}

.chat-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-msg.bot .chat-msg-bubble {
    background: #1c1c28;
    color: #a0a0b8;
    border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-msg-bubble {
    background: linear-gradient(135deg, rgba(0, 215, 255, 0.15), rgba(0, 230, 118, 0.1));
    color: #f0f0f5;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot .chat-msg-bubble p { margin: 0 0 8px; }
.chat-msg.bot .chat-msg-bubble p:last-child { margin-bottom: 0; }
.chat-msg.bot .chat-msg-bubble ul { margin: 4px 0 8px; padding-left: 18px; }
.chat-msg.bot .chat-msg-bubble ul:last-child { margin-bottom: 0; }
.chat-msg.bot .chat-msg-bubble li { margin: 2px 0; }
.chat-msg.bot .chat-msg-bubble strong { color: #f0f0f5; font-weight: 600; }
.chat-msg.bot .chat-msg-bubble a { color: #00d7ff; text-decoration: underline; word-break: break-all; }
.chat-msg.bot .chat-msg-bubble a:hover { color: #00e676; }

/* ═══ TYPING INDICATOR ═══ */
.chat-typing {
    display: none;
    align-self: flex-start;
    gap: 10px;
    max-width: 88%;
}

.chat-typing.active {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    background: #1c1c28;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: #6c6c85;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ═══ INPUT AREA ═══ */
.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #111118;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    background: #16161e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #f0f0f5;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    min-height: 44px;
    max-height: 80px;
}

.chatbot-input::placeholder {
    color: #6c6c85;
}

.chatbot-input:focus {
    border-color: rgba(0, 215, 255, 0.3);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00d7ff, #00e676);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(0, 215, 255, 0.3);
}

.chatbot-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: #0a0a0f;
}

/* ═══ DISCLAIMER ═══ */
.chatbot-disclaimer {
    text-align: center;
    padding: 8px 16px 4px;
    font-size: 0.65rem;
    color: #6c6c85;
    background: #111118;
    flex-shrink: 0;
}

/* ═══ WELCOME MESSAGE ═══ */
.chat-welcome {
    text-align: center;
    padding: 20px 12px;
}

.chat-welcome-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.chat-welcome h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0f0f5;
    margin: 0 0 6px;
}

.chat-welcome p {
    font-size: 0.8rem;
    color: #6c6c85;
    margin: 0 0 16px;
    line-height: 1.5;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-height: 120px;
    overflow-y: auto;
}

.chat-suggestions::-webkit-scrollbar { width: 3px; }
.chat-suggestions::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.chat-suggestion {
    padding: 7px 14px;
    background: rgba(0, 215, 255, 0.06);
    border: 1px solid rgba(0, 215, 255, 0.12);
    border-radius: 20px;
    color: #00d7ff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.chat-suggestion:hover {
    background: rgba(0, 215, 255, 0.12);
    border-color: rgba(0, 215, 255, 0.25);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
    .chatbot-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .chatbot-fab {
        bottom: 20px;
        right: 20px;
    }
}
