/* ================================
   DJN CHAT WIDGET – FINAL CSS
================================ */

/* ---------- Floating Icon ---------- */
.chat-float-icon {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 60px;
    height: 60px;
    background: #0aaa84;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    z-index: 1000000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transition: transform .15s ease, background .15s ease;
}

.chat-float-icon:hover {
    transform: scale(1.08);
    background: #099172;
}

/* ---------- Chat Panel ---------- */
#chat-panel {
    position: fixed;
    right: 25px;
    bottom: 95px;
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.30);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
}

/* ---------- Header ---------- */
#chat-header {
    background: #0aaa84;
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

#chat-header span {
    font-size: 15px;
}

/* Close button (ID FIXED) */
#chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}

#chat-close:hover {
    opacity: 0.8;
}

/* ---------- Messages ---------- */
#chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #f7f7f7;
}

/* Scrollbar (optional but clean) */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}

/* Message wrapper */
.message {
    display: flex;
    margin-bottom: 8px;
    max-width: 100%;
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

/* Bubble */
.message .bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* User bubble */
.message.user .bubble {
    background: #0aaa84;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Bot bubble */
.message.bot .bubble {
    background: #e5e5e5;
    color: #000;
    border-bottom-left-radius: 4px;
}

/* ---------- Typing Indicator ---------- */
#typing-indicator {
    display: none;
    font-size: 12px;
    padding: 6px 12px;
    color: #666;
    background: #f7f7f7;
    border-top: 1px solid #e0e0e0;
}

/* ---------- Input Area ---------- */
#chat-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #fff;
}

#chat-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    outline: none;
}

#chat-input:focus {
    border-color: #0aaa84;
}

/* Send Button */
#chat-send {
    margin-left: 8px;
    padding: 0 18px;
    background: #0aaa84;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s ease;
}

#chat-send:hover {
    background: #099172;
}

/* ---------- Mobile Safety ---------- */
@media (max-width: 480px) {
    #chat-panel {
        right: 10px;
        bottom: 80px;
        width: calc(100% - 20px);
        height: 70vh;
    }

    .chat-float-icon {
        right: 15px;
        bottom: 15px;
    }
}
