/* ============================================================
   CHATBOT WIDGET STYLES — FUTURISTIC GLASS EDITION
   ============================================================ */

/* ── Trigger button ──────────────────────────────────────── */
.chatbot-trigger {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: var(--gradient-primary, linear-gradient(135deg, #00f0ff 0%, #7000ff 100%));
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.chatbot-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.7);
}

.trigger-pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--color-cyan, #00f0ff);
    animation: ringPulse 2.5s infinite ease-out;
    pointer-events: none;
}
.trigger-pulse-ring.delay {
    animation-delay: 1.25s;
}

@keyframes ringPulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

.chatbot-trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Unread badge */
.chatbot-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    background: #f43f5e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px #f43f5e;
    border: 2px solid #050811;
}

/* ── Panel ───────────────────────────────────────────────── */
.chatbot-panel {
    position: fixed;
    bottom: 6.5rem;
    right: 2rem;
    z-index: 999;
    width: 23.5rem;
    max-width: calc(100vw - 2.5rem);
    height: 34rem;
    max-height: calc(100vh - 8rem);
    background: rgba(11, 16, 33, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 240, 255, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(1.5rem) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-panel--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── Header ──────────────────────────────────────────────── */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(112, 0, 255, 0.2) 100%);
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gradient-primary, #00f0ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.chatbot-header-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.chatbot-header-status {
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono, monospace);
}

.chatbot-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.chatbot-close-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-close-btn:hover {
    background: rgba(244, 63, 94, 0.3);
    border-color: #f43f5e;
    color: #fff;
}

/* ── Messages Thread ─────────────────────────────────────── */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar { width: 5px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.2); border-radius: 3px; }

.chat-bubble {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: bubbleSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bubbleSlide {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble--bot  { align-self: flex-start; }
.chat-bubble--user { align-self: flex-end;   }

.chat-text {
    display: inline-block;
    padding: 0.75rem 1rem;
    border-radius: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    word-break: break-word;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.chat-bubble--bot .chat-text {
    background: rgba(20, 29, 54, 0.9);
    color: #f1f5f9;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble--user .chat-text {
    background: linear-gradient(135deg, #00f0ff 0%, #3b82f6 100%);
    color: #050811;
    font-weight: 600;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble--bot .chat-text a { color: #00f0ff; text-decoration: underline; }
.chat-bubble--user .chat-text a { color: #000; text-decoration: underline; }

.chat-time {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 0.3rem;
    padding: 0 0.25rem;
    font-family: var(--font-mono, monospace);
}
.chat-bubble--user .chat-time { text-align: right; }

/* Typing indicator */
.chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    background: rgba(20, 29, 54, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 1.1rem;
    border-bottom-left-radius: 0.25rem;
}

.chat-typing span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #00f0ff;
    animation: typingPulse 1.2s infinite ease-in-out;
}

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

@keyframes typingPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%            { transform: scale(1.1); opacity: 1; }
}

/* ── Quick replies ───────────────────────────────────────── */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid rgba(0, 240, 255, 0.12);
    background: rgba(5, 8, 17, 0.5);
    flex-shrink: 0;
}

.quick-reply-btn {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #00f0ff;
    border-radius: 1rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: #00f0ff;
    color: #050811;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

/* ── Input bar ───────────────────────────────────────────── */
.chatbot-input-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    flex-shrink: 0;
    background: rgba(5, 8, 17, 0.85);
}

.chatbot-input {
    flex: 1;
    background: rgba(20, 29, 54, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 1.5rem;
    padding: 0.6rem 1rem;
    color: #f1f5f9;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.chatbot-input::placeholder { color: #64748b; }
.chatbot-input:focus {
    border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.chatbot-send-btn {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--gradient-accent, #00f0ff);
    color: #050811;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.chatbot-send-btn:hover { transform: scale(1.1); box-shadow: 0 0 18px rgba(0, 240, 255, 0.6); }
.chatbot-send-btn:active { transform: scale(0.95); }

/* Mobile */
@media (max-width: 480px) {
    .chatbot-panel {
        bottom: 0; right: 0; left: 0;
        width: 100%; max-width: 100%;
        max-height: 88vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    .chatbot-trigger { bottom: 1.25rem; right: 1.25rem; }
}
