/* ═══════════════════════════════════════════════════════════════
   Hussle Customz Chat Widget
   ═══════════════════════════════════════════════════════════════ */

:root {
    --hc-bg:       #0c0c0c;
    --hc-surface:  #121212;
    --hc-border:   rgba(255,255,255,0.07);
    --hc-border2:  rgba(255,255,255,0.13);
    --hc-text:     #c8c8c8;
    --hc-muted:    #737373;
    --hc-mid:      #999999;
    --hc-white:    #f0f0f0;
    --hc-ease:     cubic-bezier(0.4, 0, 0.2, 1);
    --hc-sans:     ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --hc-mono:     ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Monaco, Consolas, monospace;
}

/* ── Particle Toggle ────────────────────────────────────────── */
.hc-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 64px;
    height: 64px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 99998;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.4s;
}

.hc-toggle canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hc-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Full-screen explosion canvas ───────────────────────────── */
.hc-explosion-canvas {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
}

.hc-ambient-canvas {
    position: fixed;
    inset: 0;
    z-index: 99997;
    pointer-events: none;
}

/* ── Chat Window ────────────────────────────────────────────── */
.hc-window {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 380px;
    height: 520px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    font-family: var(--hc-sans);
    font-size: 14px;
    line-height: 1.65;
    color: var(--hc-text);
    background: var(--hc-bg);
}

.hc-window.open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Header ─────────────────────────────────────────────────── */
.hc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--hc-surface);
    border-bottom: 1px solid var(--hc-border);
    flex-shrink: 0;
}

.hc-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--hc-border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--hc-sans);
    font-weight: 700;
    font-size: 13px;
    color: var(--hc-white);
    flex-shrink: 0;
}

.hc-header-info { flex: 1; min-width: 0; }

.hc-header-title {
    font-family: var(--hc-sans);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hc-white);
}

.hc-header-status {
    font-family: var(--hc-mono);
    font-size: 11px;
    color: var(--hc-muted);
    letter-spacing: 0.06em;
}

.hc-header-status::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 1;
}

.hc-header-actions { display: flex; gap: 4px; }

.hc-header-btn {
    background: none; border: none; cursor: pointer;
    padding: 6px; color: var(--hc-muted);
    transition: color 0.2s; display: flex; align-items: center;
}
.hc-header-btn:hover { color: var(--hc-white); }
.hc-header-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Phone Banner ───────────────────────────────────────────── */
.hc-phone-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--hc-border);
    font-family: var(--hc-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--hc-muted);
    flex-shrink: 0;
}

.hc-phone-bar a { color: var(--hc-white); text-decoration: none; transition: opacity 0.2s; }
.hc-phone-bar a:hover { opacity: 0.7; }
.hc-phone-bar svg { width: 12px; height: 12px; fill: var(--hc-muted); flex-shrink: 0; }

.hc-phone-bar.hc-hidden,
.hc-human-btn.hc-hidden { display: none; }

/* ── Messages ───────────────────────────────────────────────── */
.hc-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}
.hc-messages::-webkit-scrollbar { width: 0; display: none; }
.hc-messages { scrollbar-width: none; -ms-overflow-style: none; }

/* ── Bubbles ────────────────────────────────────────────────── */
.hc-msg {
    display: flex; gap: 8px; max-width: 88%;
    animation: hcFadeIn 0.3s var(--hc-ease);
}
@keyframes hcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hc-msg-bot  { align-self: flex-start; }
.hc-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.hc-msg-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--hc-border2);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--hc-sans); font-weight: 700; font-size: 11px;
    color: var(--hc-white); flex-shrink: 0; margin-top: 2px;
}
.hc-msg-user .hc-msg-avatar { color: var(--hc-muted); }

.hc-msg-bubble {
    padding: 10px 14px; border-radius: 2px;
    word-wrap: break-word; overflow-wrap: break-word;
    font-size: 14px; line-height: 1.65;
}
.hc-msg-bot .hc-msg-bubble  { background: var(--hc-surface); border: 1px solid var(--hc-border); }
.hc-msg-user .hc-msg-bubble { background: #1a1a1a; border: 1px solid var(--hc-border); }

.hc-msg-bubble p { margin: 0; }
.hc-msg-bubble p + p { margin-top: 8px; }
.hc-msg-bubble strong { color: var(--hc-white); font-weight: 600; }

/* ── Typing ─────────────────────────────────────────────────── */
.hc-typing { display: none; align-self: flex-start; align-items: center; gap: 8px; max-width: 88%; animation: hcFadeIn 0.3s var(--hc-ease); }
.hc-typing.visible { display: flex; }

.hc-typing-dots { display: flex; align-items: center; gap: 5px; padding: 12px 16px; background: var(--hc-surface); border: 1px solid var(--hc-border); border-radius: 16px; height: 40px; }
.hc-typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hc-muted); will-change: transform, opacity; animation: hcDotFloat 1.4s ease-in-out infinite !important; animation-duration: 1.4s !important; }
.hc-typing-dot:nth-child(2) { animation-delay: 0.2s !important; }
.hc-typing-dot:nth-child(3) { animation-delay: 0.4s !important; }

