/* NoraCMS public chat widget — floating bottom-right assistant. */

.nora-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0081e9;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(0,129,233,0.35), 0 2px 8px rgba(0,0,0,0.1);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nora-chat-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 28px rgba(0,129,233,0.45);
}
.nora-chat-launcher.is-open { transform: scale(0.92); }

.nora-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: none;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #111;
}
.nora-chat-panel.is-open { display: flex; }

.nora-chat-header {
  background: #0081e9;
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nora-chat-header .nora-chat-title { font-weight: 700; font-size: 0.95rem; }
.nora-chat-header .nora-chat-sub   { font-size: 0.75rem; opacity: 0.85; margin-top: 2px; }
.nora-chat-header .nora-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.85;
}
.nora-chat-header .nora-chat-close:hover { opacity: 1; }

.nora-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
.nora-chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.nora-chat-msg.user {
  align-self: flex-end;
  background: #0081e9;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.nora-chat-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: #111;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.nora-chat-msg.assistant a { color: #0081e9; }
.nora-chat-typing {
  align-self: flex-start;
  font-size: 0.85rem;
  color: #64748b;
  padding: 6px 12px;
  font-style: italic;
}

.nora-chat-form {
  border-top: 1px solid #e2e8f0;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #fff;
}
.nora-chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  color: #111;
  background: #fff;
}
.nora-chat-form textarea:focus { border-color: #0081e9; }
.nora-chat-form button {
  background: #0081e9;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  height: 40px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.nora-chat-form button:hover { background: #0066bb; }
.nora-chat-form button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .nora-chat-panel {
    bottom: 0; right: 0; left: 0;
    width: 100%; max-width: none;
    height: 100vh; max-height: 100vh;
    border-radius: 0;
  }
  .nora-chat-launcher { bottom: 16px; right: 16px; }
}
