/* ══════════════════════════════════════════
   NEXO DIGITAL — Chatbot Widget Styles
   ══════════════════════════════════════════ */

#chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* ── Toggle Button ── */
#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
#chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(99, 102, 241, 0.5);
}
#chatbot-toggle.active {
    transform: scale(0.9) rotate(90deg);
    opacity: 0.7;
}
#chatbot-toggle .chat-icon,
#chatbot-toggle .close-icon {
    position: absolute;
    transition: all 0.3s ease;
}
#chatbot-toggle .close-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}
#chatbot-toggle.active .chat-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}
#chatbot-toggle.active .close-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ── Badge ── */
#chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}
#chatbot-badge.visible {
    opacity: 1;
    transform: scale(1);
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ── Chat Window ── */
#chatbot-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    height: 520px;
    border-radius: 20px;
    background: #0a0a1a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Header ── */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
}
.chatbot-header-info strong {
    display: block;
    font-size: 0.95rem;
    color: #f1f5f9;
}
.chatbot-status {
    font-size: 0.75rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}
.chatbot-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
#chatbot-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
#chatbot-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

/* ── Messages Area ── */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ── Message Bubbles ── */
.chatbot-msg {
    display: flex;
    animation: msgAppear 0.3s ease;
}
@keyframes msgAppear {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chatbot-msg-bot {
    justify-content: flex-start;
}
.chatbot-msg-user {
    justify-content: flex-end;
}
.chatbot-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.6;
}
.chatbot-msg-bot .chatbot-bubble {
    background: #12122b;
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.chatbot-msg-user .chatbot-bubble {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* ── Quick Replies ── */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    animation: msgAppear 0.3s ease;
}
.chatbot-quick-btn {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.08);
    color: #a5b4fc;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.chatbot-quick-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    transform: translateY(-1px);
}

/* ── Typing Indicator ── */
.typing-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 14px 20px !important;
}
.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Input Area ── */
.chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 10, 26, 0.8);
}
#chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #06060e;
    color: #f1f5f9;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s ease;
}
#chatbot-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
}
#chatbot-input::placeholder {
    color: #475569;
}
#chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
#chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    #chatbot-widget {
        bottom: 16px;
        right: 16px;
    }
    #chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 68px;
        right: -8px;
    }
}
