
/* ================================================
   HIPPO AI ASSISTANT — NEW INTERFACE
   Compatible with V1.2.0
   ================================================ */

.hippo-ai-root {
  --hippo-navy: #003758;
  --hippo-purple: #6A255B;
  --hippo-cyan: #00ABE4;
  --hippo-text: #243343;

  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1.6;
  z-index: 999999;
}

.hippo-ai-root *,
.hippo-ai-root *::before,
.hippo-ai-root *::after {
  box-sizing: border-box;
}

/* Floating position */

.hippo-ai-root[data-mode="floating"] {
  position: fixed;
  right: 24px;
  bottom: 24px;
}

/* Floating launcher with mascot */

.hippo-ai-launch {
  display: flex;
  align-items: center;
  gap: 8px;

  position: relative;
  padding: 12px 22px;
  min-height: 51px;

  border: 2px solid #fff;
  border-radius: 40px;
  background: var(--hippo-purple);
  color: #fff;

  font: 700 15px 'Roboto', Arial, sans-serif;
  cursor: pointer;

  box-shadow: 0 8px 25px rgba(38, 20, 40, .24);
  transition:
    transform .25s ease,
    box-shadow .25s ease;
}

.hippo-ai-launch:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(38, 20, 40, .3);
}

.hippo-ai-launch-mascot {
  position: absolute;
  width: 93px;
  height: 110px;
  object-fit: contain;
  object-position: bottom;

  bottom: 33px;
  left: 6px;
  pointer-events: none;

  filter: drop-shadow(0 3px 3px rgba(0,0,0,.09));

  transition: transform .3s ease;
}

.hippo-ai-launch:hover .hippo-ai-launch-mascot {
  transform: rotate(-5deg) translateY(-5px);
}

.hippo-ai-launch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hippo-ai-launch-label {
  position: relative;
  z-index: 1;
}

/* Chat window */

.hippo-ai-panel {
  display: flex;
  flex-direction: column;

  width: 400px;
  height: 590px;
  max-width: calc(100vw - 24px);
  max-height: min(82vh, 680px);

  overflow: hidden;

  background: #fff;
  color: var(--hippo-text);

  border: 1px solid #e0e5eb;
  border-radius: 22px;

  box-shadow:
    0 20px 50px rgba(0, 30, 55, .19),
    0 5px 14px rgba(0, 30, 55, .07);
}

.hippo-ai-panel[hidden] {
  display: none !important;
}

.hippo-ai-root[data-mode="floating"] .hippo-ai-panel {
  position: absolute;
  right: 0;
  bottom: 75px;
}

.hippo-ai-root[data-mode="inline"] .hippo-ai-launch {
  display: none;
}

/* Header */

.hippo-ai-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;

  min-height: 86px;
  padding: 12px 17px;

  background: var(--hippo-navy);
  color: #fff;
}

.hippo-ai-head-mascot {
  width: 61px;
  height: 61px;
  flex-shrink: 0;

  object-fit: contain;
  object-position: center bottom;
}

.hippo-ai-head-info {
  min-width: 0;
  flex: 1;
}

.hippo-ai-head-info strong {
  display: block;
  margin-bottom: 2px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}

.hippo-ai-head-info small {
  display: block;
  color: #d3e7f0;
  font-size: 12px;
  font-weight: 400;
}

.hippo-ai-close {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 34px;
  height: 34px;
  flex-shrink: 0;

  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;

  font: 400 26px/1 Arial, sans-serif;
  cursor: pointer;
}

.hippo-ai-close:hover {
  background: rgba(255, 255, 255, .12);
}

/* Message scroll area */

.hippo-ai-messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;

  padding: 18px 14px;
  overflow-y: auto;
  overflow-x: hidden;

  background: #f8fafd;
  overscroll-behavior: contain;
}

.hippo-ai-messages::-webkit-scrollbar {
  width: 6px;
}

.hippo-ai-messages::-webkit-scrollbar-thumb {
  background: #d0d9e2;
  border-radius: 10px;
}

/* Message rows */

.hippo-ai-message-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  min-width: 0;
}

.hippo-ai-message-row.model {
  justify-content: flex-start;
}

.hippo-ai-message-row.user {
  justify-content: flex-end;
}

/* Mascot avatar */

.hippo-ai-avatar {
  width: 33px;
  height: 33px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border-radius: 50%;
  background: #e9f3ff;
  border: 1px solid #d9e8f9;
}

.hippo-ai-avatar img {
  width: 35px;
  height: 41px;
  margin-top: 7px;
  object-fit: contain;
}

/* Chat bubbles */

.hippo-ai-msg {
  min-width: 0;
  max-width: calc(100% - 44px);
  padding: 13px 15px;

  overflow-wrap: anywhere;

  border-radius: 17px;

  font-size: 14px;
  line-height: 1.65;

  box-shadow: 0 3px 12px rgba(0,0,0,.045);
}

.hippo-ai-msg.model {
  background: #fff;
  color: var(--hippo-text);
  border: 1px solid #e5eaf0;
  border-top-left-radius: 6px;
}

.hippo-ai-msg.user {
  background: var(--hippo-purple);
  color: #fff;
  border: 0;
  border-top-right-radius: 6px;
  white-space: pre-wrap;
}

/* Markdown content */

.hippo-ai-msg.model p {
  margin: 0 0 11px;
}

