/* Estilos custom mínimos — Tailwind es el primario (AGENTS.md) */

:root {
  scrollbar-width: thin;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* Scrollbar delgada para paneles */
.scroll-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.scroll-thin::-webkit-scrollbar-thumb {
  background: rgb(148 163 184 / 0.4);
  border-radius: 9999px;
}
.dark .scroll-thin::-webkit-scrollbar-thumb {
  background: rgb(71 85 105 / 0.6);
}
.scroll-thin::-webkit-scrollbar-track {
  background: transparent;
}

/* Bloque SQL */
.sql-block pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Animación de aparición de mensajes */
@keyframes sqlai-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.msg-in {
  animation: sqlai-fade-up 0.25s ease-out both;
}

/* Punto parpadeante mientras genera la IA */
@keyframes sqlai-blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.typing-dot {
  animation: sqlai-blink 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Cursor de editor SQL */
.editor-sql {
  tab-size: 4;
}

/* Editor SQL con overlay de resaltado */
.sql-highlight-wrap {
  position: relative;
}

.sql-highlight {
  position: absolute;
  inset: 0;
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.sql-highlight::-webkit-scrollbar {
  display: none;
}

.sql-textarea {
  color: transparent;
  caret-color: #7C3AED;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
}
.sql-textarea::selection {
  background: rgba(124, 58, 237, 0.25);
  color: transparent;
}

/* Tokens de resaltado SQL */
.sql-kw {
  color: #7C3AED;
  font-weight: 600;
}
.dark .sql-kw {
  color: #C4B5FD;
}

.sql-str {
  color: #15803D;
}
.dark .sql-str {
  color: #4ADE80;
}

.sql-num {
  color: #1D4ED8;
}
.dark .sql-num {
  color: #93C5FD;
}

.sql-cmt {
  color: #94A3B8;
  font-style: italic;
}
.dark .sql-cmt {
  color: #64748B;
}

.sql-id {
  color: #0F766E;
}
.dark .sql-id {
  color: #5EEAD4;
}

/* Sidebar colapsable en desktop (lg+). En móvil se sigue usando el off-canvas. */
@media (min-width: 1024px) {
  body.sidebar-collapsed #sidebar {
    display: none;
  }
}

/* User menu dropdown animation */
@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#userDropdown:not(.hidden) {
  animation: dropdown-in 0.15s ease-out both;
  transform-origin: top right;
}
