/* WhatsApp Job Chatbot — chatbot.css (v2.0 upgraded) */

/* ── Layout ────────────────────────────────────────────────────────── */
.jcs-wrap {
    background: #0b141a;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-width: 100%;
    height: 100vh;
    min-height: 100vh !important;
    position: fixed;
    top: 0; left: 0;
    z-index: 99999;
    margin: 0;
    font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='304' height='304'%3E%3Cdefs%3E%3Cpattern id='p' x='0' y='0' width='76' height='76' patternUnits='userSpaceOnUse'%3E%3Cpath d='M 19 0 L 0 0 0 19' fill='none' stroke='%23182229' stroke-width='1'/%3E%3Cpath d='M 57 0 L 76 0 76 19' fill='none' stroke='%23182229' stroke-width='1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='304' height='304' fill='%230b141a'/%3E%3Crect width='304' height='304' fill='url(%23p)'/%3E%3C/svg%3E");
}

body:has(.jcs-wrap) { overflow: hidden; }
body:has(.jcs-wrap) #wpadminbar { display: none !important; }

/* ── Header ────────────────────────────────────────────────────────── */
.jcs-header {
    background: #202c33;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #2a3942;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Avatar wrapper — positions the green dot ─────────────────────── */
.jcs-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.jcs-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a67e, #007a5e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    overflow: hidden;
}

.jcs-avatar-img { padding: 0; }
.jcs-avatar-img img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%; display: block;
}

/* 🟢 Green online dot */
.jcs-online-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 11px; height: 11px;
    background: #25d366;
    border-radius: 50%;
    border: 2px solid #202c33;
    animation: jcsDotPulse 2.5s ease-in-out infinite;
    z-index: 2;
}

@keyframes jcsDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
    50%       { box-shadow: 0 0 0 4px rgba(37,211,102,0); }
}

/* ── Header info ──────────────────────────────────────────────────── */
.jcs-header-info { flex: 1; }
.jcs-name { color: #e9edef; font-weight: 600; font-size: 19.2px; line-height: 1.2; }
.jcs-status { color: #8696a0; font-size: 14.4px; margin-top: 1px; transition: color 0.3s; }

/* Status turns green while bot is typing */
.jcs-wrap.is-typing .jcs-status { color: #25d366; }

/* ── Messages area ─────────────────────────────────────────────────── */
.jcs-messages {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    scrollbar-width: thin;
    scrollbar-color: #374045 transparent;
}
.jcs-messages::-webkit-scrollbar { width: 5px; }
.jcs-messages::-webkit-scrollbar-track { background: transparent; }
.jcs-messages::-webkit-scrollbar-thumb { background: #374045; border-radius: 3px; }

/* Date notice badge */
.jcs-notice {
    font-size: 13.8px; color: #d0b06a; text-align: center;
    background: #1d2b33cc; padding: 6px 14px; border-radius: 8px;
    margin: 4px auto 10px; max-width: 85%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ── Message rows ─────────────────────────────────────────────────── */
.jcs-msg-row { display: flex; flex-direction: column; animation: jcsFade .2s ease; margin-bottom: 4px; }
.jcs-msg-row.jcs-bot  { align-items: flex-start; }
.jcs-msg-row.jcs-user { align-items: flex-end; }

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

/* ── Bubbles — real WhatsApp shape with tails ─────────────────────── */
.jcs-bubble {
    padding: 9px 12px 8px 12px;
    border-radius: 7.5px;
    font-size: 17.4px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Bot bubble — left tail */
.jcs-bot-bubble {
    background: #202c33;
    color: #e9edef;
    border-top-left-radius: 0;
    max-width: calc(100vw - 20px);
}
.jcs-bot-bubble::before {
    content: '';
    position: absolute;
    top: 0; left: -8px;
    border-right: 8px solid #202c33;
    border-bottom: 8px solid transparent;
}

/* User bubble — right tail */
.jcs-user-bubble {
    background: #005c4b;
    color: #e9edef;
    border-top-right-radius: 0;
    max-width: 84%;
}
.jcs-user-bubble::after {
    content: '';
    position: absolute;
    top: 0; right: -8px;
    border-left: 8px solid #005c4b;
    border-bottom: 8px solid transparent;
}

/* Timestamp row */
.jcs-time {
    font-size: 13.2px; color: #8696a0;
    margin-top: 2px; padding: 0 2px;
    display: flex; align-items: center; gap: 3px;
    justify-content: flex-end;
}

/* Blue double-tick on user messages */
.jcs-msg-row.jcs-user .jcs-time::after {
    content: '✓✓';
    color: #53bdeb;
    font-size: 12px;
    letter-spacing: -1px;
}

/* ── Quick reply buttons ──────────────────────────────────────────── */
.jcs-quick-replies {
    display: flex; flex-direction: column;
    margin-top: 8px;
    border-top: 1px solid #2a3942;
}

.jcs-qr-btn {
    background: transparent;
    border: none;
    border-bottom: 1px solid #2a3942;
    border-radius: 6px;
    color: #53bdeb;
    padding: 13.2px 14.4px;
    font-size: 17.4px; font-weight: 500;
    cursor: pointer; text-align: center;
    transition: background .15s;
    font-family: inherit;
    text-decoration: none;
    display: block; width: 100%;
}
.jcs-qr-btn:last-child { border-bottom: none; }
.jcs-qr-btn:hover,
.jcs-qr-btn:active { background: #2a3942; }

/* ── Typing indicator — WhatsApp-style bubble with bouncing dots ──── */
.jcs-typing {
    display: none;
    padding: 0 8px 8px;
    flex-shrink: 0;
    align-items: flex-start;
}
.jcs-typing.active {
    display: flex;
    animation: jcsFade .2s ease;
}

.jcs-typing-bubble {
    background: #202c33;
    border-radius: 7.5px;
    border-top-left-radius: 0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.jcs-typing-bubble::before {
    content: '';
    position: absolute;
    top: 0; left: -8px;
    border-right: 8px solid #202c33;
    border-bottom: 8px solid transparent;
}

/* Three bouncing dots */
.jcs-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #8696a0;
    animation: jcsTypingDot 1.4s ease-in-out infinite;
}
.jcs-dot:nth-child(1) { animation-delay: 0s; }
.jcs-dot:nth-child(2) { animation-delay: 0.2s; }
.jcs-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes jcsTypingDot {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.35; }
    30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Ad Zones (frontend) ────────────────────────────────────────── */
.mcb-ad-zone { width: 100%; box-sizing: border-box; }
.mcb-ad-zone-top   { padding: 6px 8px 2px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.mcb-ad-zone-below { padding: 8px 0 0; }
.mcb-ad-injected   { justify-content: center; }
.mcb-ad-zone-inline {
    width: 100%;
    background: #fffbe6;
    border: 1px dashed #c8a200;
    border-radius: 6px;
    padding: 6px 8px;
    box-sizing: border-box;
    position: relative;
}
.mcb-ad-label-inline {
    display: block;
    font-size: 9px;
    color: #888;
    text-align: right;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
