/* BookingPlaner — Sophia Chatbot Widget */
/* Blue/Amber theme matching BookingPlaner branding */

#bp-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 9999;
}

/* Toggle Button */
#bp-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(30, 58, 95, 0.4);
    transition: all 0.3s ease;
}
#bp-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(30, 58, 95, 0.55);
}
.bp-chat-icon-close { display: none; }
.bp-chat--open .bp-chat-icon-open { display: none; }
.bp-chat--open .bp-chat-icon-close { display: block; }

/* Chat Window */
#bp-chat-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    height: 520px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: bpChatSlide 0.3s ease;
}
.bp-chat--open #bp-chat-window { display: flex; }

@keyframes bpChatSlide {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
#bp-chat-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#bp-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
#bp-chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}
#bp-chat-title {
    font-weight: 700;
    font-size: 0.95rem;
}
#bp-chat-status {
    font-size: 0.7rem;
    opacity: 0.8;
}
#bp-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
#bp-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Messages */
#bp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}
.bp-chat-msg { display: flex; animation: bpMsgIn 0.3s ease; }
.bp-chat-msg--user { justify-content: flex-end; }
.bp-chat-msg--bot { justify-content: flex-start; }

.bp-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.88rem;
}
.bp-chat-msg--user .bp-chat-bubble {
    background: #1e3a5f;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.bp-chat-msg--bot .bp-chat-bubble {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}
.bp-chat-bubble a {
    color: #f59e0b;
    text-decoration: underline;
}
.bp-chat-msg--user .bp-chat-bubble a {
    color: #fbbf24;
}

/* Input */
#bp-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
#bp-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color 0.2s;
}
#bp-chat-input::placeholder { color: #94a3b8; }
#bp-chat-input:focus { border-color: #1e3a5f; }

#bp-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
#bp-chat-send:hover { background: #d97706; transform: scale(1.05); }

/* Typing Indicator */
.bp-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}
.bp-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1e3a5f;
    animation: bpTyping 1.4s infinite;
}
.bp-typing span:nth-child(2) { animation-delay: 0.2s; }
.bp-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bpTyping {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-8px); }
}
@keyframes bpMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
#bp-chat-messages::-webkit-scrollbar { width: 5px; }
#bp-chat-messages::-webkit-scrollbar-track { background: transparent; }
#bp-chat-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* Mobile */
@media (max-width: 480px) {
    #bp-chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
    }
    #bp-chat-toggle { width: 48px; height: 48px; }
    #bp-chat { bottom: 16px; right: 16px; }
    .bp-chat-bubble { max-width: 90%; }
}
