/*
 * javired.com — Chatbot Widget CSS
 * Bottom-left floating widget with glassmorphism
 */

/* ─── Widget Container ───────────────────────────────────── */
.chatbot {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Trigger Button ─────────────────────────────────────── */
.chatbot__trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 20px rgba(124,58,237,0.35),
        0 0 0 0 rgba(124,58,237,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: chatbot-pulse 3s infinite;
}

.chatbot__trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(124,58,237,0.45);
}

@keyframes chatbot-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(124,58,237,0.35), 0 0 0 0 rgba(124,58,237,0.2); }
    50% { box-shadow: 0 4px 20px rgba(124,58,237,0.35), 0 0 0 8px rgba(124,58,237,0); }
}

/* ─── Chat Panel ─────────────────────────────────────────── */
.chatbot__panel {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: 380px;
    max-height: 520px;
    background: var(--bg-secondary, #111118);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.4),
        0 0 1px rgba(255,255,255,0.1);
    animation: chatbot-slide-up 0.3s ease;
}

@keyframes chatbot-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Header ─────────────────────────────────────────────── */
.chatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(168,85,247,0.08));
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.chatbot__header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.chatbot__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #e4e4e7);
}

.chatbot__status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-muted, #71717a);
}

.chatbot__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: status-blink 2s infinite;
}
@keyframes status-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.chatbot__close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-muted, #71717a);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.chatbot__close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ─── Messages ───────────────────────────────────────────── */
.chatbot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 300px;
}

.chatbot__message { display: flex; }

.chatbot__message--bot { justify-content: flex-start; }
.chatbot__message--user { justify-content: flex-end; }

.chatbot__bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
}

.chatbot__message--bot .chatbot__bubble {
    background: var(--bg-primary, #0a0a0f);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    color: var(--text-secondary, #a1a1aa);
    border-bottom-left-radius: 4px;
}

.chatbot__message--user .chatbot__bubble {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Message formatting */
.chatbot__bubble strong { color: var(--text-primary, #e4e4e7); font-weight: 600; }
.chatbot__bubble a { color: #a78bfa; text-decoration: underline; }

/* Typing indicator */
.chatbot__typing {
    display: flex;
    gap: 4px;
    padding: 6px 0;
}
.chatbot__typing span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted, #71717a);
    animation: typing-bounce 1.4s infinite;
}
.chatbot__typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot__typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* ─── Quick Replies ──────────────────────────────────────── */
.chatbot__quick-replies {
    display: flex;
    gap: 6px;
    padding: 8px 18px;
    overflow-x: auto;
    flex-shrink: 0;
}

.chatbot__quick-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    background: rgba(124,58,237,0.1);
    border: 1px solid rgba(124,58,237,0.3);
    border-radius: 20px;
    color: #a78bfa;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.chatbot__quick-btn:hover { background: rgba(124,58,237,0.2); border-color: rgba(124,58,237,0.5); }

/* ─── Input ──────────────────────────────────────────────── */
.chatbot__input-area {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    background: var(--bg-primary, rgba(0,0,0,0.3));
}

.chatbot__input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary, #111118);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 8px;
    color: var(--text-primary, #e4e4e7);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.chatbot__input:focus { border-color: #7c3aed; }
.chatbot__input::placeholder { color: var(--text-muted, #52525b); }

.chatbot__send {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}
.chatbot__send:hover { opacity: 0.85; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .chatbot { left: 0.75rem; bottom: 0.75rem; }

    .chatbot__panel {
        width: calc(100vw - 1.5rem);
        max-height: 70vh;
    }
}
