/* ==========================================================
   phpshore AI support chat widget
   ========================================================== */

.psc-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--cyan, #00aeef);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 174, 239, 0.45);
  display: grid;
  place-items: center;
  transition: transform 0.2s, background 0.2s;
}

.psc-launcher:hover { transform: scale(1.08); background: var(--cyan-dark, #0090c5); }

.psc-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 91;
  width: min(370px, calc(100vw - 32px));
  height: min(540px, calc(100vh - 130px));
  background: #fff;
  border: 1px solid var(--line, #e1edf4);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(22, 48, 62, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.psc-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.psc-header {
  background: linear-gradient(120deg, var(--cyan, #00aeef), #0090c5);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.psc-header-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7dff9b;
  box-shadow: 0 0 0 3px rgba(125, 255, 155, 0.3);
}

.psc-header h3 { font-size: 1rem; margin: 0; }

.psc-header p { font-size: 0.75rem; margin: 0; opacity: 0.85; }

.psc-close {
  margin-left: auto;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.psc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-alt, #f2f9fd);
}

.psc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.psc-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line, #e1edf4);
  border-bottom-left-radius: 4px;
  color: var(--ink, #16303e);
}

.psc-msg.user {
  align-self: flex-end;
  background: var(--cyan, #00aeef);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.psc-msg.error {
  align-self: flex-start;
  background: #fdf0f0;
  border: 1px solid #f3cfcf;
  color: #a33;
}

.psc-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line, #e1edf4);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.psc-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan, #00aeef);
  animation: psc-bounce 1.2s infinite;
}

.psc-typing i:nth-child(2) { animation-delay: 0.15s; background: var(--gold, #ffc20e); }
.psc-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes psc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.psc-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line, #e1edf4);
  background: #fff;
}

.psc-input-row textarea {
  flex: 1;
  resize: none;
  font: inherit;
  font-size: 0.92rem;
  border: 1px solid var(--line, #e1edf4);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 90px;
  background: var(--bg-alt, #f2f9fd);
}

.psc-input-row textarea:focus {
  outline: none;
  border-color: var(--cyan, #00aeef);
  background: #fff;
}

.psc-send {
  border: 0;
  border-radius: 10px;
  background: var(--cyan, #00aeef);
  color: #fff;
  font-size: 1.1rem;
  width: 44px;
  cursor: pointer;
  transition: background 0.2s;
}

.psc-send:hover { background: var(--cyan-dark, #0090c5); }

.psc-send[disabled] { opacity: 0.5; cursor: wait; }

.psc-footnote {
  text-align: center;
  font-size: 0.68rem;
  color: #9ab4c2;
  padding: 0 12px 8px;
  background: #fff;
}

@media (max-width: 480px) {
  .psc-panel { right: 16px; bottom: 88px; }
  .psc-launcher { right: 16px; bottom: 16px; }
}