.hippo-ai-msg.model p:last-child {
  margin-bottom: 0;
}

.hippo-ai-msg.model strong {
  font-weight: 700;
  color: var(--hippo-navy);
}

.hippo-ai-msg.model em {
  font-style: italic;
}

.hippo-ai-msg.model ul,
.hippo-ai-msg.model ol {
  margin: 10px 0 13px;
  padding-left: 23px;
  list-style-position: outside;
}

.hippo-ai-msg.model ul {
  list-style-type: disc;
}

.hippo-ai-msg.model ol {
  list-style-type: decimal;
}

.hippo-ai-msg.model li {
  display: list-item;
  padding-left: 3px;
  margin: 0 0 9px;
  line-height: 1.6;
}

.hippo-ai-msg.model li:last-child {
  margin-bottom: 0;
}

.hippo-ai-msg.model li::marker {
  color: var(--hippo-purple);
  font-weight: 800;
}

.hippo-ai-msg.model a {
  color: var(--hippo-purple);
  font-weight: 700;

  text-decoration: underline;
  text-underline-offset: 3px;

  overflow-wrap: anywhere;
}

.hippo-ai-msg.model a:hover {
  color: var(--hippo-navy);
}

.hippo-ai-msg.model h3,
.hippo-ai-msg.model h4 {
  margin: 12px 0 8px;
  color: var(--hippo-navy);
  line-height: 1.35;
  font-weight: 800;
}

.hippo-ai-msg.model h3 {
  font-size: 15px;
}

.hippo-ai-msg.model h4 {
  font-size: 14px;
}

.hippo-ai-msg.model code {
  padding: 2px 5px;
  background: #eef2f6;
  color: var(--hippo-navy);
  border-radius: 4px;
  font-size: .93em;
}

.hippo-ai-msg.model hr {
  border: 0;
  border-top: 1px solid #e5eaf0;
  margin: 12px 0;
}

/* Loading state */

.hippo-ai-msg.is-loading {
  color: #788593;
  font-style: italic;
}

/* Input */

.hippo-ai-form {
  display: flex;
  align-items: center;
  gap: 10px;

  flex-shrink: 0;
  padding: 13px 14px 9px;

  border-top: 1px solid #e8edf2;
  background: #fff;
}

.hippo-ai-input {
  flex: 1;
  min-width: 0;
  height: 43px;

  padding: 10px 15px;

  border: 1px solid #d7dfe7;
  border-radius: 25px;

  outline: none;
  background: #fff;
  color: #182a3c;

  font: 400 14px 'Roboto', Arial, sans-serif;

  transition:
    border-color .2s ease,
    box-shadow .2s ease;
}

.hippo-ai-input:focus {
  border-color: var(--hippo-purple);
  box-shadow: 0 0 0 3px rgba(106,37,91,.1);
}

.hippo-ai-input::placeholder {
  color: #8693a1;
}

.hippo-ai-form button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
  width: 43px;
  height: 43px;

  padding: 0;
  border: 0;
  border-radius: 50%;

  background: var(--hippo-purple);
  color: #fff;

  cursor: pointer;

  transition:
    background .2s ease,
    transform .2s ease;
}

.hippo-ai-form button[type="submit"]:hover {
  background: var(--hippo-navy);
  transform: translateY(-1px);
}

.hippo-ai-form button[type="submit"]:disabled {
  opacity: .5;
  cursor: wait;
}

.hippo-ai-send-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Disclaimer */

.hippo-ai-foot {
  flex-shrink: 0;
  padding: 0 12px 11px;
  background: #fff;
  color: #7c8b9b;
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
}

/* Accessibility */

.hippo-ai-root button:focus-visible,
.hippo-ai-root a:focus-visible {
  outline: 2px solid var(--hippo-cyan);
  outline-offset: 3px;
}

/* Mobile */

@media (max-width: 600px) {

  .hippo-ai-root[data-mode="floating"] {
    right: 12px;
    bottom: 12px;
  }

  .hippo-ai-root[data-mode="floating"] .hippo-ai-panel {
    width: calc(100vw - 24px);
    height: min(78dvh, 630px);
    max-height: calc(100dvh - 105px);
    right: 0;
    bottom: 76px;
    border-radius: 18px;
  }

  .hippo-ai-head {
    min-height: 77px;
    padding: 10px 13px;
  }

  .hippo-ai-head-mascot {
    width: 52px;
    height: 52px;
  }

  .hippo-ai-head-info strong {
    font-size: 16px;
  }

  .hippo-ai-head-info small {
    font-size: 11px;
  }

  .hippo-ai-messages {
    padding: 14px 10px;
    gap: 12px;
  }

  .hippo-ai-msg {
    padding: 11px 12px;
    font-size: 13.5px;
  }

  .hippo-ai-form {
    padding: 10px 10px 8px;
  }

  .hippo-ai-launch {
    min-height: 46px;
    padding: 10px 18px;
    font-size: 14px;
  }

  .hippo-ai-launch-mascot {
    width: 76px;
    height: 92px;
    bottom: 30px;
  }
}

@media (max-height: 520px) {
  .hippo-ai-root[data-mode="floating"] .hippo-ai-panel {
    max-height: calc(100dvh - 95px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hippo-ai-root *,
  .hippo-ai-root *::before,
  .hippo-ai-root *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
