

/* =========================================================
   REVER PRO AI · STYLES DEFINITIVO (REEMPLAZO COMPLETO)
========================================================= */

:root {
  --rever-black: #000000;
  --rever-dark: #111111;
  --rever-card: #151515;
  --rever-card-2: #1f1f1f;
  --rever-border: #2a2a2a;
  --rever-gray: #e6e6e6;
  --rever-yellow: #E6FF00;
  --rever-white: #FFFFFF;
}

/* RESET */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--rever-black);
  color: var(--rever-white);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* CONTENEDOR */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP BAR */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--rever-black);
  border-bottom: 1px solid #222;
  min-height: 70px;
}

/* LOGO */
.logo-top {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
  border-radius: 10px;
}

/* SELECT / INSTALL */
#language-select {
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--rever-border);
  background: #0f0f0f;
  color: #fff;
}

#installButton {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rever-border);
  background: #0f0f0f;
  color: #fff;
  cursor: pointer;
}

/* BIENVENIDA */
#bienvenida {
  text-align: center;
  padding: 8px 0 2px 0;
  font-size: 1.15rem;
  color: #fff;
}
#SarAI-saludo {
  text-align: center;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 10px;
}

/* CHAT */
.chat {
  flex: 1;
  background: var(--rever-card);
  border-radius: 14px;
  padding: 14px;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid #1c1c1c;

  /* IMPORTANTE: hace que el align/margins funcionen */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Spinner (si lo usas) */
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: var(--rever-yellow);
  animation: spin 0.9s linear infinite;
  margin: 10px 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* INPUT AREA */
.input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="text"] {
  background: #222;
  color: #fff;
  border-radius: 12px;
  border: 1px solid #111;
  padding: 14px 16px;
  font-size: 1rem;
}

input[type="text"]:focus {
  outline: none;
  border: 2px solid var(--rever-yellow);
}

/* BOTONES */
.botones-envio {
  display: flex;
  gap: 14px;
}

#sendButton {
  flex: 1;
  padding: 12px 14px;
  background: var(--rever-yellow);
  color: #000;
  font-weight: 800;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

#resetButton {
  flex: 1;
  padding: 12px 14px;
  background: var(--rever-gray);
  color: #000;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

#sendButton:hover { filter: brightness(0.92); }
#resetButton:hover { background: #d5d5d5; }

/* BOTONES EXTRA (GIPHY/PDF) */
.boton-giphy {
  margin-top: 10px;
  padding: 10px 16px;
  border: none;
  background: var(--rever-yellow);
  color: #000;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}
.boton-giphy:hover { filter: brightness(0.92); }

/* =========================================================
   BURBUJAS (CORRECCIÓN REAL, SIN PARCHES)
   - Usuario a la DERECHA
   - No ocupa todo el ancho
   - Mantiene ancho dinámico por texto (hasta un máximo)
========================================================= */

/* Base burbuja */
.message {
  display: inline-block !important;  /* evita “barra amarilla” a todo el ancho */
  width: auto !important;
  max-width: 75% !important;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Bot */
.message.bot {
  background: var(--rever-card-2);
  color: #fff;
  margin-right: auto !important;
  text-align: left;
}

/* Usuario */
.message.user {
  background: var(--rever-yellow) !important;
  color: #000 !important;
  margin-left: auto !important;     /* clave: lo empuja a la derecha */
  text-align: left;
}

/* IMPORTANTÍSIMO:
   El “bot” en tu JS va dentro de un wrapper (div sin clase) con avatar absoluto.
   Para que ese wrapper no estire a lo ancho, lo normalizamos aquí. */
.chat > div[style*="position: relative"] {
  width: 100%;
}

/* En móviles */

@media (max-width: 768px) {
  .container { 
    padding: 12px; 
  }

  .message { 
    max-width: 84% !important; 
  }
}

/* =========================================================
   TOP BAR · LAYOUT DEFINITIVO (HTML ACTUAL)
   NO AFECTA AL CHAT
========================================================= */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100px;          /* altura real para que el logo crezca */
    padding: 6px 12px;
}

/* =========================
   LOGO REVER · DEFINITIVO
========================= */

/* Contenedor del logo */
.logo-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;             /* evita que el logo se comprima */
}

/* Logo */
.logo-top {
    display: block;
    height: 100px;               /* ⬅️ AJUSTA SOLO AQUÍ EL TAMAÑO */
    width: auto;
    object-fit: contain;
    background: transparent;
    opacity: 1;
    visibility: visible;
}

/* =========================
   BOTÓN INSTALAR
========================= */

.install-wrapper {
    display: flex;
    justify-content: center;
    flex: 1;                    /* centra el botón sin aplastar el logo */
}

/* =========================
   SELECTOR IDIOMA
========================= */

.lang-wrapper {
    display: flex;
    align-items: center;
}

