/* =============================================================
   support_widget.css — "Anna" support chat widget
   Self-contained, sb- prefixed so it never collides with page styles.
   Works on both the GPT and Gemini pages.
   ============================================================= */

.sb-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sb-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 26px rgba(0,0,0,0.28); }
.sb-launcher.sb-open { transform: scale(0.9); opacity: 0.85; }

.sb-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sb-panel.sb-visible { display: flex; }

.sb-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
}
.sb-header .sb-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.sb-header .sb-title { font-size: 15px; font-weight: 600; line-height: 1.2; }
.sb-header .sb-subtitle { font-size: 11.5px; opacity: 0.85; }
.sb-header .sb-counter {
    margin-left: auto;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.18);
    padding: 2px 9px;
    border-radius: 999px;
    min-width: 34px;
    text-align: center;
}
.sb-header .sb-close {
    background: none; border: none; color: #fff;
    font-size: 18px; cursor: pointer; opacity: 0.85; padding: 4px;
}
.sb-header .sb-close:hover { opacity: 1; }

.sb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f8fa;
}
.sb-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.sb-msg.sb-bot  { align-self: flex-start; background: #fff; color: #1a1a1a; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.sb-msg.sb-user { align-self: flex-end; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; border-bottom-right-radius: 4px; }
.sb-msg.sb-user .sb-msgcount {
    display: block;
    margin-top: 5px;
    font-size: 10.5px;
    line-height: 1;
    opacity: 0.8;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.sb-msg.sb-error { align-self: center; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-size: 12.5px; }

.sb-typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 13px; }
.sb-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: #9aa3b2;
    animation: sb-bounce 1.2s infinite ease-in-out;
}
.sb-typing span:nth-child(2) { animation-delay: 0.15s; }
.sb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sb-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.sb-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eceef1;
    background: #fff;
}
.sb-input-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d5d9df;
    border-radius: 999px;
    font-size: 13.5px;
    outline: none;
}
.sb-input-row input:focus { border-color: #2563eb; }
.sb-input-row button {
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff;
    cursor: pointer; font-size: 15px;
}
.sb-input-row button:disabled { opacity: 0.5; cursor: default; }

@media (prefers-color-scheme: dark) {
    .sb-panel { background: #1c1f26; }
    .sb-messages { background: #14171d; }
    .sb-msg.sb-bot { background: #262a33; color: #e6e8ec; border-color: #333844; }
    .sb-input-row { background: #1c1f26; border-top-color: #2a2f3a; }
    .sb-input-row input { background: #262a33; color: #e6e8ec; border-color: #333844; }
}
