/* ==========================================================================
   ARCHIVO: css/styles.css
   LENGUAJE: CSS3 (incluye CSS Houdini @property)
   FUNCIÓN: Efectos visuales estilo Magic UI que no existen de forma nativa
            en Tailwind CSS (Dot Grid, Border Beam, Spotlight, Scrollbar).
========================================================================== */

/* Indica al navegador que la página usa esquema oscuro nativo (scrollbars, inputs) */
:root {
  color-scheme: dark;
}

/* Estilo base del cuerpo del documento */
body {
  background-color: #09090b;
  color: #f4f4f5;
  overflow-x: hidden; /* Evita scroll horizontal accidental por animaciones */
}

/* --------------------------------------------------------------------------
   1. PATRÓN DE PUNTOS CON MÁSCARA RADIAL (Magic UI Dot Pattern)
   Crea puntos sutiles de 1px cada 24px y los desvanece hacia los bordes.
-------------------------------------------------------------------------- */
.bg-dot-grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 75% 60% at 50% 15%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 15%, #000 35%, transparent 100%);
}

/* --------------------------------------------------------------------------
   2. BORDE LUMINOSO ANIMADO (Magic UI Border Beam)
   Registramos la variable tipada --beam-angle para poder animar un gradiente
   cónico suavemente de 0deg a 360deg alrededor del simulador.
-------------------------------------------------------------------------- */
@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.border-beam-wrapper {
  position: relative;
  border-radius: 1.25rem;
  padding: 1px; /* Grosor visual del borde base */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

/* Pseudo-elemento ::before que dibuja el haz de luz rotatorio solo en el borde */
.border-beam-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--beam-angle),
    transparent 0deg 275deg,
    rgba(16, 185, 129, 0.85) 315deg, /* Esmeralda */
    rgba(56, 189, 248, 0.9) 345deg,  /* Celeste */
    transparent 360deg
  );
  /* Máscara compuesta: recorta el interior para que solo se vea el perímetro */
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotate-beam 6s linear infinite;
  pointer-events: none;
}

@keyframes rotate-beam {
  to {
    --beam-angle: 360deg;
  }
}

/* --------------------------------------------------------------------------
   3. TARJETAS BENTO CON SPOTLIGHT (Sigue la posición del cursor)
   Las variables --mouse-x y --mouse-y son actualizadas por js/ui-effects.js.
-------------------------------------------------------------------------- */
.bento-card {
  position: relative;
  background: rgba(17, 17, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    480px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(16, 185, 129, 0.11),
    transparent 45%
  );
  opacity: 0; /* Oculto hasta que el mouse entra en la tarjeta */
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

/* --------------------------------------------------------------------------
   4. SCROLLBAR SUTIL PARA LA VENTANA DEL CHAT
-------------------------------------------------------------------------- */
.chat-scroll::-webkit-scrollbar {
  width: 5px;
}

.chat-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}

/* --------------------------------------------------------------------------
   5. ANIMACIÓN DE ENTRADA PARA BURBUJAS DE CHAT Y LOGS
-------------------------------------------------------------------------- */
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-msg {
  animation: msgIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --------------------------------------------------------------------------
   6. ACCESIBILIDAD: Desactiva animaciones si el usuario prefiere menos movimiento
-------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .border-beam-wrapper::before,
  .animate-marquee,
  .animate-shimmer {
    animation: none !important;
  }
}
