/* ----------------------------- OCULTACIÓN INMEDIATA AL CARGAR -------------------------------- */
/* Este CSS se aplica INMEDIATAMENTE para evitar que aparezca el logo de Chainlit */

/* Ocultar logo de Chainlit en TODAS las posibles ubicaciones */
img[alt*="Chainlit" i],
img[alt*="chainlit" i],
img[src*="chainlit" i],
img[src*="logo" i]:not([src*="cereza"]),
.chainlit-logo,
.logo,
[class*="logo"]:not([class*="cereza"]),
.MuiSvgIcon-root[data-testid*="chainlit" i],
svg[data-testid*="chainlit" i] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

/* Ocultar texto "Chainlit" en headers */
.MuiTypography-root:has-text("Chainlit"),
.MuiTypography-h6:has-text("Chainlit"),
h1:contains("Chainlit"),
h2:contains("Chainlit"),
h3:contains("Chainlit"),
span:contains("Chainlit"),
div:contains("Chainlit"):not(:has(div)):not(:has(span)) {
  display: none !important;
  visibility: hidden !important;
}

/* Ocultar footer "Built with Chainlit" PERO NO README */
footer,
.chainlit-footer,
.chainlit-watermark,
.made-with-chainlit,
[class*="footer"],
[class*="watermark"],
a[href*="chainlit"],
a[href*="chainlit.io"] {
  display: none !important;
  visibility: hidden !important;
}

/* ✅ README BUTTON AHORA VISIBLE - removido de la lista de ocultación */

/* ----------------------------- REEMPLAZAR LOGO POR TÍTULO PERSONALIZADO -------------------------------- */

/* Ocultar el logo original y reemplazar por texto */
.MuiToolbar-root .MuiTypography-h6,
.MuiAppBar-root .MuiTypography-h6 {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, var(--primary-color) 0%, #ff6b75 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

.MuiToolbar-root .MuiTypography-h6::before,
.MuiAppBar-root .MuiTypography-h6::before {
  content: "☕ Cereza.ai" !important;
  background: linear-gradient(135deg, var(--primary-color) 0%, #ff6b75 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Ocultar el contenido original del título */
.MuiToolbar-root .MuiTypography-h6 > *,
.MuiAppBar-root .MuiTypography-h6 > * {
  display: none !important;
}

/* ----------------------------- RESTO DE ESTILOS EXISTENTES -------------------------------- */

/* Importar fuentes modernas */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Variables CSS personalizadas con tus colores exactos */
:root {
  --primary-color: #ED4251;                /* Tu rojo principal */
  --secondary-color: #556379;              /* Tu gris azulado */
  --background-dark: #151C24;              /* Tu fondo oscuro */
  --text-color: #ffffff;                   /* Blanco */
  --text-muted: rgba(255, 255, 255, 0.6);
  --border-color: rgba(85, 99, 121, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.15);
}

/* Variables para modo claro */
[data-theme="light"] {
  --background-light: #f8fafc;             /* Fondo claro */
  --text-light: #151C24;                   /* Texto oscuro */
  --secondary-light: #e2e8f0;              /* Gris claro para mensajes */
  --border-light: rgba(85, 99, 121, 0.15);
  --shadow-light: rgba(0, 0, 0, 0.08);
}

/* Fondo principal - ADAPTABLE */
body, 
html,
#root,
.MuiCssBaseline-root {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  transition: all 0.3s ease !important;
}

/* Modo oscuro */
[data-theme="dark"] body,
[data-theme="dark"] html,
[data-theme="dark"] #root,
[data-theme="dark"] .MuiCssBaseline-root {
  background: var(--background-dark) !important;
  color: var(--text-color) !important;
}

/* Modo claro */
[data-theme="light"] body,
[data-theme="light"] html,
[data-theme="light"] #root,
[data-theme="light"] .MuiCssBaseline-root {
  background: var(--background-light) !important;
  color: var(--text-light) !important;
}

/* Header - adaptable */
.MuiAppBar-root {
  transition: all 0.3s ease !important;
}

[data-theme="dark"] .MuiAppBar-root {
  background: rgba(21, 28, 36, 0.95) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="light"] .MuiAppBar-root {
  background: rgba(248, 250, 252, 0.95) !important;
  border-bottom: 1px solid var(--border-light) !important;
  backdrop-filter: blur(20px) !important;
}

/* Mensajes del usuario - ADAPTABLE */
.message.user .MuiPaper-root {
  background: linear-gradient(135deg, var(--primary-color) 0%, #ff4757 100%) !important;
  color: white !important;
  border-radius: 18px !important;
  border-bottom-right-radius: 6px !important;
  margin-left: auto !important;
  max-width: 75% !important;
  transition: all 0.3s ease !important;
}

/* Mensajes del asistente - ADAPTABLE POR TEMA */
.message.assistant .MuiPaper-root {
  border-radius: 18px !important;
  border-bottom-left-radius: 6px !important;
  margin-right: auto !important;
  max-width: 75% !important;
  transition: all 0.3s ease !important;
}

/* Modo oscuro - mensajes asistente */
[data-theme="dark"] .message.assistant .MuiPaper-root {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #667085 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px var(--shadow-color) !important;
}

/* Modo claro - mensajes asistente */
[data-theme="light"] .message.assistant .MuiPaper-root {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
  color: var(--text-light) !important;
  box-shadow: 0 4px 12px var(--shadow-light) !important;
  border: 1px solid var(--border-light) !important;
}

/* Avatar del asistente - EMOJI PERSONALIZADO */
.message.assistant .MuiAvatar-root {
  background: var(--primary-color) !important;
  color: white !important;
  font-size: 1.4rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
}

/* Modo claro - avatar asistente */
[data-theme="light"] .message.assistant .MuiAvatar-root {
  background: var(--primary-color) !important;
  color: white !important;
}

/* Avatar del usuario - EMOJI PERSONALIZADO */
.message.user .MuiAvatar-root {
  background: var(--secondary-color) !important;
  color: white !important;
  font-size: 1.4rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
}

/* Modo claro - avatar usuario */
[data-theme="light"] .message.user .MuiAvatar-root {
  background: var(--secondary-color) !important;
  color: white !important;
}

/* Enlaces en mensajes - adaptable */
.MuiPaper-root a {
  color: var(--primary-color) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.MuiPaper-root a:hover {
  text-decoration: underline !important;
}important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.MuiPaper-root a:hover {
  text-decoration: underline !important;
}

/* Campo de entrada - COMPLETAMENTE ADAPTABLE */
.MuiOutlinedInput-root {
  border-radius: 12px !important;
  transition: all 0.3s ease !important;
}

/* Modo oscuro - input */
[data-theme="dark"] .MuiOutlinedInput-root {
  background: rgba(85, 99, 121, 0.2) !important;
}

[data-theme="dark"] .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.3) !important;
}

[data-theme="dark"] .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.5) !important;
}

[data-theme="dark"] .MuiOutlinedInput-input {
  color: white !important;
}

[data-theme="dark"] .MuiOutlinedInput-input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Modo claro - input */
[data-theme="light"] .MuiOutlinedInput-root {
  background: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.25) !important;
}

