/* ═══════════════════════════════════════════════════════════════════════════
   OWLC LIVE CHAT WIDGET CSS — Ultimate Pro Edition v3.0
   Floating WhatsApp widget + inline shortcode styles
═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens (injected from PHP via JS, but we set safe defaults) ──────── */
:root {
  --owlc-w-color:   #25D366;
  --owlc-w-dark:    #1ba34e;
  --owlc-w-light:   #e6faf2;
  --owlc-w-text:    #1e293b;
  --owlc-w-muted:   #64748b;
  --owlc-w-border:  #e2e8f0;
  --owlc-w-bg:      #f8fafc;
  --owlc-w-radius:  18px;
  --owlc-w-shadow:  0 8px 40px rgba(0,0,0,.18), 0 2px 10px rgba(0,0,0,.1);
  --owlc-w-font:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Floating Launcher Button ─────────────────────────────────────────── */
#owlc-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--owlc-w-font);
}

#owlc-launcher.owlc-pos-bottom-left {
  right: auto;
  left: 28px;
  align-items: flex-start;
}

/* Bubble button */
#owlc-bubble-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--owlc-w-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 28px rgba(37,211,102,.45), 0 2px 8px rgba(0,0,0,.18);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#owlc-bubble-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 36px rgba(37,211,102,.55), 0 3px 12px rgba(0,0,0,.2);
}

#owlc-bubble-btn:active { transform: scale(.95); }

/* Pulse ring */
#owlc-bubble-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(37,211,102,.25);
  animation: owlc-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes owlc-pulse {
  0%   { transform: scale(1);   opacity: .8; }
  70%  { transform: scale(1.5); opacity: 0;  }
  100% { transform: scale(1.5); opacity: 0;  }
}

#owlc-bubble-btn svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  transition: transform .22s ease, opacity .22s ease;
}

#owlc-bubble-btn .owlc-icon-close {
  display: none;
  position: absolute;
}

.owlc-widget-open #owlc-bubble-btn .owlc-icon-wa    { display: none; }
.owlc-widget-open #owlc-bubble-btn .owlc-icon-close { display: block; }

/* Unread badge */
#owlc-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
  animation: owlc-badge-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes owlc-badge-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ── Tooltip label ────────────────────────────────────────────────────── */
#owlc-tooltip {
  background: var(--owlc-w-text);
  color: #fff;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  animation: owlc-tooltip-in .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
@keyframes owlc-tooltip-in { from { opacity:0; transform:translateY(10px) scale(.9); } to { opacity:1; transform:translateY(0) scale(1); } }

/* ── Panel ────────────────────────────────────────────────────────────── */
#owlc-panel {
  width: 360px;
  max-height: 580px;
  background: var(--owlc-w-bg);
  border-radius: var(--owlc-w-radius);
  box-shadow: var(--owlc-w-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  transition: transform .28s cubic-bezier(.34,1.2,.64,1), opacity .22s ease;
  transform: scale(0) translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.owlc-pos-bottom-left #owlc-panel {
  transform-origin: bottom left;
}

.owlc-widget-open #owlc-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Panel header */
#owlc-panel-header {
  background: var(--owlc-w-color);
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#owlc-panel-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  pointer-events: none;
}
#owlc-panel-header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}

#owlc-agent-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 2.5px solid rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
  color: #fff;
  position: relative;
  z-index: 1;
}

/* Online dot */
#owlc-agent-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid rgba(37,211,102,.8);
}

.owlc-header-text { flex: 1; position: relative; z-index: 1; }
.owlc-header-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 3px;
  line-height: 1.2;
  font-family: var(--owlc-w-font);
}
.owlc-header-text p {
  font-size: 12.5px;
  color: rgba(255,255,255,.82);
  margin: 0;
  line-height: 1.4;
}

.owlc-online-pill {
  background: rgba(255,255,255,.22);
  color: rgba(255,255,255,.95);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.owlc-online-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  animation: owlc-online-blink 2s ease-in-out infinite;
}
@keyframes owlc-online-blink { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* Chat preview area */
#owlc-chat-preview {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  background: #f0f9f4;
}

.owlc-preview-bubble {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.owlc-preview-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--owlc-w-color);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.owlc-preview-msg {
  background: #fff;
  border-radius: 14px 14px 14px 2px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--owlc-w-text);
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  max-width: 80%;
  border: 1px solid var(--owlc-w-border);
}

.owlc-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.owlc-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--owlc-w-muted);
  display: inline-block;
  animation: owlc-typing-dot 1.4s ease-in-out infinite;
}
.owlc-typing span:nth-child(2) { animation-delay: .2s; }
.owlc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes owlc-typing-dot { 0%,60%,100%{transform:translateY(0);} 30%{transform:translateY(-5px);} }

