/* ── Depolie Chatbot Widget ─────────────────────────────────────────────── */
#depolie-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle button */
.chat-toggle {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ec4b46;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(236, 75, 70, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff;
}
.chat-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(236, 75, 70, 0.5); }

.chat-icon-open, .chat-icon-close { position: absolute; transition: opacity 0.2s ease, transform 0.2s ease; }
.chat-icon-close { opacity: 0; transform: rotate(-90deg); }

.chat-toggle[aria-expanded="true"] .chat-icon-open  { opacity: 0; transform: rotate(90deg); }
.chat-toggle[aria-expanded="true"] .chat-icon-close  { opacity: 1; transform: rotate(0); }

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f59d6a;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Panel */
.chat-panel {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 340px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chat-header {
    background: #ec4b46;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.chat-name { font-size: 13px; font-weight: 700; margin: 0; line-height: 1.3; }
.chat-status { font-size: 11px; margin: 0; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}
.chat-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.chat-close-btn:hover { color: #fff; background: rgba(255,255,255,0.15); }

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 2px; }

.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-bot  { justify-content: flex-start; }

.chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 12.5px;
    line-height: 1.6;
}
.chat-msg-user .chat-bubble {
    background: #ec4b46;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg-bot .chat-bubble {
    background: #f5f5f5;
    color: #222;
    border-bottom-left-radius: 4px;
}
.chat-bubble a { color: #ec4b46; font-weight: 600; }
.chat-msg-user .chat-bubble a { color: rgba(255,255,255,0.9); text-decoration: underline; }
.chat-bubble ul, .chat-bubble ol { padding-left: 16px; margin: 6px 0; }
.chat-bubble li { margin-bottom: 3px; }

/* Typing indicator */
.chat-typing { display: flex; align-items: center; gap: 5px; padding: 12px 14px; }
.chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #bbb;
    animation: chatBounce 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 chatBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Suggestions */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 4px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.chat-suggestion-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    font-family: inherit;
}
.chat-suggestion-btn:hover { background: #ec4b46; border-color: #ec4b46; color: #fff; }

/* Input row */
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 12.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    color: #222;
}
.chat-input:focus { border-color: #ec4b46; }
.chat-input::placeholder { color: #bbb; }

.chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ec4b46;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}
.chat-send:hover { background: #d43b36; transform: scale(1.08); }

/* Mobile */
@media (max-width: 480px) {
    #depolie-chat { bottom: 16px; right: 16px; }
    .chat-panel { width: calc(100vw - 32px); right: 0; max-height: 75vh; }
}