[data-theme="light"] .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.4) !important;
}

[data-theme="light"] .MuiOutlinedInput-input {
  color: var(--text-light) !important;
}

[data-theme="light"] .MuiOutlinedInput-input::placeholder {
  color: rgba(21, 28, 36, 0.6) !important;
}

/* Focus state - igual para ambos temas */
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--primary-color) !important;
  border-width: 2px !important;
}

/* Botón de envío - igual para ambos temas */
.MuiIconButton-root[aria-label="Send"] {
  background: linear-gradient(135deg, var(--primary-color) 0%, #ff6b75 100%) !important;
  color: white !important;
  margin-left: 8px !important;
  transition: all 0.3s ease !important;
}

.MuiIconButton-root[aria-label="Send"]:hover {
  background: linear-gradient(135deg, #d73545 0%, #ff4757 100%) !important;
  transform: scale(1.05) !important;
}

/* Starters (botones de inicio) - ADAPTABLE */
.MuiChip-root {
  border-radius: 12px !important;
  border: 1px solid !important;
  transition: all 0.3s ease !important;
}

/* Modo oscuro - starters */
[data-theme="dark"] .MuiChip-root {
  background: rgba(85, 99, 121, 0.8) !important;
  color: white !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .MuiChip-root:hover {
  background: var(--primary-color) !important;
  transform: translateY(-2px) !important;
}

/* Modo claro - starters */
[data-theme="light"] .MuiChip-root {
  background: white !important;
  color: var(--text-light) !important;
  border-color: var(--border-light) !important;
  box-shadow: 0 2px 4px var(--shadow-light) !important;
}

[data-theme="light"] .MuiChip-root:hover {
  background: var(--primary-color) !important;
  color: white !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(237, 66, 81, 0.2) !important;
}

/* Contenedor principal - adaptable */
.MuiContainer-root {
  transition: all 0.3s ease !important;
}

/* Scrollbar personalizado - adaptable */
::-webkit-scrollbar {
  width: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--background-dark);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--background-light);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(85, 99, 121, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(85, 99, 121, 0.8);
}

/* Responsive design */
@media (max-width: 768px) {
  .message.user .MuiPaper-root,
  .message.assistant .MuiPaper-root {
    max-width: 90% !important;
  }
}

/* Contenido markdown - adaptable */
[data-theme="dark"] .MuiPaper-root code {
  background: rgba(0, 0, 0, 0.2) !important;
  color: #ff6b75 !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 4px !important;
}

[data-theme="light"] .MuiPaper-root code {
  background: rgba(21, 28, 36, 0.1) !important;
  color: var(--primary-color) !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 4px !important;
}

[data-theme="dark"] .MuiPaper-root pre {
  background: rgba(0, 0, 0, 0.3) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  overflow-x: auto !important;
}

[data-theme="light"] .MuiPaper-root pre {
  background: rgba(21, 28, 36, 0.05) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  overflow-x: auto !important;
  border: 1px solid var(--border-light) !important;
}

/* Transiciones suaves para el cambio de tema */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.MuiPaper-root a:hover {
  text-decoration: underline !important;
}

/* Campo de entrada - COMPLETAMENTE ADAPTABLE */
.MuiOutlinedInput-root {
  border-radius: 12px !important;
  transition: all 0.3s ease !important;
}

/* Modo oscuro - input */
[data-theme="dark"] .MuiOutlinedInput-root {
  background: rgba(85, 99, 121, 0.2) !important;
}

[data-theme="dark"] .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.3) !important;
}

