/* ── RSC Chatbot Widget ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700&family=Barlow:wght@400;500;600&display=swap');

#rsc-chatbot-root {
    --rsc-accent:   #1a3a6b;  /* overridden by wp_localize_script */
    --rsc-gold:     #f5a623;
    --rsc-white:    #ffffff;
    --rsc-bg:       #f0f2f5;
    --rsc-border:   #dde1e8;
    --rsc-grey:     #6b7280;
    --rsc-radius:   18px;
    --rsc-shadow:   0 8px 40px rgba(26,58,107,.20);
    font-family: 'Barlow', sans-serif;
}

/* Launcher */
#rsc-launcher {
    position: fixed;
    bottom: 24px;
    width:  58px;
    height: 58px;
    border-radius: 50%;
    background: var(--rsc-accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform .2s ease, box-shadow .2s ease;
    z-index: 9998;
}
#rsc-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,.3); }
#rsc-launcher.rsc-right { right: 24px; }
#rsc-launcher.rsc-left  { left:  24px; }

/* Panel */
#rsc-panel {
    position: fixed;
    bottom: 96px;
    width:  370px;
    max-height: 540px;
    display: flex;
    flex-direction: column;
    background: var(--rsc-white);
    border-radius: 20px;
    box-shadow: var(--rsc-shadow);
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(16px) scale(.97);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
#rsc-panel.rsc-right { right: 24px; }
#rsc-panel.rsc-left  { left:  24px; }
#rsc-panel.rsc-open  { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }

/* Header */
#rsc-header {
    background: var(--rsc-accent);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.rsc-header-avatar {
    width: 36px;
    height: 36px;
    background: var(--rsc-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.rsc-header-info { flex: 1; }
.rsc-header-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--rsc-white);
}
.rsc-header-status {
    font-size: 11px;
    color: rgba(255,255,255,.75);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}
.rsc-status-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: rscPulse 2s infinite;
}
@keyframes rscPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

#rsc-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}
#rsc-close-btn:hover { color: #fff; }

/* Messages */
#rsc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--rsc-bg);
    scroll-behavior: smooth;
}
#rsc-messages::-webkit-scrollbar { width: 3px; }
#rsc-messages::-webkit-scrollbar-thumb { background: var(--rsc-border); border-radius: 4px; }

.rsc-msg {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    animation: rscFadeUp .2s ease;
}
@keyframes rscFadeUp { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.rsc-msg.rsc-user { flex-direction: row-reverse; }

.rsc-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--rsc-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.rsc-msg.rsc-user .rsc-msg-avatar {
    background: var(--rsc-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}

.rsc-bubble {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
}
.rsc-msg.rsc-bot .rsc-bubble {
    background: var(--rsc-white);
    color: #1f2937;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.rsc-msg.rsc-user .rsc-bubble {
    background: var(--rsc-accent);
    color: var(--rsc-white);
    border-bottom-right-radius: 3px;
}

/* Typing indicator */
.rsc-typing {
    background: var(--rsc-white);
    border-radius: 14px;
    border-bottom-left-radius: 3px;
    padding: 12px 16px;
    display: flex;
    gap: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.rsc-typing span {
    width: 6px;
    height: 6px;
    background: var(--rsc-grey);
    border-radius: 50%;
    animation: rscBounce 1.1s infinite;
}
.rsc-typing span:nth-child(2) { animation-delay:.18s; }
.rsc-typing span:nth-child(3) { animation-delay:.36s; }
@keyframes rscBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

/* Suggestions */
#rsc-suggestions {
    padding: 8px 12px 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    background: var(--rsc-bg);
    border-top: 1px solid var(--rsc-border);
}
.rsc-suggestion {
    background: var(--rsc-white);
    border: 1px solid var(--rsc-border);
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-family: 'Barlow', sans-serif;
    color: var(--rsc-accent);
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}
.rsc-suggestion:hover { background: var(--rsc-accent); color: #fff; border-color: var(--rsc-accent); }

/* Input */
#rsc-input-area {
    padding: 10px 12px;
    background: var(--rsc-white);
    border-top: 1px solid var(--rsc-border);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
#rsc-input {
    flex: 1;
    border: 1.5px solid var(--rsc-border);
    border-radius: 18px;
    padding: 8px 14px;
    font-family: 'Barlow', sans-serif;
    font-size: 13.5px;
    outline: none;
    resize: none;
    line-height: 1.4;
    max-height: 72px;
    overflow-y: auto;
    background: var(--rsc-bg);
    transition: border-color .18s;
}
#rsc-input:focus { border-color: var(--rsc-accent); background: #fff; }

#rsc-send {
    width: 36px;
    height: 36px;
    background: var(--rsc-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    flex-shrink: 0;
    color: #fff;
}
#rsc-send:hover { background: #2250a0; transform: scale(1.07); }
#rsc-send:disabled { background: var(--rsc-border); cursor: not-allowed; transform: none; }
#rsc-send svg { width: 16px; height: 16px; }

/* Mobile */
@media (max-width: 480px) {
    #rsc-panel { width: calc(100vw - 24px); right: 12px !important; left: 12px !important; }
    #rsc-launcher.rsc-right { right: 16px; }
    #rsc-launcher.rsc-left  { left:  16px; }
}
