/* WP Live Chat – Widget Styles */
:root {
  --wplc-primary: #2563eb;
  --wplc-primary-dark: #1d4ed8;
  --wplc-radius: 14px;
  --wplc-shadow: 0 8px 40px rgba(0,0,0,.18);
  --wplc-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#wplc-container {
  position: fixed;
  z-index: 999999;
  font-family: var(--wplc-font);
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
}
#wplc-container *,
#wplc-container *::before,
#wplc-container *::after { box-sizing: border-box; }

/* Position variants */
#wplc-container.wplc-bottom-right { bottom: 24px; right: 24px; }
#wplc-container.wplc-bottom-left  { bottom: 24px; left:  24px; }
#wplc-container.wplc-top-right    { top: 24px; right: 24px; }
#wplc-container.wplc-top-left     { top: 24px; left:  24px; }

/* ── Launcher button ── */
#wplc-launcher {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--wplc-primary);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--wplc-shadow);
  transition: transform .2s, background .2s;
  margin-top: 8px;
  margin-left: auto;
}
#wplc-launcher:hover { transform: scale(1.08); background: var(--wplc-primary-dark); }
#wplc-launcher svg { width: 26px; height: 26px; fill: #fff; }
#wplc-launcher .wplc-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 18px; height: 18px;
  background: #ef4444;
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
#wplc-launcher { position: relative; }

/* ── Chat window ── */
#wplc-window {
  width: 360px;
  background: #fff;
  border-radius: var(--wplc-radius);
  box-shadow: var(--wplc-shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: opacity .25s, transform .25s;
  max-height: 540px;
}
#wplc-window.wplc-hidden { opacity: 0; pointer-events: none; transform: translateY(12px) scale(.97); }

/* Header */
#wplc-header {
  background: var(--wplc-primary);
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
#wplc-header .wplc-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
#wplc-header-info { flex: 1; }
#wplc-header-title { font-size: 15px; font-weight: 600; margin: 0; }
#wplc-header-status { font-size: 12px; opacity: .85; margin: 0; }
#wplc-header-close {
  background: none; border: none; color: #fff;
  cursor: pointer; opacity: .8; padding: 2px; border-radius: 4px;
  transition: opacity .15s;
}
#wplc-header-close:hover { opacity: 1; }

/* Pre-chat form */
#wplc-prechat {
  padding: 20px;
  overflow-y: auto;
}
#wplc-prechat p { margin: 0 0 16px; color: #555; }
#wplc-prechat input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 14px;
  outline: none; transition: border-color .15s;
  margin-bottom: 10px;
}
#wplc-prechat input:focus { border-color: var(--wplc-primary); }
#wplc-start-btn {
  width: 100%; padding: 11px;
  background: var(--wplc-primary);
  color: #fff; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
#wplc-start-btn:hover { background: var(--wplc-primary-dark); }

/* Messages */
#wplc-messages {
  flex: 1; overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 200px;
}
.wplc-msg {
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.wplc-msg-agent {
  background: #f1f5f9;
  color: #1e293b;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.wplc-msg-visitor {
  background: var(--wplc-primary);
  color: #fff;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}
.wplc-msg-meta {
  font-size: 11px; margin-top: 3px; opacity: .65;
}
.wplc-typing {
  align-self: flex-start;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex; gap: 4px; align-items: center;
}
.wplc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #94a3b8;
  animation: wplcBounce 1.4s infinite ease-in-out;
}
.wplc-dot:nth-child(2) { animation-delay: .2s; }
.wplc-dot:nth-child(3) { animation-delay: .4s; }
@keyframes wplcBounce {
  0%, 80%, 100% { transform: scale(0); }
  40%           { transform: scale(1); }
}

/* Input area */
#wplc-input-area {
  padding: 10px 12px;
  border-top: 1px solid #f1f5f9;
  display: flex; gap: 8px; align-items: flex-end;
}
#wplc-input {
  flex: 1; resize: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px; padding: 9px 12px;
  font-size: 13.5px; font-family: var(--wplc-font);
  outline: none; transition: border-color .15s;
  max-height: 80px;
  line-height: 1.4;
}
#wplc-input:focus { border-color: var(--wplc-primary); }
#wplc-send-btn {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--wplc-primary); border: none;
  color: #fff; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#wplc-send-btn:hover { background: var(--wplc-primary-dark); }
#wplc-send-btn svg { width: 18px; height: 18px; fill: #fff; }

/* End chat */
#wplc-end-area {
  padding: 0 12px 10px;
  text-align: right;
}
#wplc-end-btn {
  background: none; border: none;
  font-size: 12px; color: #94a3b8; cursor: pointer;
  text-decoration: underline;
}
#wplc-end-btn:hover { color: #ef4444; }

/* Closed state */
#wplc-closed-msg {
  padding: 20px; text-align: center; color: #64748b; font-size: 13px;
}

@media (max-width: 420px) {
  #wplc-window { width: calc(100vw - 32px); }
}
