/* Companion styles for MultiRL + Tailwind (chat bubbles, motion, prose). */

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
  color: #232248;
  background: #f2f4f7;
  -webkit-font-smoothing: antialiased;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-rise {
  animation: rise 0.45s ease both;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.15rem 1rem;
  min-height: 280px;
  max-height: calc(100vh - 16rem);
}

.bubble {
  max-width: min(42rem, 92%);
  padding: 0.85rem 1.05rem;
  border-radius: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  animation: rise 0.3s ease both;
  font-size: 0.95rem;
}

.bubble.user {
  align-self: flex-end;
  background: #232248;
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}

.bubble.assistant {
  align-self: flex-start;
  background: #fff;
  color: #232248;
  border: 1px solid #e2e6ee;
  border-bottom-left-radius: 0.35rem;
  box-shadow: 0 4px 24px -8px rgba(35, 34, 72, 0.12);
}

.bubble.assistant a.chat-link {
  color: #2f7fb8;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bubble.assistant a.chat-link:hover {
  color: #459ddd;
}

.bubble.system {
  align-self: center;
  background: transparent;
  color: #4b5563;
  font-size: 0.875rem;
  text-align: center;
  border: 0;
  box-shadow: none;
}

.bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: min(42rem, 92%);
  animation: rise 0.3s ease both;
}

.bubble-wrap.user-wrap {
  align-self: flex-end;
  align-items: flex-end;
}

.bubble-wrap .bubble {
  max-width: 100%;
  animation: none;
}

.bubble-actions {
  display: flex;
  gap: 0.35rem;
  opacity: 0.85;
}

.bubble-btn {
  border: 1px solid #e2e6ee;
  background: #fff;
  color: #459ddd;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bubble-btn:hover {
  background: #e8f4fc;
  border-color: #459ddd;
  color: #2f7fb8;
}

#edit-banner:not([hidden]) {
  display: flex;
}

.prose-panel {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #4b5563;
}

code {
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: #e8f4fc;
  color: #232248;
}

/* docx-preview inside modal */
.preview-scroll .docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
}

.preview-scroll .docx {
  box-shadow: 0 8px 30px -12px rgba(35, 34, 72, 0.25);
  margin-bottom: 1.25rem !important;
}

.bubble.process {
  border-style: dashed;
  background: #f7fbfe;
}

.process-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.process-now {
  font-size: 0.9rem;
  font-weight: 650;
}

.process-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
}

.process-log {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  color: #4b5563;
  font-size: 0.8rem;
  line-height: 1.45;
}

.process-dots {
  display: inline-flex;
  gap: 4px;
}

.process-dots i {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: #459ddd;
  animation: process-bounce 1s ease-in-out infinite;
}

.process-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.process-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes process-bounce {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* API reference */
.api-wrap {
  max-width: 58rem;
}

.api-kicker {
  letter-spacing: 0.16em;
}

.api-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.api-toc a {
  border: 1px solid #e2e6ee;
  background: #fff;
  color: #4b5563;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.api-toc a:hover,
.api-toc a:focus-visible {
  border-color: #459ddd;
  color: #2f7fb8;
  background: #e8f4fc;
}

.api-card {
  background: #fff;
  border: 1px solid #e2e6ee;
  border-radius: 1.15rem;
  box-shadow: 0 10px 40px -18px rgba(35, 34, 72, 0.18);
  overflow: hidden;
}

.api-card-pad {
  padding: 1.35rem 1.5rem;
}

@media (min-width: 640px) {
  .api-card-pad {
    padding: 1.6rem 1.85rem;
  }
}

.api-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #232248;
  letter-spacing: -0.02em;
}

.api-endpoint-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.35rem;
  background: linear-gradient(180deg, #f7fbfe 0%, #f2f4f7 100%);
  border-bottom: 1px solid #e2e6ee;
}

.api-method {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.55rem;
  border-radius: 0.4rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.api-method.post {
  background: #459ddd;
  color: #fff;
}

.api-method.get {
  background: #232248;
  color: #fff;
}

.api-path {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  font-weight: 500;
  color: #232248;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.api-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #e2e6ee;
}

.api-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
  color: #4b5563;
}

.api-table tr:last-child td {
  border-bottom: 0;
}

.api-table code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}

.api-code {
  position: relative;
  background: #1a1935;
  color: #d9effc;
  border-radius: 0.9rem;
  overflow: hidden;
}

.api-code-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem 0.15rem 1rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7cc7f5;
}

.api-code pre {
  margin: 0;
  padding: 0.55rem 1rem 1rem;
  overflow-x: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre;
  color: #e8f4fc;
}

.api-code code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

.api-copy {
  border: 1px solid rgba(124, 199, 245, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #7cc7f5;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.28rem 0.6rem;
  border-radius: 0.45rem;
  cursor: pointer;
}

.api-copy:hover {
  background: rgba(124, 199, 245, 0.12);
  color: #fff;
}

.api-copy.copied {
  color: #fff;
  border-color: #459ddd;
}

.api-copy-light {
  border: 1px solid #e2e6ee;
  background: #fff;
  color: #232248;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.28rem 0.6rem;
  border-radius: 0.45rem;
  cursor: pointer;
  margin-left: auto;
}

.api-copy-light:hover {
  border-color: #459ddd;
  color: #2f7fb8;
  background: #e8f4fc;
}

#credenciales,
#auth,
#ask,
#history,
#download {
  scroll-margin-top: 1.25rem;
}

.api-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.15rem 1.2rem;
  border: 1px dashed #d5dbe6;
  border-radius: 0.95rem;
  background: #f7fbfe;
}

.api-user-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid #e2e6ee;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #fff 0%, #f7fbfe 100%);
}

@media (min-width: 640px) {
  .api-user-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.api-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e2e6ee;
  background: #fff;
  color: #4b5563;
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.api-chip strong {
  color: #232248;
  font-weight: 650;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
}

.swal2-popup.swal-kai {
  font-family: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
  color: #232248;
  border-radius: 1rem;
  padding: 1.5rem 1.35rem 1.25rem;
}

.swal2-popup.swal-kai .swal2-title,
.swal-kai-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #232248;
}

.swal2-popup.swal-kai .swal2-html-container,
.swal-kai-text {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.45;
}

.swal2-popup.swal-kai .swal2-actions {
  gap: 0.5rem;
  width: 100%;
}

.swal-kai-confirm,
.swal-kai-cancel {
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  padding: 0.6rem 1.1rem !important;
}

.swal-kai-input.swal2-input {
  border: 1px solid #e2e6ee !important;
  border-radius: 0.75rem !important;
  background: #f2f4f7 !important;
  color: #232248 !important;
  font-size: 0.95rem !important;
  box-shadow: none !important;
}

.swal-kai-input.swal2-input:focus {
  border-color: #459ddd !important;
}
