/* Federal Apostille Chatbot — Widget Styles */

/* Widget container */
#facb-bot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: Cabin, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Toggle button */
.facb-bot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 0;
    background: #0a3d62;
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    position: relative;
}
.facb-bot-toggle:hover {
    background: #245897;
}
.facb-bot-toggle svg {
    width: 26px;
    height: 26px;
}
.facb-bot-icon-close { display: none; }
#facb-bot-widget:not(.facb-bot-closed) .facb-bot-icon-chat { display: none; }
#facb-bot-widget:not(.facb-bot-closed) .facb-bot-icon-close { display: block; }

/* Badge */
.facb-bot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Chat window */
.facb-bot-window {
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 380px;
    max-height: 560px;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid #ddd;
}
.facb-bot-closed .facb-bot-window {
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}
#facb-bot-widget:not(.facb-bot-closed) .facb-bot-window {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Header */
.facb-bot-header {
    background: #0a3d62;
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.facb-bot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.facb-bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}
.facb-bot-name {
    font-family: "Source Serif Pro", Georgia, serif;
    font-weight: 400;
    font-size: 15px;
}
.facb-bot-status {
    font-size: 11px;
    opacity: 0.85;
    color: #b0d4b0;
}
.facb-bot-minimize {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.facb-bot-minimize:hover { opacity: 1; }

/* Messages area */
.facb-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 280px;
    max-height: 340px;
    background: #f6f6f6;
}

/* Message bubbles */
.facb-bot-msg {
    margin-bottom: 12px;
    display: flex;
    animation: facb-bot-fade-in 0.3s ease;
}
@keyframes facb-bot-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.facb-bot-msg-bot {
    justify-content: flex-start;
}
.facb-bot-msg-user {
    justify-content: flex-end;
}
.facb-bot-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 0;
    word-wrap: break-word;
    white-space: pre-line;
    font-size: 13px;
    line-height: 1.5;
}
.facb-bot-msg-bot .facb-bot-bubble {
    background: #fff;
    color: #245897;
    border: 1px solid #ddd;
}
.facb-bot-msg-user .facb-bot-bubble {
    background: #0a3d62;
    color: #fff;
}

/* Typing indicator */
.facb-bot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}
.facb-bot-typing span {
    width: 8px;
    height: 8px;
    background: #a0aec0;
    border-radius: 50%;
    animation: facb-bot-typing-dot 1.4s infinite;
}
.facb-bot-typing span:nth-child(2) { animation-delay: 0.2s; }
.facb-bot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes facb-bot-typing-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* Quick replies */
.facb-bot-quick-replies {
    padding: 8px 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid #ddd;
    background: #fff;
}
.facb-bot-quick {
    background: #f6f6f6;
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 5px 14px;
    font-family: Cabin, sans-serif;
    font-size: 12px;
    color: #0a3d62;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.facb-bot-quick:hover {
    background: #0a3d62;
    color: #fff;
    border-color: #0a3d62;
}

/* Input area */
.facb-bot-input-area {
    display: flex;
    align-items: center;
    padding: 12px;
    border-top: 1px solid #ddd;
    background: #fff;
    gap: 8px;
}
.facb-bot-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 10px 14px;
    font-family: Cabin, sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: #f6f6f6;
}
.facb-bot-input:focus {
    border-color: #0a3d62;
    background: #fff;
}
.facb-bot-send {
    width: 38px;
    height: 38px;
    border-radius: 0;
    background: #0a3d62;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.facb-bot-send:hover { background: #245897; }
.facb-bot-send svg { width: 18px; height: 18px; }

/* Lead form */
.facb-bot-lead-form {
    padding: 16px;
    border-top: 1px solid #ddd;
    background: #f6f6f6;
}
.facb-bot-lead-title {
    font-family: Cabin, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #0a3d62;
    margin: 0 0 10px 0;
}
.facb-bot-lead-form input,
.facb-bot-lead-form select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: Cabin, sans-serif;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}
.facb-bot-lead-form input:focus,
.facb-bot-lead-form select:focus {
    border-color: #0a3d62;
}
.facb-bot-lead-btn {
    width: 100%;
    padding: 12px;
    background: #0a3d62;
    color: #fff;
    border: none;
    border-radius: 0;
    font-family: Cabin, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.2s;
}
.facb-bot-lead-btn:hover { background: #245897; }

/* Suggestion buttons inside messages */
.facb-bot-suggestions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.facb-bot-suggestion {
    background: #f6f6f6;
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 4px 12px;
    font-family: Cabin, sans-serif;
    font-size: 11px;
    color: #0a3d62;
    cursor: pointer;
    transition: background 0.2s;
}
.facb-bot-suggestion:hover {
    background: #0a3d62;
    color: #fff;
}

/* Scrollbar */
.facb-bot-messages::-webkit-scrollbar { width: 4px; }
.facb-bot-messages::-webkit-scrollbar-track { background: transparent; }
.facb-bot-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 0; }

/* Mobile responsive */
@media (max-width: 480px) {
    #facb-bot-widget { bottom: 10px; right: 10px; left: auto; }
    .facb-bot-window {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 70px;
        width: auto;
        max-height: 70vh;
        border-radius: 0;
    }
    .facb-bot-toggle { width: 50px; height: 50px; }
    .facb-bot-messages { min-height: 200px; max-height: 40vh; }
}
