/* Sacred Cartel Booking Widget – widget.css */

:root {
  --sc-bg: #e6e6e6;
  --sc-surface: #161616;
  --sc-surface2: #1e1e1e;
  --sc-border: rgba(255, 255, 255, 0.08);
  --sc-border2: rgba(255, 255, 255, 0.13);
  --sc-accent: #c8a96e;
  --sc-accent-dim: rgba(200, 169, 110, 0.14);
  --sc-text: #f0ede6;
  --sc-muted: #888;
  --sc-bot-bg: #1e1e1e;
  --sc-user-bg: #c8a96e;
  --sc-user-text: #0e0e0e;
  --sc-radius: 0;
  --sc-w: 380px;
  --sc-h: 450px;
  --sc-z: 999990;
}

/* ── FAB ────────────────────────────────────────────────────────── */
.sc-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: var(--sc-z);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--sc-accent);
  color: #0e0e0e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 22px rgba(200, 169, 110, 0.38);
  transition: transform 0.2s, box-shadow 0.2s;
  outline: none;
  padding: 0;
}
.sc-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 30px rgba(200, 169, 110, 0.55);
}
.sc-fab:active {
  transform: scale(0.96);
}
.sc-fab svg {
  width: 24px;
  height: 24px;
}

.sc-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #e05c5c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #111;
  animation: sc-pulse 2.2s infinite;
}
@keyframes sc-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

/* ── Panel ──────────────────────────────────────────────────────── */
.sc-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: calc(var(--sc-z) - 1);
  width: var(--sc-w);
  height: var(--sc-h);
  background: var(--sc-bg);
  border-radius: var(--sc-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
  /* Hidden state */
  transform: scale(0.91) translateY(14px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.52, 0.64, 1),
    opacity 0.2s ease;
}
.sc-panel.sc-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ─────────────────────────────────────────────────────── */
.sc-panel-header {
  background: var(--sc-surface);
  border-bottom: 1px solid var(--sc-border);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.sc-panel-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sc-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  color: #0e0e0e;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(200, 169, 110, 0.3);
}
.sc-panel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.sc-panel-info {
  flex: 1;
  min-width: 0;
}
.sc-panel-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--sc-text);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-panel-sub {
  font-size: 10.5px;
  color: var(--sc-accent);
  letter-spacing: 0.04em;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-online-dot {
  width: 8px;
  height: 8px;
  background: #4caf73;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Progress ───────────────────────────────────────────────────── */
.sc-progress-wrap {
  border-bottom: 1px solid var(--sc-border);
  padding: 7px 16px 9px;
  flex-shrink: 0;
}
.sc-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--sc-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.sc-progress-track {
  background: var(--sc-surface2);
  border-radius: 4px;
  height: 3px;
  overflow: hidden;
}
.sc-progress-fill {
  height: 100%;
  background: var(--sc-accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

/* ── Messages ───────────────────────────────────────────────────── */
.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 9px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scroll-behavior: smooth;
}
.sc-messages::-webkit-scrollbar {
  width: 4px;
}
.sc-messages::-webkit-scrollbar-track {
  background: transparent;
}
.sc-messages::-webkit-scrollbar-thumb {
  background: var(--sc-border2);
  border-radius: 4px;
}

/* Bubbles */
.sc-bubble {
  max-width: 100%;
  padding: 6px 9px;
  font-size: 13px;
  letter-spacing: -0.3px;
  font-weight: 600;
  line-height: 1.41;
  animation: sc-pop 0.22s ease;
}
@keyframes sc-pop {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.sc-bubble.sc-bot {
  background: #f1f1f1;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.sc-bubble.sc-user {
  background: var(--sc-user-bg);
  color: var(--sc-user-text);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  font-weight: 500;
}
/* .sc-bubble strong {
  color: var(--sc-accent);
} */
.sc-bubble.sc-user strong {
  color: var(--sc-user-text);
}
.sc-bubble em {
  color: var(--sc-muted);
  font-style: italic;
}

/* Typing indicator */
.sc-typing {
  align-self: flex-start;
  background: var(--sc-bot-bg);
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 12px 15px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.sc-typing span {
  width: 7px;
  height: 7px;
  background: var(--sc-muted);
  border-radius: 50%;
  animation: sc-bounce 1.25s infinite;
}
.sc-typing span:nth-child(2) {
  animation-delay: 0.18s;
}
.sc-typing span:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes sc-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

/* ── Chips ──────────────────────────────────────────────────────── */
.sc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 3px 9px;
  flex-shrink: 0;
}
.sc-chip {
  background: var(--sc-surface2);
  border: 1px solid var(--sc-border2);
  color: var(--sc-text);
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
  font-family: inherit;
}
.sc-chip:hover {
  background: var(--sc-accent-dim);
  border-color: var(--sc-accent);
  color: var(--sc-accent);
  transform: translateY(-1px);
}
.sc-chip:active {
  transform: scale(0.97);
}

/* ── Input area ─────────────────────────────────────────────────── */
.sc-input-area {
  border-top: 1px solid var(--sc-border);
  padding: 10px 11px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #f1f1f1;
  flex-shrink: 0;
}
.sc-textarea {
  flex: 1;
  background: #e6e6e6;
  border: 1px solid var(--sc-border2);
  border-radius: 10px;
  font-size: 13px;
  padding: 9px 11px;
  resize: none;
  outline: none;
  font-family: inherit;
  line-height: 1.45;
  min-height: 38px;
  max-height: 100px;
  transition: border-color 0.15s;
}
.sc-textarea::placeholder {
  color: var(--sc-muted);
}
.sc-textarea:focus {
  border-color: var(--sc-accent);
}
.sc-send-btn {
  width: 38px;
  height: 38px;
  background: var(--sc-accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0e0e0e;
  transition: background 0.15s, transform 0.1s;
}
.sc-send-btn:hover {
  background: #d9ba80;
}
.sc-send-btn:active {
  transform: scale(0.94);
}
.sc-send-btn svg {
  width: 18px;
  height: 18px;
}
.sc-send-btn:disabled {
  background: #e6e6e6;
  cursor: not-allowed;
  color: #f1f1f1;
  opacity: 0.45;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.sc-restart-btn {
  background: none;
  border: 1px solid var(--sc-border);
  color: var(--sc-muted);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  margin: 0 auto 7px;
  display: block;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s;
}
.sc-restart-btn:hover {
  color: var(--sc-text);
  border-color: var(--sc-muted);
}
.sc-footer-tag {
  text-align: center;
  font-size: 9px;
  color: var(--sc-muted);
  padding: 0 0 9px;
  background: #f1f1f1;
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 440px) {
  :root {
    --sc-w: calc(78vw - 24px);
  }
  .sc-panel {
    right: 12px;
    bottom: 86px;
  }
  .sc-fab {
    right: 16px;
    bottom: 16px;
  }
}
