/*
Author : SiberMimar "Guray Avci" | Website: www.sibermimar.com.tr

SiberLiveChat Widget Styles (MVP)
*/

:root {
  --sblc-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  --sblc-shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.16);
  --sblc-radius: 18px;
  --sblc-radius-lg: 22px;
  --sblc-border: rgba(0, 0, 0, 0.12);
  --sblc-surface: rgba(255, 255, 255, 0.98);
  --sblc-muted: rgba(0, 0, 0, 0.55);
  --sblc-font: var(--egn-font-family, system-ui, -apple-system, "Segoe UI", Arial, sans-serif);
  --sblc-accent: var(--egn-link, #1b5e20);
  --sblc-accent-hover: var(--egn-link-hover, #124317);
  --sblc-accent-soft: var(--egn-link-soft, rgba(27, 94, 32, 0.12));
  --sblc-gradient: var(--egn-bg-gradient, linear-gradient(150deg, #4e9c22, #67ab2b));
}

/* Root container added by JS */
.sblc-widget {
  position: fixed;
  z-index: 2147483000; /* keep above most UI, below browser tooltips */
  pointer-events: none; /* children will enable */
  font-family: var(--sblc-font);
}

.sblc-fab {
  pointer-events: auto;
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: var(--sblc-gradient);
  box-shadow: var(--sblc-shadow-soft);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sblc-fab:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(27, 94, 32, 0.26), var(--sblc-shadow-soft);
}

.sblc-fab__badge {
  position: absolute;
  right: -2px;
  top: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d32f2f;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.sblc-panel {
  pointer-events: auto;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 90px);
  border-radius: var(--sblc-radius-lg);
  background: var(--sblc-surface);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: var(--sblc-shadow);
  overflow: hidden;
  display: none;
}

.sblc-panel.is-open {
  display: flex;
  flex-direction: column;
}

.sblc-panel__head {
  padding: 12px 12px;
  background: linear-gradient(180deg, rgba(27, 94, 32, 0.96), rgba(27, 94, 32, 0.88));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sblc-panel__title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sblc-panel__title small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.86;
}

.sblc-panel__close {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sblc-panel__close:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.sblc-panel__body {
  flex: 1;
  padding: 12px 12px;
  overflow: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(27, 94, 32, 0.10), rgba(255, 255, 255, 0) 42%),
    radial-gradient(circle at 90% 0%, rgba(212, 175, 55, 0.10), rgba(255, 255, 255, 0) 45%),
    #fff;
}

.sblc-empty {
  padding: 12px;
  color: var(--sblc-muted);
  font-size: 13px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.sblc-msg {
  display: flex;
  margin: 10px 0;
}

.sblc-msg.is-visitor {
  justify-content: flex-end;
}

.sblc-msg__bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.sblc-msg.is-visitor .sblc-msg__bubble {
  border-color: rgba(27, 94, 32, 0.22);
  background: rgba(27, 94, 32, 0.10);
}

.sblc-msg__meta {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.48);
}

.sblc-panel__foot {
  padding: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.98);
}

.sblc-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.sblc-input {
  flex: 1;
  min-height: 42px;
  max-height: 130px;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.25;
}

.sblc-input:focus {
  outline: none;
  border-color: rgba(27, 94, 32, 0.38);
  box-shadow: 0 0 0 4px rgba(27, 94, 32, 0.12);
}

.sblc-send {
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(27, 94, 32, 0.24);
  background: rgba(27, 94, 32, 0.10);
  color: #124317;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sblc-send:hover {
  background: rgba(27, 94, 32, 0.14);
}

.sblc-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sblc-status {
  margin-top: 6px;
  font-size: 11px;
  color: var(--sblc-muted);
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .sblc-fab {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: none;
  }
  .sblc-panel {
    right: 12px;
    left: 12px;
    width: auto;
    height: min(520px, calc(100vh - 92px));
  }
}
