/* AI Site Helper - widget styles. Blue/white theme, small footprint. */

.aih-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #1a1a1a;
}
.aih-root * { box-sizing: border-box; }

/* Floating button */
.aih-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #046bd2;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px 12px 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(11, 79, 138, 0.35);
  font-size: 15px;
  font-weight: 600;
}
.aih-button:hover { background: #0b4f8a; }
.aih-button.aih-hidden { display: none; }
/* Long label on wide screens, short label on small screens */
.aih-button-text-short { display: none; }

/* Panel */
.aih-panel {
  display: none;
  flex-direction: column;
  width: 340px;
  max-width: calc(100vw - 24px);
  height: 480px;
  max-height: calc(100vh - 32px);
  background: #ffffff;
  border: 1px solid #d7e3f0;
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(11, 79, 138, 0.28);
  overflow: hidden;
}
.aih-panel.aih-open { display: flex; }

.aih-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0b4f8a;
  color: #ffffff;
  padding: 10px 14px;
}
.aih-title { font-weight: 700; font-size: 16px; }
.aih-subtitle { font-size: 12px; opacity: 0.85; }
.aih-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.aih-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f4f8fc;
}
.aih-msg { display: flex; margin-bottom: 10px; }
.aih-msg-user { justify-content: flex-end; }
.aih-bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.aih-msg-bot .aih-bubble {
  background: #ffffff;
  border: 1px solid #d7e3f0;
  border-bottom-left-radius: 4px;
}
.aih-msg-user .aih-bubble {
  background: #046bd2;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.aih-typing .aih-bubble { color: #5a6b7d; font-style: italic; }

.aih-note {
  padding: 7px 12px;
  font-size: 11.5px;
  color: #5a6b7d;
  background: #eef4fa;
  border-top: 1px solid #d7e3f0;
}

.aih-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #d7e3f0;
}
.aih-input {
  flex: 1;
  border: 1px solid #b9cfe4;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 15px;
  min-width: 0;
}
.aih-input:focus { outline: 2px solid #046bd2; outline-offset: 0; border-color: #046bd2; }
.aih-send {
  background: #046bd2;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.aih-send:hover { background: #0b4f8a; }
.aih-send:disabled, .aih-input:disabled { opacity: 0.55; cursor: default; }

/* Small screens: panel uses the full width and most of the height */
@media (max-width: 480px) {
  .aih-root { right: 12px; bottom: 12px; }
  .aih-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
  }
  .aih-button-text-full { display: none; }
  .aih-button-text-short { display: inline; }
}
