/* ============================================================
   Safe Badkamers — Chatbot Widget
   Blauw/Wit thema met oranje CTA
   ============================================================ */

/* Chat Button */
.sb-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1B6B9E;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(27, 107, 158, 0.4);
    z-index: 9998;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sb-chat-btn:hover {
    background: #145580;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(27, 107, 158, 0.5);
}

/* Chat Panel */
.sb-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sbChatSlideUp 0.3s ease;
}

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

/* Header */
.sb-chat-header {
    background: linear-gradient(135deg, #1B6B9E 0%, #4EADD9 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.sb-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sb-chat-name {
    font-weight: 700;
    font-size: 15px;
}

.sb-chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sb-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ADE80;
    display: inline-block;
}

.sb-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sb-chat-close:hover {
    opacity: 1;
}

/* Body */
.sb-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F7FBFE;
}

.sb-chat-body::-webkit-scrollbar {
    width: 5px;
}

.sb-chat-body::-webkit-scrollbar-thumb {
    background: #cdd;
    border-radius: 3px;
}

/* Messages */
.sb-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: sbMsgIn 0.3s ease;
}

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

.sb-msg-bot {
    background: #fff;
    color: #374151;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.sb-msg-user {
    background: #1B6B9E;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.sb-msg-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 20px;
}

.sb-msg-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9CA3AF;
    animation: sbTypingDot 1.4s infinite;
}

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

@keyframes sbTypingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Option Buttons */
.sb-chat-options {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    border-top: 1px solid #E2EBF3;
    flex-shrink: 0;
}

.sb-chat-options:empty {
    display: none;
    padding: 0;
    border: none;
}

.sb-opt-btn {
    padding: 8px 16px;
    border: 2px solid #1B6B9E;
    border-radius: 20px;
    background: #fff;
    color: #1B6B9E;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sb-opt-btn:hover {
    background: #1B6B9E;
    color: #fff;
}

.sb-opt-btn.sb-opt-cta {
    background: #FF6B35;
    color: #fff;
    border-color: #FF6B35;
}

.sb-opt-btn.sb-opt-cta:hover {
    background: #E85A25;
    border-color: #E85A25;
}

/* Input area */
.sb-chat-input-area {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #E2EBF3;
    flex-shrink: 0;
}

.sb-chat-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.sb-chat-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-chat-fields input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2EBF3;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.sb-chat-fields input:focus {
    border-color: #1B6B9E;
}

.sb-chat-submit {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #FF6B35;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.sb-chat-submit:hover {
    background: #E85A25;
}

/* Urgency banner */
.sb-urgency {
    background: #FFF7ED;
    border-left: 3px solid #FF6B35;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400E;
    margin: 4px 0;
    border-radius: 0 8px 8px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .sb-chat-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 8px;
        border-radius: 12px;
    }
    .sb-chat-btn {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}

/* ====== Text Input Bar ====== */
.sb-text-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #E2EBF3;
    background: #fff;
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
}

.sb-text-input-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.sb-text-input-bar input:focus {
    border-color: #1B6B9E;
    box-shadow: 0 0 0 3px rgba(27, 107, 158, 0.1);
}

.sb-text-input-bar button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #FF6B35;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.sb-text-input-bar button:hover {
    background: #E85A25;
    transform: scale(1.05);
}

/* ====== Floating Action Buttons ====== */
.floating-actions {
    position: fixed;
    bottom: 24px;
    right: 96px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    z-index: 9998;
    align-items: center;
}

.fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.fab-whatsapp {
    background: #25D366;
}

.fab-phone {
    background: #1B6B9E;
}

@media (max-width: 480px) {
    .floating-actions {
        right: 80px;
        bottom: 20px;
        gap: 8px;
    }
    .fab {
        width: 44px;
        height: 44px;
    }
}