/* Form area */
#owlc-form-area {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--owlc-w-bg);
  border-top: 1px solid var(--owlc-w-border);
}

#owlc-form-area input[type="text"],
#owlc-form-area input[type="tel"],
#owlc-form-area textarea {
  width: 100%;
  border: 1.5px solid var(--owlc-w-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: var(--owlc-w-font);
  color: var(--owlc-w-text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  resize: none;
}
#owlc-form-area input:focus,
#owlc-form-area textarea:focus {
  border-color: var(--owlc-w-color);
  box-shadow: 0 0 0 3px rgba(37,211,102,.13);
}
#owlc-form-area textarea { min-height: 72px; }

#owlc-form-area input::placeholder,
#owlc-form-area textarea::placeholder { color: #b0bec5; }

/* CTA button */
#owlc-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  background: var(--owlc-w-color);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--owlc-w-font);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, transform .15s ease, box-shadow .18s ease;
  box-shadow: 0 4px 18px rgba(37,211,102,.35);
  letter-spacing: .01em;
}
#owlc-cta-btn:hover {
  background: var(--owlc-w-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37,211,102,.45);
  text-decoration: none;
  color: #fff;
}
#owlc-cta-btn:active { transform: translateY(0); }

#owlc-cta-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Privacy note */
#owlc-privacy-note {
  text-align: center;
  font-size: 11px;
  color: var(--owlc-w-muted);
  line-height: 1.5;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
#owlc-privacy-note svg { width: 12px; height: 12px; color: var(--owlc-w-color); }

/* ── Success screen ───────────────────────────────────────────────────── */
#owlc-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  gap: 12px;
  flex: 1;
}
#owlc-success.is-visible { display: flex; }
#owlc-form-area.is-hidden { display: none; }

.owlc-success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--owlc-w-light);
  color: var(--owlc-w-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  animation: owlc-success-pop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes owlc-success-pop { from{transform:scale(0);} to{transform:scale(1);} }

#owlc-success h4 { font-size: 17px; font-weight: 700; color: var(--owlc-w-text); font-family: var(--owlc-w-font); margin: 0; }
#owlc-success p  { font-size: 13.5px; color: var(--owlc-w-muted); line-height: 1.6; margin: 0; }

.owlc-success-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  background: var(--owlc-w-color);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--owlc-w-font);
  text-decoration: none;
  margin-top: 6px;
  transition: background .18s, transform .15s;
  box-shadow: 0 3px 14px rgba(37,211,102,.35);
}
.owlc-success-wa-btn:hover { background: var(--owlc-w-dark); transform: translateY(-1px); }

/* ── Inline shortcode link ────────────────────────────────────────────── */
.owlc-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  background: #25D366;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .18s, transform .15s, box-shadow .18s;
  box-shadow: 0 3px 12px rgba(37,211,102,.3);
}
.owlc-inline-link:hover {
  background: #1ba34e;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(37,211,102,.4);
}
.owlc-inline-link::before {
  content: '';
  display: inline-block;
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z'/%3E%3Cpath d='M12 0C5.373 0 0 5.373 0 12c0 2.122.554 4.122 1.522 5.867L0 24l6.317-1.501A11.934 11.934 0 0 0 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 22c-1.891 0-3.658-.519-5.168-1.422l-.368-.22-3.747.891.924-3.648-.24-.378A9.959 9.959 0 0 1 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ── Mobile responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #owlc-launcher { bottom: 18px; right: 18px; }
  #owlc-launcher.owlc-pos-bottom-left { left: 18px; }

  #owlc-panel {
    width: calc(100vw - 24px);
    max-height: 75vh;
    bottom: 84px;
    right: 12px;
    left: auto;
    position: fixed;
    border-radius: 16px;
  }

  .owlc-pos-bottom-left #owlc-panel {
    right: auto;
    left: 12px;
  }
}

/* ── Focus accessibility ──────────────────────────────────────────────── */
#owlc-bubble-btn:focus-visible {
  outline: 3px solid rgba(37,211,102,.5);
  outline-offset: 4px;
}
#owlc-cta-btn:focus-visible {
  outline: 3px solid rgba(37,211,102,.5);
  outline-offset: 3px;
}
#owlc-form-area input:focus-visible,
#owlc-form-area textarea:focus-visible {
  outline: none;
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #owlc-bubble-btn::before       { animation: none; }
  .owlc-online-dot               { animation: none; }
  .owlc-typing span              { animation: none; }
  #owlc-panel                    { transition: opacity .15s ease; }
  #owlc-bubble-btn               { transition: none; }
}
