/* WP LiveChat – Widget Styles v2.0.0 */
:root {
  --wplc-accent: #1a56db;
  --wplc-z:      99999;
  --wplc-shadow: 0 8px 32px rgba(0,0,0,.22);
}
#wplc-root * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ── Bubble ── */
#wplc-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: var(--wplc-z);
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--wplc-accent);
  border: none; cursor: pointer;
  box-shadow: var(--wplc-shadow);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
#wplc-bubble:hover  { transform: scale(1.08); box-shadow: 0 12px 40px rgba(0,0,0,.28); }
#wplc-bubble:active { transform: scale(.94); }
#wplc-bubble svg    { fill: #fff; width: 26px; height: 26px; }
#wplc-bubble-badge  {
  position: absolute; top: -3px; right: -3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ── Chat window ── */
#wplc-window {
  position: fixed; bottom: 96px; right: 24px; z-index: var(--wplc-z);
  width: 360px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 130px);
  background: #fff; border-radius: 16px;
  box-shadow: var(--wplc-shadow);
  display: none; flex-direction: column; overflow: hidden;
}
#wplc-window.open { display: flex; animation: wplcPop .2s ease; }
@keyframes wplcPop {
  from { opacity: 0; transform: scale(.92) translateY(14px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* Header */
#wplc-header {
  background: var(--wplc-accent); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
#wplc-header-title-wrap { flex: 1; display: flex; flex-direction: column; gap: 1px; }
#wplc-header-title { font-weight: 700; font-size: 1.075rem; }
#wplc-header-sub   { font-size: .82rem; opacity: .82; font-weight: 400; }
#wplc-close {
  background: rgba(255,255,255,.25); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: 1.075rem; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#wplc-close:hover { background: rgba(255,255,255,.4); }

/* Registration form */
#wplc-reg-form {
  flex: 1; overflow-y: auto; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
#wplc-reg-form h3 { font-size: 1rem; color: #374151; font-weight: 600; }
#wplc-reg-form input[type="text"],
#wplc-reg-form input[type="email"],
#wplc-reg-form input[type="tel"] {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid #d1d5db; border-radius: 8px;
  font-size: 1rem; outline: none; color: #111;
  transition: border-color .15s;
}
#wplc-reg-form input:focus { border-color: var(--wplc-accent); }
.wplc-consent {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 1rem; color: #4b5563; line-height: 1.6;
  margin-top: 6px;
}
.wplc-consent span { display: block; }
.wplc-consent input[type="checkbox"] {
  margin-top: 2px; flex-shrink: 0;
  accent-color: var(--wplc-accent);
}
#wplc-start-btn {
  padding: 11px; background: var(--wplc-accent); color: #fff;
  border: none; border-radius: 8px; font-size: 1.075rem;
  font-weight: 600; cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
  margin-top: 10px;
  width: 100%;
}
#wplc-start-btn:hover    { opacity: .88; }
#wplc-start-btn:disabled { opacity: .5; cursor: default; }
.wplc-err { color: #dc2626; font-size: .9rem; display: none; }
.wplc-privacy {
  font-size: .9rem; color: #6b7280; text-align: center;
  margin-top: auto; padding-top: 10px;
}

/* Chat messages */
#wplc-chat-area {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.wplc-msg {
  max-width: 78%; padding: 9px 13px; border-radius: 16px;
  font-size: 1rem; line-height: 1.45; word-break: break-word;
}
.wplc-msg.visitor  { align-self: flex-end;   background: var(--wplc-accent); color: #fff; border-bottom-right-radius: 4px; }
.wplc-msg.admin    { align-self: flex-start;  background: #f1f5f9; color: #1e293b; border-bottom-left-radius: 4px; }
.wplc-msg.system   { align-self: center; background: transparent; color: #94a3b8; font-size: .9rem; font-style: italic; }
.wplc-msg-time     { font-size: .78rem; opacity: .6; margin-top: 3px; }
.wplc-msg.visitor .wplc-msg-time { text-align: right; }

/* Reply bar */
#wplc-reply-bar {
  border-top: 1px solid #e5e7eb;
  display: flex; gap: 8px; padding: 10px 12px; align-items: flex-end; flex-shrink: 0;
}
#wplc-msg-input {
  flex: 1; border: 1.5px solid #d1d5db; border-radius: 20px;
  padding: 9px 14px; font-size: 1rem; outline: none;
  resize: none; max-height: 100px; overflow-y: auto;
  font-family: inherit; color: #111;
}
#wplc-msg-input:focus { border-color: var(--wplc-accent); }
#wplc-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--wplc-accent); border: none; color: #fff;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
#wplc-send-btn:hover    { opacity: .85; }
#wplc-send-btn:disabled { opacity: .4; cursor: default; }
#wplc-send-btn svg { fill: #fff; width: 16px; height: 16px; }

/* End chat bar */
#wplc-end-bar {
  border-top: 1px solid #f3f4f6;
  padding: 6px 12px 8px;
  text-align: right;
  flex-shrink: 0;
}
#wplc-end-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: .875rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
#wplc-end-btn:hover    { color: #ef4444; background: #fef2f2; }
#wplc-end-btn:disabled { opacity: .5; cursor: default; }

/* Hold / queue waiting screen */
.wplc-hold-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: var(--wplc-accent);
  animation: wplc-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes wplc-spin { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
  #wplc-window { right: 8px; width: calc(100vw - 16px); }
  #wplc-bubble { right: 16px; bottom: 16px; }
}

/* ── Typing indicator (admin is typing) ── */
.wplc-msg.admin-typing {
    align-self: flex-start;
    background: #e2e8f0;
    border-bottom-left-radius: 4px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.wplc-tdot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: wplc-tdot 1.2s infinite ease-in-out;
}
.wplc-tdot:nth-child(2) { animation-delay: .2s; }
.wplc-tdot:nth-child(3) { animation-delay: .4s; }
@keyframes wplc-tdot {
    0%,80%,100% { transform: scale(.55); opacity: .4; }
    40%          { transform: scale(1);   opacity: 1; }
}

/* ── Transcript button in end-bar ── */
#wplc-transcript-btn {
    background: none;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 6px;
    color: rgba(255,255,255,.8);
    font-size: .875rem;
    padding: 5px 10px;
    cursor: pointer;
    margin-left: 6px;
}
#wplc-transcript-btn:hover { background: rgba(255,255,255,.1); }
#wplc-transcript-btn:disabled { opacity: .5; cursor: default; }
#wplc-transcript-fb {
    font-size: .84rem;
    margin-left: 8px;
    vertical-align: middle;
}

/* ── File upload button ── */
#wplc-attach-label {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer;
    color: #64748b; border-radius: 50%;
    transition: color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
}
#wplc-attach-label:hover { color: var(--wplc-accent); background: rgba(0,0,0,.05); }

/* ── Attachment rendering in chat ── */
.wplc-attach-img {
    max-width: 100%; max-height: 220px;
    border-radius: 8px; display: block;
    cursor: pointer;
}
.wplc-attach-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 8px;
    background: rgba(0,0,0,.07);
    color: inherit; text-decoration: none;
    font-size: .96rem; font-weight: 500;
    word-break: break-all;
}
.wplc-attach-link:hover { background: rgba(0,0,0,.12); }
.wplc-attach-size { opacity: .6; font-size: .9rem; }
.wplc-upload-pending { opacity: .55; font-style: italic; font-size: .97rem; }

/* ── Admin closing warning ── */
.wplc-closing-warn {
  background: #fef3c7 !important;
  color: #92400e !important;
  font-style: normal !important;
  font-weight: 600;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 8px 12px !important;
  max-width: 90% !important;
}

/* ── Expired attachment ── */
.wplc-attach-expired {
    opacity: .55; font-style: italic; font-size: .88rem;
}
