/* Live support chat widget (site-wide, separate from psychic chat.php) */
#starz-support-chat-root {
  position: fixed !important;
  right: 18px;
  bottom: 48px; /* raised ~30px from original 18px */
  left: auto;
  top: auto;
  z-index: 99990 !important;
  width: auto;
  height: auto;
  max-width: none;
  overflow: visible;
  font-family: 'Roboto', 'Open Sans', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: none; /* only launcher/panel receive clicks */
}

#starz-support-chat-root .starz-support-chat__launcher,
#starz-support-chat-root .starz-support-chat__panel {
  pointer-events: auto;
}

.starz-support-chat__launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 8px 28px rgba(52, 84, 174, 0.45);
  background: linear-gradient(135deg, #7C45CA 0%, #3454AE 100%);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Keep launcher visible whenever the panel is closed */
#starz-support-chat-root:not(.is-open) .starz-support-chat__launcher {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.starz-support-chat__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(52, 84, 174, 0.55);
}

.starz-support-chat__launcher i {
  font-size: 18px;
}

.starz-support-chat__panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 100px));
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(124, 69, 202, 0.2);
}

#starz-support-chat-root.is-open .starz-support-chat__panel {
  display: flex;
}

#starz-support-chat-root.is-open .starz-support-chat__launcher {
  display: none;
}

.starz-support-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #7C45CA 0%, #3454AE 100%);
}

.starz-support-chat__head-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}

.starz-support-chat__head-sub {
  font-size: 12px;
  opacity: 0.9;
  margin: 2px 0 0;
}

.starz-support-chat__head-actions button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
}

.starz-support-chat__head-actions button:hover {
  opacity: 1;
}

.starz-support-chat__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f7f5fc;
}

.starz-support-chat__start {
  padding: 16px;
  overflow-y: auto;
}

.starz-support-chat__start label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #444;
}

.starz-support-chat__start input,
.starz-support-chat__start textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.starz-support-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: none;
}

.starz-support-chat__messages.is-active {
  display: block;
}

.starz-support-chat__msg {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  word-break: break-word;
  white-space: pre-wrap;
}

.starz-support-chat__msg--customer {
  margin-left: auto;
  background: linear-gradient(135deg, #7C45CA 0%, #3454AE 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.starz-support-chat__msg--admin {
  margin-right: auto;
  background: #fff;
  color: #222;
  border: 1px solid #e8e4f2;
  border-bottom-left-radius: 4px;
}

.starz-support-chat__msg--system {
  margin: 0 auto 10px;
  max-width: 95%;
  text-align: center;
  font-size: 12px;
  color: #666;
  background: transparent;
  padding: 4px 8px;
}

.starz-support-chat__msg-time {
  display: block;
  font-size: 10px;
  opacity: 0.75;
  margin-top: 4px;
}

.starz-support-chat__status-bar {
  padding: 8px 12px;
  font-size: 12px;
  text-align: center;
  color: #555;
  background: #ede8f8;
  border-bottom: 1px solid #e0d8f0;
}

.starz-support-chat__compose {
  display: none;
  padding: 10px;
  border-top: 1px solid #e8e4f2;
  background: #fff;
  gap: 8px;
}

.starz-support-chat__compose.is-active {
  display: flex;
}

.starz-support-chat__compose textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 100px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.starz-support-chat__send {
  align-self: flex-end;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #7C45CA 0%, #3454AE 100%);
}

.starz-support-chat__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.starz-support-chat__btn-primary {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #7C45CA 0%, #3454AE 100%);
}

.starz-support-chat__error {
  color: #c0392b;
  font-size: 12px;
  margin: 0 0 8px;
}

@media (max-width: 480px) {
  #starz-support-chat-root {
    right: 12px;
    bottom: 48px;
  }
  .starz-support-chat__launcher span {
    display: none;
  }
  .starz-support-chat__launcher {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}
