/* Seanergya Assistant Widget – Claudiu */
:root {
  --sea-navy:    #0A2F4B;
  --sea-red:     #E8212E;
  --sea-ocean:   #30c4da;
  --sea-seafoam: #5DC5CA;
  --sea-baby:    #D0EDF3;
  --sea-grey:    #4d5968;
  --sea-ast-radius: 12px;
  --sea-ast-shadow: 0 8px 32px rgba(10,47,75,0.28);
  --sea-ast-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#sea-ast-wrapper {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 99999;
  font-family: var(--sea-ast-font);
}

/* ── Toggle button ── */
#sea-ast-toggle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--sea-navy);
  border: 3px solid var(--sea-red);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sea-ast-shadow);
  transition: transform .2s, box-shadow .2s;
  padding: 0;
  position: relative;
}
#sea-ast-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(10,47,75,0.4);
  border-color: var(--sea-ocean);
}
/* Ancora SVG inline via background */
#sea-ast-toggle svg {
  width: 30px;
  height: 30px;
  color: var(--sea-ocean);
}

/* ── Chat window ── */
#sea-ast-window {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: 370px;
  max-height: 540px;
  background: #fff;
  border-radius: var(--sea-ast-radius);
  box-shadow: var(--sea-ast-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sea-ast-slide-up .22s ease;
  border-top: 3px solid var(--sea-red);
}
#sea-ast-window[hidden] { display: none; }

@keyframes sea-ast-slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
#sea-ast-header {
  background: var(--sea-navy);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
#sea-ast-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Avatar ancora in header */
#sea-ast-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sea-ocean);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#sea-ast-avatar svg {
  width: 20px;
  height: 20px;
  color: var(--sea-navy);
}
#sea-ast-header-info {
  display: flex;
  flex-direction: column;
}
#sea-ast-header-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
}
#sea-ast-header-sub {
  font-size: 11px;
  color: var(--sea-ocean);
  margin-top: 1px;
}
#sea-ast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  margin-left: auto;
  transition: color .15s;
}
#sea-ast-close:hover { color: #fff; }

/* ── Messages ── */
#sea-ast-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  background: #f7fafc;
}

.sea-ast-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.sea-ast-msg.user {
  background: var(--sea-navy);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.sea-ast-msg.assistant {
  background: var(--sea-baby);
  color: var(--sea-navy);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--sea-ocean);
}

/* ── Markdown in assistant messages ── */
.sea-ast-msg.assistant p { margin: 0 0 8px; }
.sea-ast-msg.assistant p:last-child { margin-bottom: 0; }
.sea-ast-msg.assistant strong { font-weight: 700; }
.sea-ast-msg.assistant em { font-style: italic; }
.sea-ast-msg.assistant ul,
.sea-ast-msg.assistant ol { margin: 4px 0 8px 18px; padding: 0; }
.sea-ast-msg.assistant li { margin-bottom: 3px; }
.sea-ast-msg.assistant hr { border: none; border-top: 1px solid var(--sea-ocean); margin: 8px 0; opacity: .4; }
.sea-ast-msg.assistant a { color: var(--sea-ocean); text-decoration: underline; }
.sea-ast-msg.assistant a:hover { color: var(--sea-navy); }
.sea-ast-table { border-collapse: collapse; margin: 6px 0 8px; font-size: 12px; width: 100%; }
.sea-ast-table td { border: 1px solid rgba(10,47,75,.15); padding: 4px 8px; }

/* ── Typing indicator ── */
.sea-ast-typing {
  display: flex;
  gap: 5px;
  padding: 12px 14px;
  background: var(--sea-baby);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--sea-ocean);
  width: fit-content;
}
.sea-ast-typing span {
  width: 7px;
  height: 7px;
  background: var(--sea-ocean);
  border-radius: 50%;
  animation: sea-ast-bounce 1.2s infinite;
}
.sea-ast-typing span:nth-child(2) { animation-delay: .2s; }
.sea-ast-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sea-ast-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ── Lead form ── */
#sea-ast-lead-form {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--sea-baby);
  background: #f0f8fa;
  position: relative;
}
#sea-ast-lead-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color .15s;
}
#sea-ast-lead-close:hover { color: var(--sea-navy); }
.sea-ast-lead-title {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sea-navy);
  padding-right: 24px;
}
.sea-ast-lead-sub {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--sea-grey);
  line-height: 1.5;
}
#sea-ast-lead-form input {
  width: 100%;
  border: 1px solid #c5dde3;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 6px;
  box-sizing: border-box;
  outline: none;
}
#sea-ast-lead-form input:focus { border-color: var(--sea-ocean); }
#sea-ast-lead-submit {
  background: var(--sea-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: background .15s;
}
#sea-ast-lead-submit:hover { background: #c41c28; }

/* ── Footer / input ── */
#sea-ast-footer {
  padding: 10px 12px;
  border-top: 1px solid #e0edf0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
}
#sea-ast-input {
  flex: 1;
  border: 1px solid #c5dde3;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  resize: none;
  font-family: var(--sea-ast-font);
  outline: none;
  max-height: 100px;
  overflow-y: auto;
  color: var(--sea-navy);
}
#sea-ast-input:focus { border-color: var(--sea-ocean); }
#sea-ast-send {
  background: var(--sea-red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
#sea-ast-send:hover { background: #c41c28; }
#sea-ast-send:disabled { opacity: .4; cursor: default; }

/* ── Mobile ── */
@media (max-width: 480px) {
  #sea-ast-window {
    width: calc(100vw - 32px);
    right: -8px;
  }
}