@keyframes hcDotFloat {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50%      { transform: translateY(-4px); opacity: 1; }
}

/* ── Quick Replies ──────────────────────────────────────────── */
.hc-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; flex-shrink: 0; }

.hc-quick-btn {
    padding: 7px 14px; border: 1px solid var(--hc-border2);
    background: transparent; color: var(--hc-mid);
    font-family: var(--hc-mono); font-size: 11px;
    letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer; transition: color 0.2s, border-color 0.2s; white-space: nowrap;
}
.hc-quick-btn:hover { color: var(--hc-white); border-color: rgba(255,255,255,0.3); }

/* ── Lead Form ──────────────────────────────────────────────── */
.hc-lead-form { display: none; flex-direction: column; gap: 7px; padding: 14px 16px; border-top: 1px solid var(--hc-border); background: var(--hc-surface); flex-shrink: 0; animation: hcFadeIn 0.3s var(--hc-ease); }
.hc-lead-form.visible { display: flex; }

.hc-lead-form-title { font-family: var(--hc-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--hc-muted); margin-bottom: 2px; }

.hc-lead-form input { padding: 8px 12px; border: 1px solid var(--hc-border); background: var(--hc-bg); color: var(--hc-white); font-family: var(--hc-sans); font-size: 14px; outline: none; transition: border-color 0.2s; }
.hc-lead-form input:focus { border-color: var(--hc-border2); }
.hc-lead-form input::placeholder { color: rgba(255,255,255,0.25); }

.hc-lead-submit { padding: 11px 20px; border: none; background: var(--hc-white); color: #0c0c0c; font-family: var(--hc-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; transition: opacity 0.2s; margin-top: 4px; }
.hc-lead-submit:hover { opacity: 0.85; }

/* ── Input Area ─────────────────────────────────────────────── */
.hc-input-area { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--hc-border); background: var(--hc-surface); flex-shrink: 0; }

.hc-input { flex: 1; min-height: 36px; max-height: 140px; padding: 8px 12px; border: 1px solid var(--hc-border); background: var(--hc-bg); color: var(--hc-text); font-family: var(--hc-sans); font-size: 14px; line-height: 1.4; resize: none; outline: none; overflow-y: hidden; transition: border-color 0.2s, height 0.15s ease; }
.hc-input:focus { border-color: var(--hc-border2); }
.hc-input::placeholder { color: rgba(255,255,255,0.25); }

.hc-send-btn { width: 36px; height: 36px; border: 1px solid var(--hc-border2); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: border-color 0.2s; }
.hc-send-btn:hover { border-color: rgba(255,255,255,0.3); }
.hc-send-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.hc-send-btn svg { width: 16px; height: 16px; fill: var(--hc-white); }

/* ── Human Button ───────────────────────────────────────────── */
.hc-human-btn { display: block; width: 100%; padding: 9px; background: none; border: none; border-top: 1px solid var(--hc-border); color: var(--hc-muted); font-family: var(--hc-mono); font-size: 11px; letter-spacing: 0.06em; cursor: pointer; transition: color 0.2s; flex-shrink: 0; }
.hc-human-btn:hover { color: var(--hc-white); }

.hc-disclaimer {
    padding: 4px 16px;
    font-family: var(--hc-mono);
    font-size: 11px;
    color: #666;
    text-align: center;
    flex-shrink: 0;
}

.hc-disclaimer a {
    color: #777;
    text-decoration: underline;
    transition: color 0.2s;
}

.hc-disclaimer a:hover {
    color: var(--hc-white);
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .hc-window { inset: 0; width: 100%; height: 100%; height: 100dvh; border: none; border-radius: 0; box-shadow: none; transform-origin: bottom right; }
    .hc-toggle { bottom: 18px; right: 18px; }
    .hc-input { font-size: 16px; }
    .hc-lead-form input { font-size: 16px; }
}

@media print { .hc-toggle, .hc-window, .hc-explosion-canvas, .hc-ambient-canvas { display: none !important; } }
