/* =========================================================
   MUNAUGHT Live Chat Widget — Styles
   ========================================================= */

#mnt-chat-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Bubble ──────────────────────────────────────────────── */
#mnt-chat-bubble {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#mnt-chat-bubble:hover,
#mnt-chat-bubble.mnt-active {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(37, 99, 235, 0.55);
}
#mnt-chat-bubble svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

/* Badge */
#mnt-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: mnt-ping 1.5s ease infinite;
}
@keyframes mnt-ping {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50%       { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ── Chat Box ─────────────────────────────────────────────── */
#mnt-chat-box {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 340px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 520px;
    animation: mnt-slide-up 0.25s ease;
}
@keyframes mnt-slide-up {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dark mode */
.dark #mnt-chat-box {
    background: #0f172a;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
}

/* ── Header ──────────────────────────────────────────────── */
#mnt-chat-header {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.mnt-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mnt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.mnt-brand {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.mnt-status {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}
.mnt-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    animation: mnt-blink 2s ease infinite;
}
@keyframes mnt-blink {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
}
#mnt-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
#mnt-chat-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
#mnt-chat-close svg { width: 18px; height: 18px; }

/* ── Intro Form ──────────────────────────────────────────── */
#mnt-chat-form {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mnt-form-intro {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 4px;
}
.dark .mnt-form-intro { color: #94a3b8; }

#mnt-chat-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
    background: #f8fafc;
    color: #1e293b;
    box-sizing: border-box;
}
#mnt-chat-form input:focus {
    border-color: #2563eb;
    background: #fff;
}
.dark #mnt-chat-form input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

#mnt-start-btn {
    padding: 11px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
#mnt-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

/* ── Messages ────────────────────────────────────────────── */
#mnt-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
#mnt-chat-messages::-webkit-scrollbar { width: 4px; }
#mnt-chat-messages::-webkit-scrollbar-track { background: transparent; }
#mnt-chat-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.mnt-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}
.mnt-msg span {
    display: inline-block;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}
.mnt-msg time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
    padding: 0 4px;
}

/* Visitor messages — right aligned */
.mnt-msg-visitor {
    align-self: flex-end;
    align-items: flex-end;
}
.mnt-msg-visitor span {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Admin messages — left aligned */
.mnt-msg-admin {
    align-self: flex-start;
    align-items: flex-start;
}
.mnt-msg-admin span {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}
.dark .mnt-msg-admin span {
    background: #1e293b;
    color: #f1f5f9;
}

/* ── Input Bar ───────────────────────────────────────────── */
#mnt-chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    background: #fff;
}
.dark #mnt-chat-input-bar {
    border-color: #1e293b;
    background: #0f172a;
}
#mnt-chat-input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    outline: none;
    resize: none;
    font-family: inherit;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color 0.15s;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.4;
}
#mnt-chat-input:focus {
    border-color: #2563eb;
    background: #fff;
}
.dark #mnt-chat-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
#mnt-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}
#mnt-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
#mnt-send-btn svg { width: 18px; height: 18px; }

/* ── Utility ─────────────────────────────────────────────── */
.mnt-hidden { display: none !important; }

/* ── Submitted Details Summary Card ────────────────────── */
.mnt-user-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 4px 0 10px 0;
    font-size: 12px;
    color: #334155;
    box-sizing: border-box;
}
.dark .mnt-user-card {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
.mnt-ucard-header {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2563eb;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dark .mnt-ucard-header {
    color: #60a5fa;
}
.mnt-ucard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px dashed #e2e8f0;
}
.dark .mnt-ucard-row {
    border-bottom-color: #334155;
}
.mnt-ucard-row:last-child {
    border-bottom: none;
}
.mnt-ucard-row strong {
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
}
.dark .mnt-ucard-row strong {
    color: #94a3b8;
}
.mnt-ucard-row span {
    font-weight: 600;
    color: #0f172a;
    text-align: right;
    word-break: break-word;
    font-size: 11px;
}
.dark .mnt-ucard-row span {
    color: #f8fafc;
}

/* Responsive */
@media (max-width: 400px) {
    #mnt-chat-box { width: calc(100vw - 32px); right: -8px; }
    #mnt-chat-wrap { right: 16px; bottom: 16px; }
}

/* Typing Indicator Animation */
.mnt-typing-msg {
    font-style: italic;
    opacity: 0.9;
    animation: mnt-fade-in 0.2s ease;
}
.mnt-dots {
    display: inline-block;
    animation: mnt-pulse-dots 1.2s infinite steps(4);
    font-weight: 900;
}
@keyframes mnt-pulse-dots {
    0%   { opacity: 0.2; }
    50%  { opacity: 1; }
    100% { opacity: 0.2; }
}
