/* ========================================
   LUXCAB AI CHAT WIDGET STYLING
   ======================================== */

/* Trigger Button */
#ai-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: 2px solid var(--highlight);
    padding: 12px 24px;
    border-radius: 100px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(233, 69, 96, 0.25), 0 0 15px rgba(26, 26, 46, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#ai-chat-btn i {
    font-size: 16px;
    color: var(--highlight);
    animation: pulseRobot 2s infinite ease-in-out;
}

#ai-chat-btn:hover {
    box-shadow: 0 12px 40px rgba(233, 69, 96, 0.45), 0 0 25px rgba(26, 26, 46, 0.6);
    transform: translateY(-4px) scale(1.03);
    border-color: #ffffff;
}

/* Chat Window */
#ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 1000;
    width: 380px;
    height: 520px;
    max-width: 90vw;
    max-height: 80vh;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(233, 69, 96, 0.25);
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    pointer-events: none;
}

#ai-chat-window.chat-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 52, 96, 0.4);
}

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

.chat-avatar {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid var(--highlight);
    border-radius: 50%;
}

.chat-header-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 2px 0;
}

.chat-status {
    font-size: 11px;
    color: #4cd137;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #4cd137;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #4cd137;
    animation: statusBlink 1.8s infinite ease-in-out;
}

#chat-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 26px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    padding: 4px;
}

#chat-close-btn:hover {
    color: var(--highlight);
    transform: rotate(90deg);
}

/* Messages List */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar for messages */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(233, 69, 96, 0.4);
}

/* Message Bubble */
.msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.msg.bot {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.msg.user {
    background: linear-gradient(135deg, var(--highlight) 0%, #b8374d 100%);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* Loading Bouncing Dots */
.msg.loading {
    background: rgba(255, 255, 255, 0.05);
    align-self: flex-start;
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 20px;
}

.msg.loading span {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}

.msg.loading span:nth-child(2) {
    animation-delay: .2s;
}

.msg.loading span:nth-child(3) {
    animation-delay: .4s;
}

/* Quick Reply Chips */
.chat-chips {
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
    scrollbar-width: none; /* Firefox */
}

.chat-chips::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.chat-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cccccc;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.25s;
    font-weight: 500;
    flex-shrink: 0;
}

.chat-chip:hover {
    border-color: var(--highlight);
    color: #ffffff;
    background: rgba(233, 69, 96, 0.1);
    transform: translateY(-1px);
}

/* Input Area */
.chat-input-area {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(26, 26, 46, 0.98);
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 13.5px;
    transition: all 0.2s;
}

#chat-input:focus {
    outline: none;
    border-color: var(--highlight);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.2);
}

#chat-send-btn {
    background: var(--highlight);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#chat-send-btn:hover {
    background: #b8374d;
    transform: scale(1.05);
}

/* Body No Scroll when chat open on mobile */
.no-scroll {
    overflow: hidden;
}

/* Animations */
@keyframes pulseRobot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
    #ai-chat-btn {
        bottom: 20px;
        right: 20px;
        padding: 10px 18px;
        font-size: 12.5px;
    }
    
    #ai-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    #ai-chat-window.chat-open {
        transform: none;
    }
}
