/* ==========================================
   ONE CALL STEAM CLEAN — Chatbot Widget
   ========================================== */

/* ========== FAB (Floating Action Button) ========== */
.chatbot-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    background: var(--teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 6px 24px rgba(26, 122, 109, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(26, 122, 109, 0.45);
}

.chatbot-fab-icon {
    font-size: 26px;
    transition: transform 0.3s;
    line-height: 1;
}

.chatbot-fab.open .chatbot-fab-icon {
    transform: rotate(90deg);
}

/* Label bubble */
.chatbot-fab-label {
    position: absolute;
    right: 68px;
    white-space: nowrap;
    background: white;
    color: var(--charcoal);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    pointer-events: none;
    animation: fabLabelBounce 3s ease-in-out infinite;
}

.chatbot-fab-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid white;
}

.chatbot-fab.open .chatbot-fab-label {
    display: none;
}

@keyframes fabLabelBounce {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(-4px); opacity: 0.9; }
}

.chatbot-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--teal);
    animation: fabPulse 2s ease-out infinite;
}

.chatbot-fab.open .chatbot-fab-pulse { display: none; }

@keyframes fabPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ========== WINDOW ========== */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    max-height: 560px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.chatbot-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* ========== HEADER ========== */
.chatbot-header {
    background: var(--teal);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.chatbot-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    font-family: 'Playfair Display', serif;
}

.chatbot-header-name {
    font-weight: 600;
    font-size: 15px;
}

.chatbot-header-status {
    font-size: 12px;
    opacity: 0.8;
}

.chatbot-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover { background: rgba(255,255,255,0.25); }

/* ========== MESSAGES ========== */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 340px;
    scroll-behavior: smooth;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    animation: msgIn 0.35s ease-out;
}

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

.chat-msg.bot {
    background: var(--mint);
    color: var(--charcoal);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: var(--teal);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* ========== TYPING INDICATOR ========== */
.chat-typing {
    align-self: flex-start;
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: var(--mint);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    background: var(--teal);
    border-radius: 50%;
    opacity: 0.4;
    animation: typingDot 1.2s ease-in-out infinite;
}

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

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

/* ========== INPUT AREA ========== */
.chatbot-input-area {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-option-btn {
    background: white;
    border: 1.5px solid var(--teal);
    color: var(--teal);
    padding: 9px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.chatbot-option-btn:hover {
    background: var(--teal);
    color: white;
    transform: translateY(-1px);
}

.chatbot-text-input {
    display: flex;
    gap: 8px;
}

.chatbot-text-input input {
    flex: 1;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-text-input input:focus {
    border-color: var(--teal);
}

.chatbot-text-input button {
    width: 40px;
    height: 40px;
    background: var(--teal);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
}

.chatbot-text-input button:hover {
    background: var(--teal-dark);
}

/* ========== MOBILE ========== */
@media (max-width: 480px) {
    .chatbot-window {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .chatbot-fab { bottom: 20px; right: 20px; }
    .chatbot-fab-label { font-size: 13px; padding: 6px 12px; right: 64px; }
}
