/* =====================================================
   CHATBOT.CSS - Widget Chatbot Catering
   ===================================================== */

#chatbot-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 9999;
    transition: transform .25s, box-shadow .25s;
}
#chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
#chatbot-icon {
    font-size: 28px;
    color: #fff;
}

/* Box utama chat */
#chatbot-box {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 360px;
    max-width: calc(100vw - 30px);
    height: 500px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transition: transform .25s, opacity .25s;
}
.chatbot-hidden {
    transform: translateY(20px) scale(.95);
    opacity: 0;
    pointer-events: none;
}

/* Header chat */
.chatbot-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #f39c12;
}
.chatbot-header strong { font-size: 16px; }
.chatbot-close {
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    padding: 0 6px;
    border-radius: 4px;
    transition: background .15s;
}
.chatbot-close:hover { background: rgba(255,255,255,0.15); }

/* Body chat (area pesan) */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f6fa;
    font-size: 14px;
    line-height: 1.5;
}
.chatbot-body::-webkit-scrollbar { width: 6px; }
.chatbot-body::-webkit-scrollbar-thumb { background: #bdc3c7; border-radius: 3px; }

/* Bubble pesan */
.chat-msg {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 80%;
    word-wrap: break-word;
    white-space: pre-line;
    animation: chatFadeIn .25s ease-out;
}
@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-bot {
    background: #fff;
    color: #2c3e50;
    border: 1px solid #ecf0f1;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}
.chat-user {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    border-bottom-right-radius: 4px;
    margin-left: auto;
    text-align: left;
}

/* Tombol quick reply */
.chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}
.chat-quick button {
    background: #fff;
    color: #f39c12;
    border: 1.5px solid #f39c12;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.chat-quick button:hover {
    background: #f39c12;
    color: #fff;
}

/* Animasi bot mengetik */
.chat-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px !important;
}
.chat-typing span {
    width: 7px;
    height: 7px;
    background: #95a5a6;
    border-radius: 50%;
    display: inline-block;
    animation: chatBlink 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatBlink {
    0%,60%,100% { opacity: .3; transform: scale(.85); }
    30%         { opacity: 1;  transform: scale(1); }
}

/* Form input */
.chatbot-form {
    display: flex;
    border-top: 1px solid #ecf0f1;
    padding: 10px;
    background: #fff;
    gap: 8px;
}
.chatbot-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border .15s;
}
.chatbot-form input:focus { border-color: #f39c12; }
.chatbot-form button {
    background: #f39c12;
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background .15s;
}
.chatbot-form button:hover { background: #e67e22; }

/* Mobile */
@media (max-width: 480px) {
    #chatbot-box {
        bottom: 90px;
        right: 10px;
        left: 10px;
        width: auto;
        height: 70vh;
    }
    #chatbot-toggle {
        bottom: 15px;
        right: 15px;
    }
}

@media print {
    #chatbot-toggle, #chatbot-box { display: none !important; }
}