[data-theme="dark"] .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.5) !important;
}

[data-theme="dark"] .MuiOutlinedInput-input {
  color: white !important;
}

[data-theme="dark"] .MuiOutlinedInput-input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Modo claro - input */
[data-theme="light"] .MuiOutlinedInput-root {
  background: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.25) !important;
}

[data-theme="light"] .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(85, 99, 121, 0.4) !important;
}

[data-theme="light"] .MuiOutlinedInput-input {
  color: var(--text-light) !important;
}

[data-theme="light"] .MuiOutlinedInput-input::placeholder {
  color: rgba(21, 28, 36, 0.6) !important;
}

/* Focus state - igual para ambos temas */
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--primary-color) !important;
  border-width: 2px !important;
}

/* Botón de envío - igual para ambos temas */
.MuiIconButton-root[aria-label="Send"] {
  background: linear-gradient(135deg, var(--primary-color) 0%, #ff6b75 100%) !important;
  color: white !important;
  margin-left: 8px !important;
  transition: all 0.3s ease !important;
}

.MuiIconButton-root[aria-label="Send"]:hover {
  background: linear-gradient(135deg, #d73545 0%, #ff4757 100%) !important;
  transform: scale(1.05) !important;
}

/* Starters (botones de inicio) - ADAPTABLE */
.MuiChip-root {
  border-radius: 12px !important;
  border: 1px solid !important;
  transition: all 0.3s ease !important;
}

/* Modo oscuro - starters */
[data-theme="dark"] .MuiChip-root {
  background: rgba(85, 99, 121, 0.8) !important;
  color: white !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .MuiChip-root:hover {
  background: var(--primary-color) !important;
  transform: translateY(-2px) !important;
}

/* Modo claro - starters */
[data-theme="light"] .MuiChip-root {
  background: white !important;
  color: var(--text-light) !important;
  border-color: var(--border-light) !important;
  box-shadow: 0 2px 4px var(--shadow-light) !important;
}

[data-theme="light"] .MuiChip-root:hover {
  background: var(--primary-color) !important;
  color: white !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(237, 66, 81, 0.2) !important;
}

/* Contenedor principal - adaptable */
.MuiContainer-root {
  transition: all 0.3s ease !important;
}

/* Título de la aplicación - adaptable */
.MuiTypography-h6 {
  font-size: 1.8rem !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, var(--primary-color) 0%, #ff6b75 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Scrollbar personalizado - adaptable */
::-webkit-scrollbar {
  width: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--background-dark);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--background-light);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(85, 99, 121, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(85, 99, 121, 0.8);
}

/* Responsive design */
@media (max-width: 768px) {
  .message.user .MuiPaper-root,
  .message.assistant .MuiPaper-root {
    max-width: 90% !important;
  }
}

/* Contenido markdown - adaptable */
[data-theme="dark"] .MuiPaper-root code {
  background: rgba(0, 0, 0, 0.2) !important;
  color: #ff6b75 !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 4px !important;
}

[data-theme="light"] .MuiPaper-root code {
  background: rgba(21, 28, 36, 0.1) !important;
  color: var(--primary-color) !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 4px !important;
}

[data-theme="dark"] .MuiPaper-root pre {
  background: rgba(0, 0, 0, 0.3) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  overflow-x: auto !important;
}

[data-theme="light"] .MuiPaper-root pre {
  background: rgba(21, 28, 36, 0.05) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  overflow-x: auto !important;
  border: 1px solid var(--border-light) !important;
}

/* Transiciones suaves para el cambio de tema */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}


;
}

/* Título de la aplicación */
.chainlit-app-title {
  font-size: 1.8rem !important;
  font-weight: 700 !important;
  background: var(--primary-gradient) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Avatares personalizados */
.chainlit-avatar {
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  object-fit: cover !important;
}

/* Mejoras para el contenido markdown */
.chainlit-message-content h1,
.chainlit-message-content h2,
.chainlit-message-content h3 {
  color: white !important;
  margin-top: 0 !important;
}

.chainlit-message-content code {
  background: rgba(0, 0, 0, 0.2) !important;
  color: #ff6b75 !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 4px !important;
}

.chainlit-message-content pre {
  background: rgba(0, 0, 0, 0.3) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  overflow-x: auto !important;
}