/******************************************************************
 * AI Chat — FRONTEND STYLES (EMBED MODE ONLY – NO BUBBLE, NO FLOAT)
 ******************************************************************/

/* Base */
.aichat-widget, .aichat-widget * {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.45;
}

/* ===========================================================
   🔥 EMBED MODE OVERRIDE
   – Disable ALL bubble/floating/minimized behavior
   – Force chat to behave as full embedded panel like ChatGPT
   =========================================================== */

/* Disable ALL fixed-position floating widgets */
.aichat-widget.is-global {
  position: relative !important;
  width: 100% !important;
  max-width: 900px !important;
  margin: 2rem auto !important;
  inset: unset !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  top: auto !important;
}

/* Remove positioning classes entirely */
.aichat-widget.is-global.pos-bottom-right,
.aichat-widget.is-global.pos-bottom-left,
.aichat-widget.is-global.pos-top-right,
.aichat-widget.is-global.pos-top-left {
  position: relative !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
}

/* Prevent fallback floating */
.aichat-widget.is-global:not(.pos-bottom-right):not(.pos-bottom-left):not(.pos-top-right):not(.pos-top-left) {
  position: relative !important;
  inset: unset !important;
}

/* Always act like embedded mode */
.aichat-widget,
.aichat-widget:not(.is-global) {
  position: relative !important;
  width: 100% !important;
  max-width: 900px !important;
  margin: 2rem auto !important;
}

/* Disable drag mode */
.aichat-widget.is-global.is-draggable .aichat-header {
  cursor: default !important;
}
.aichat-widget.dragging { opacity: 1 !important; box-shadow: none !important; }

/* Disable minimized & super minimized completely */
.aichat-inner.is-minimized .aichat-messages,
.aichat-inner.is-minimized .aichat-inputbar {
  display: flex !important;
}
.aichat-inner.is-minimized {
  border-radius: 10px !important;
}

.aichat-widget.is-superminimized {
  width: 100% !important;
  height: auto !important;
  min-width: 100% !important;
  min-height: auto !important;
}
.aichat-super-avatar { display: none !important; }

/* Disable maximize full-screen UI */
.aichat-widget.is-global.is-maximized {
  inset: unset !important;
  width: 100% !important;
  height: auto !important;
  max-width: 900px !important;
}

/* =========================================================== */


/* Card */
.aichat-inner {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  position: relative;
}

/* Header */
.aichat-header {
  background: #0073aa;
  color: #fff;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.aichat-header.with-avatar {
  padding-left: 84px;
  min-height: 72px;
}

.aichat-avatar-badge {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.aichat-header-text {
  display: flex;
  flex-direction: column;
}

.aichat-header-title {
  color: rgba(255,255,255,.9);
  font-weight: 700;
}

.aichat-header-subtitle {
  color: rgba(255,255,255,.85);
  font-size: 12.5px;
}

/* Header controls (minimize/maximize/close) – disabled visually */
.aichat-header-controls { display: none !important; }

/* Messages */
.aichat-messages {
  padding: 12px 14px;
  overflow-y: auto;
  background: #fff;
  min-height: 260px;
}

/* Bubbles */
.message {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 8px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.user-message {
  background: #e1f5fe;
  margin-left: 20%;
}
.bot-message {
  background: #f5f5f5;
  margin-right: 20%;
}

/* Input bar */
.aichat-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
}

.aichat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.aichat-send {
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: #0073aa;
  color: #fff;
  font-weight: 600;
}

/* Typing indicator */
.message.typing { background: #f5f5f5; opacity: .7; }

/* Responsive */
@media (max-width: 600px) {
  .aichat-widget {
    max-width: 100% !important;
    margin: 1rem 0 !important;
  }
}
