/**
 * Static Chat - Estilos del cuadro de diálogo estático
 */

/* ============================================
   Wrapper sin sombra - mismo ancho que input wrapper
   ============================================ */
.static-chat-box-wrapper {
  width: 100%;
  max-width: 100%;
  position: relative;
  /* Sin padding/margin para que ocupe el mismo ancho que el input wrapper */
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  /* Sin sombra externa */
  box-shadow: none;
  transition: none;
  z-index: 1;
}

/* Contenedor interno con overflow hidden para la animación */
.static-chat-box {
  width: 100%;
  max-width: 100%;
  max-height: 60vh;
  background: linear-gradient(135deg, rgba(29, 32, 40, 0.95) 0%, rgba(35, 38, 46, 0.95) 100%);
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  overflow: hidden; /* Para la animación shimmer */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* Efecto de glow interno adicional */
  box-shadow: 
    inset 0 0 0 1px rgba(139, 92, 246, 0.4),
    inset 0 0 20px rgba(139, 92, 246, 0.15),
    inset 0 0 40px rgba(139, 92, 246, 0.08);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.static-chat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent,
    var(--neon-purple),
    var(--neon-magenta),
    var(--neon-purple),
    transparent
  );
  animation: shimmer 3s linear infinite;
  border-radius: 16px 16px 0 0; /* Respeta las esquinas superiores redondeadas */
  z-index: 3; /* Por encima del ::after (sombra) */
  /* Asegurar que la animación se recorte correctamente en las esquinas */
  overflow: hidden;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Estado processing - sin sombra externa */
.static-chat-box-wrapper.processing {
  box-shadow: none;
}

.static-chat-box.processing {
  border-color: rgba(255, 0, 255, 0.5);
  box-shadow: 
    inset 0 0 0 1px rgba(255, 0, 255, 0.5),
    inset 0 0 25px rgba(255, 0, 255, 0.2),
    inset 0 0 50px rgba(255, 0, 255, 0.12);
}

.static-chat-box.history-expanded {
  max-height: 70vh;
  overflow-y: auto;
}

/* ============================================
   NOTA: Solución A (wrapper externo) movida a comentario
   Si se necesita espacio externo para la sombra, se puede
   reactivar la Solución A, pero requiere que los padres
   tengan overflow: visible, lo cual puede causar problemas
   de scroll horizontal.
   ============================================ */

.static-chat-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 20px;
  margin-top: 0;
  text-transform: none; /* Removido uppercase */
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.5);
  position: relative; /* Para z-index */
  z-index: 2; /* Por encima de la animación */
}

.static-chat-title::before {
  content: '💭';
  font-size: 24px;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.8));
}

.static-chat-box.processing .static-chat-title::before {
  content: '⚙️';
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.static-chat-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  min-height: 80px;
  max-height: 50vh;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap; /* Respeta saltos de línea */
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  position: relative; /* Para z-index */
  z-index: 2; /* Por encima del ::after (sombra) y ::before (shimmer) */
}

.static-chat-content h1,
.static-chat-content h2,
.static-chat-content h3 {
  color: var(--neon-cyan);
  margin-top: 16px;
  margin-bottom: 8px;
}

.static-chat-content code {
  background: rgba(0, 245, 255, 0.1);
  color: var(--neon-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', 'Consolas', 'Monaco', 'Lucida Console', monospace;
}

.static-chat-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

.static-chat-content a {
  color: var(--neon-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 245, 255, 0.3);
  transition: all 0.2s ease;
}

.static-chat-content a:hover {
  color: var(--neon-teal);
  border-bottom-color: var(--neon-teal);
}
