/* ============================================
   CHATBOT WIDGET — Lone Star True Custom Rigs
   ============================================ */

/* Floating Action Button */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #BF0A30, #8b0020);
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(191,10,48,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(191,10,48,0.5);
}
.chat-fab-icon, .chat-fab-close { color: #fff; transition: all 0.3s ease; }
.chat-fab-close { display: none; }
.chat-widget.open .chat-fab-icon { display: none; }
.chat-widget.open .chat-fab-close { display: block; }

/* Ping notification dot */
.chat-fab-ping {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #D4AF37;
    border: 2px solid #0a0a0f;
    display: none;
}
.chat-fab-ping.show { display: block; animation: chatPingPulse 2s infinite; }
@keyframes chatPingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.5); }
    50% { box-shadow: 0 0 0 8px rgba(212,175,55,0); }
}

/* Chat Window */
.chat-window {
    position: fixed;
    top: 80px;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 420px;
    background: #0c0c14;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(191,10,48,0.1);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-widget.open .chat-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #12121c, #1a1a2a);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #BF0A30, #8b0020);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D4AF37;
    font-size: 1rem;
}
.chat-header-name {
    font-family: var(--font-heading, 'Rajdhani', sans-serif);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: #fff;
}
.chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #76B900;
}
.chat-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #76B900;
    display: inline-block;
}
.chat-header-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}
.chat-header-close:hover { color: #fff; }

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

/* Message Bubbles */
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}
.chat-msg.visible {
    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: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #BF0A30, #8b0020);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D4AF37;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.chat-msg-bubble {
    max-width: 260px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.55;
}
.chat-msg-bot .chat-msg-bubble {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.88);
    border-bottom-left-radius: 4px;
}
.chat-msg-user .chat-msg-bubble {
    background: linear-gradient(135deg, #BF0A30, #8b0020);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    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); }
    30% { transform: translateY(-6px); }
}

/* Quick Replies */
.chat-input-area {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(12,12,20,0.95);
}
.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chat-qr-btn {
    padding: 8px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    font-family: var(--font-heading, 'Rajdhani', sans-serif);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.chat-qr-btn:hover {
    background: rgba(191,10,48,0.15);
    border-color: rgba(191,10,48,0.4);
    color: #fff;
    transform: translateY(-1px);
}

/* Text Input */
.chat-text-input {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.chat-text-input input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    color: #fff;
    font-family: var(--font-heading, 'Rajdhani', sans-serif);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}
.chat-text-input input::placeholder {
    color: rgba(255,255,255,0.3);
}
.chat-text-input input:focus {
    border-color: rgba(191,10,48,0.5);
}
.chat-text-input button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #BF0A30, #8b0020);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.chat-text-input button:hover {
    background: linear-gradient(135deg, #d41040, #BF0A30);
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 0;
    }
    .chat-fab {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
}
