/* components.css */

/* ─────────── Glass Morphism ─────────── */
.glass {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  box-shadow: var(--shadow-gold);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ─────────── Toast ─────────── */
#toast {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(var(--blur-md));
  color: var(--gold);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  box-shadow: var(--shadow-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ─────────── Badges ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: var(--black);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  box-shadow: var(--shadow-gold);
  animation: goldPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes goldPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: var(--shadow-gold);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 30px rgb(255 215 0 / 0.7);
  }
}

.docs-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  background: var(--secondary);
  color: var(--black);
}

/* ─────────── Overlays & Modals ─────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(var(--blur-lg));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  color: var(--gold);
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.overlay h2 {
  color: var(--gold);
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.overlay p {
  color: rgba(255, 215, 0, 0.8);
  margin-bottom: 2rem;
}

.overlay .btn {
  margin-top: 2rem;
  padding: 1rem 2rem;
  background: var(--primary);
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-gold);
}

.overlay .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(var(--blur-lg));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
  }
  to {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(var(--blur-lg));
  }
}

.modal-content {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(var(--blur-lg));
  padding: 3rem;
  border-radius: 24px;
  width: 90%;
  max-width: 450px;
  box-shadow: var(--shadow-gold);
  text-align: center;
  transform: translateY(-20px);
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

@keyframes slideUp {
  to {
    transform: translateY(0);
  }
}

.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-content p {
  margin: 0 0 1.5rem;
  color: rgba(255, 215, 0, 0.8);
  font-size: 1.1rem;
}

.modal-content input {
  width: 100%;
  padding: 1rem;
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: var(--gold);
}

.modal-content input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.modal-content input::placeholder {
  color: rgba(255, 215, 0, 0.5);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions button {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-actions button:first-child {
  background: var(--primary);
  color: var(--black);
}

.modal-actions button:first-child:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.modal-actions button:last-child {
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.modal-actions button:last-child:hover {
  background: rgba(255, 215, 0, 0.3);
}

/* ─────────── Voice Indicator (KITT Style) ─────────── */
.voice-indicator {
  width: min(60vw, 400px);
  height: min(20vw, 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 20px;
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: var(--shadow-gold);
  padding: 2rem;
  backdrop-filter: blur(var(--blur-lg));
}

.voice-indicator:hover {
  transform: scale(1.02);
  box-shadow: 0 30px 60px -12px rgba(255, 215, 0, 0.6);
  border-color: var(--gold-light);
}

.voice-indicator:active {
  transform: scale(0.98);
}

.kitt-bars {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
  height: 50px;
  align-items: flex-end;
  justify-content: center;
}

.kitt-bar {
  width: 80px;
  background: linear-gradient(to top,#444,#666);
  border-radius: 6px;
  transition: all 0.1s ease-out;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.6);
  height: 20px;
  min-height: 20px;
  max-height: 50px;
}

.kitt-bar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, transparent, rgba(255,255,255,0.4));
  opacity: 0.7;
}

.kitt-bar::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  transition: left 0.6s ease;
}

.kitt-bar:hover::after {
  left: 100%;
}

.kitt-metrics {
  display: flex;
  justify-content: space-between;
  width: 100%; max-width: 280px;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255, 215, 0, 0.8);
}

.metric-label {
  text-align: center; flex: 1;
}

.voice-status-text {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

#ws-indicator.listening .kitt-bars {
  filter: brightness(1.3) saturate(1.5);
}

#ws-indicator.processing .kitt-bars {
  filter: brightness(1.2) saturate(1.3);
  animation: processing-pulse 0.8s ease-in-out infinite;
}

#ws-indicator.offline .kitt-bars {
  filter: grayscale(1) brightness(0.5);
  opacity: 0.5;
}

@keyframes processing-pulse {
  0%,100% { filter: brightness(1.2) saturate(1.3); }
  50%    { filter: brightness(1.8) saturate(2); }
}

/* ─────────── Transaction Info ─────────── */
.transaction-info {
  position: absolute; top:50%; left:50%;
  transform: translate(-50%,-50%);
  background: linear-gradient(135deg, rgba(255,215,0,0.15) 0%, rgba(255,215,0,0.08) 50%, rgba(255,215,0,0.15) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 16px;
  padding: 0.75rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,215,0,0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  letter-spacing: 0.5px;
  box-shadow: 0 8px 32px rgba(255,215,0,0.1), 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  opacity: 0; transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index:200; white-space:nowrap; pointer-events:none; overflow:hidden;
}

.transaction-info::before {
  content: ''; position:absolute; top:0; left:-100%;
  width:100%; height:100%;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.1), transparent);
  transition:left 0.6s ease;
}

.transaction-info:hover::before {
  left:100%;
}

.transaction-info.show {
  opacity:1; pointer-events:auto;
  transform: translate(-50%,-50%) scale(1);
}

.transaction-info.processing {
  background: linear-gradient(135deg, rgba(255,215,0,0.18) 0%, rgba(255,215,0,0.12) 50%, rgba(255,215,0,0.18) 100%);
  border-color: rgba(255,215,0,0.4);
  color: rgba(255,215,0,1);
  animation: thinkingPulse 2s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(255,215,0,0.15), 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15), 0 0 20px rgba(255,215,0,0.2);
}

.transaction-info.active {
  background: linear-gradient(135deg, rgba(0,255,136,0.15) 0%, rgba(0,255,136,0.08) 50%, rgba(0,255,136,0.15) 100%);
  border-color: rgba(0,255,136,0.4);
  color: rgba(0,255,136,0.95);
  box-shadow: 0 8px 32px rgba(0,255,136,0.1), 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

@keyframes thinkingPulse {
  0%,100% {
    opacity:1;
    transform: translate(-50%,-50%) scale(1);
    box-shadow: 0 8px 32px rgba(255,215,0,0.1), 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  }
  50% {
    opacity:0.85;
    transform: translate(-50%,-50%) scale(1.02);
    box-shadow: 0 12px 40px rgba(255,215,0,0.2), 0 6px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2), 0 0 30px rgba(255,215,0,0.3);
  }
}

.thinking-dots {
  display:inline-block;
  margin-left:0.5rem;
}

@keyframes thinkingDots {
  0%,20%   { content:''; }
  25%,45% { content:'.'; }
  50%,70% { content:'..'; }
  75%,95% { content:'...'; }
  100%    { content:''; }
}

@media (max-width:768px) {
  .transaction-info {
    padding:0.6rem 1.2rem;
    font-size:0.8rem;
    border-radius:14px;
  }
}

@media (max-width:480px) {
  .transaction-info {
    padding:0.5rem 1rem;
    font-size:0.75rem;
    border-radius:12px;
    max-width:calc(100% - 2rem);
    white-space:normal;
    text-align:center;
  }
}

/* ─────────── Icon Buttons (Toolbar) ─────────── */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 215, 0, 0.1);
  backdrop-filter: blur(var(--blur-sm));
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.icon-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
  border-color: rgba(255, 215, 0, 0.5);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn.active {
  background: var(--primary);
  color: var(--black);
}

.clear-btn svg {
  fill: #ff4757;
  filter: drop-shadow(0 1px 2px rgba(255, 71, 87, 0.3));
}

.voice-settings-btn svg,
.docs-btn svg,
.icon-btn:first-child svg {
  fill: var(--gold);
  filter: drop-shadow(0 1px 2px rgba(255, 215, 0, 0.3));
}

/* ─────────── Hamburger Button (SOLUCIÓN FINAL) ─────────── */
.hamburger {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  background: transparent !important; /* CRUCIAL: Fondo completamente transparente */
  backdrop-filter: none;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
  padding: 0;
  margin: 0;
  outline: none;
  
  /* Reset completo del botón */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
  
  /* ELIMINAR cualquier sombra o efecto que pueda crear fondo */
  box-shadow: none;
}

.hamburger:hover {
  background: rgba(255, 215, 0, 0.1) !important; /* Muy sutil en hover */
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  border-color: rgba(255, 215, 0, 0.5);
}

.hamburger:active {
  transform: translateY(0);
  background: transparent !important;
}

.hamburger:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
  background: transparent !important;
}

/* Las tres líneas del hamburger */
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  box-shadow: 0 0 3px rgba(255, 215, 0, 0.3);
  margin: 0;
  padding: 0;
  border: none;
  position: relative;
  
  /* IMPORTANTE: Asegurar que las líneas no tengan fondo */
  background-color: var(--gold) !important;
}

.hamburger-line:not(:last-child) {
  margin-bottom: 4px;
}

/* Efecto hover en las líneas */
.hamburger:hover .hamburger-line {
  background: var(--gold-light) !important;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

/* Animación cuando el drawer está abierto */
.drawer.open ~ header .hamburger .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.drawer.open ~ header .hamburger .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.drawer.open ~ header .hamburger .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Estados responsive */
@media (max-width: 768px) {
  .hamburger {
    width: 44px;
    height: 44px;
  }
  
  .hamburger-line {
    width: 20px;
  }
}

@media (max-width: 480px) {
  .hamburger {
    width: 40px;
    height: 40px;
  }
  
  .hamburger-line {
    width: 18px;
  }
}

/* RESET ADICIONAL para eliminar cualquier estilo del navegador */
.hamburger,
.hamburger * {
  background-image: none !important;
  background-color: transparent !important;
  text-shadow: none !important;
  color: transparent !important;
}

.hamburger-line {
  background-color: var(--gold) !important; /* Solo las líneas tienen color */
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* ─────────── 🆕 MODALES DE CONVERSACIONES ─────────── */
/* ═══════════════════════════════════════════════════════════════════════════════ */

.conversations-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(var(--blur-lg));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.conversations-modal-content {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(var(--blur-lg));
  padding: 2rem;
  border-radius: 24px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
  position: relative;
}

.conversations-modal h3 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: scale(1.1);
}

.conversations-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.conversations-table th,
.conversations-table td {
  padding: 1rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.conversations-table th {
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.conversations-table td {
  color: rgba(255, 215, 0, 0.9);
  font-size: 0.9rem;
}

.conversations-table tbody tr {
  cursor: pointer;
  transition: all 0.3s ease;
}

.conversations-table tbody tr:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateX(4px);
}

.session-id {
  font-family: 'Courier New', monospace;
  color: var(--gold-light);
  font-weight: 600;
}

.last-activity {
  color: rgba(255, 215, 0, 0.7);
  font-size: 0.85rem;
}

.message-count {
  background: rgba(255, 215, 0, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--gold);
  text-align: center;
}

.first-message {
  color: rgba(255, 215, 0, 0.8);
  font-style: italic;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────── MODAL DE TRANSACCIONES ─────────── */
.transactions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.transactions-table th,
.transactions-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  vertical-align: top;
}

.transactions-table th {
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.transactions-table td {
  color: rgba(255, 215, 0, 0.9);
  font-size: 0.85rem;
}

.transaction-timestamp {
  font-family: 'Courier New', monospace;
  color: var(--gold-light);
  font-size: 0.8rem;
  white-space: nowrap;
}

.transaction-question {
  color: rgba(0, 255, 136, 0.9);
  font-weight: 500;
  max-width: 250px;
}

.transaction-response {
  color: rgba(255, 215, 0, 0.8);
  max-width: 300px;
}

.transaction-question,
.transaction-response {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: var(--gold);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: rgba(255, 215, 0, 0.3);
  transform: translateX(-2px);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(255, 215, 0, 0.6);
}

.empty-state h4 {
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* ─────────── RESPONSIVE PARA MODALES DE CONVERSACIONES ─────────── */
@media (max-width: 768px) {
  .conversations-modal-content {
    padding: 1.5rem;
    max-height: 90vh;
  }
  
  .conversations-table th,
  .conversations-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  
  .first-message {
    max-width: 120px;
  }
  
  .transaction-question,
  .transaction-response {
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .conversations-modal-content {
    padding: 1rem;
    width: 95%;
    max-height: 95vh;
  }
  
  .conversations-modal h3 {
    font-size: 1.2rem;
  }
  
  .conversations-table th,
  .conversations-table td,
  .transactions-table th,
  .transactions-table td {
    padding: 0.4rem 0.2rem;
    font-size: 0.75rem;
  }
  
  .first-message {
    max-width: 100px;
  }
  
  .transaction-question,
  .transaction-response {
    max-width: 120px;
  }
  
  .session-id {
    font-size: 0.7rem;
  }
  
  .message-count {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .transaction-timestamp {
    font-size: 0.7rem;
  }
}
/* ═══════════════════════════════════════════════════════════════════════════════
   NEURANTA - TOOLTIP PERSONALIZADO Y ESTILOS DE TABLA MEJORADOS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────── Tooltip Personalizado Neuranta Style ─────────── */
.neuranta-tooltip {
  position: relative;
  cursor: pointer;
}

.neuranta-tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(26, 26, 26, 0.95) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFD700;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: 400px;
  min-width: 200px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 10px 10px -5px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(255, 215, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.neuranta-tooltip::after {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(255, 215, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.neuranta-tooltip:hover::before,
.neuranta-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

/* ─────────── Variante para tooltip hacia arriba (si no hay espacio) ─────────── */
.neuranta-tooltip.tooltip-top::before {
  top: 125%;
  bottom: auto;
}

.neuranta-tooltip.tooltip-top::after {
  top: 115%;
  bottom: auto;
  border-top-color: transparent;
  border-bottom-color: rgba(255, 215, 0, 0.3);
}

/* ─────────── Estilos Mejorados para Tablas ─────────── */
.conversations-table,
.transactions-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.conversations-table th,
.transactions-table th {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
  color: #FFD700;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.conversations-table td,
.transactions-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  color: rgba(255, 215, 0, 0.9);
  font-size: 0.85rem;
  line-height: 1.4;
  vertical-align: top;
  transition: all 0.3s ease;
}

.conversations-table tr:hover,
.transactions-table tr:hover {
  background: rgba(255, 215, 0, 0.05);
  transform: scale(1.01);
}

.conversations-table tr:hover td,
.transactions-table tr:hover td {
  color: #FFD700;
  border-bottom-color: rgba(255, 215, 0, 0.2);
}

/* ─────────── Columnas específicas ─────────── */
.transaction-timestamp {
  width: 15%;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: rgba(255, 215, 0, 0.7);
  white-space: nowrap;
}

.transaction-question,
.transaction-response {
  width: 42.5%;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.session-id {
  width: 15%;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: rgba(255, 215, 0, 0.8);
}

.last-activity {
  width: 20%;
  font-size: 0.8rem;
  color: rgba(255, 215, 0, 0.7);
  white-space: nowrap;
}

.message-count {
  width: 15%;
  text-align: center;
  font-weight: 600;
  color: rgba(255, 215, 0, 0.9);
}

.first-message {
  width: 50%;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────── Indicadores de truncado ─────────── */
.transaction-question::after,
.transaction-response::after,
.first-message::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

/* ─────────── Responsive ─────────── */
@media (max-width: 768px) {
  .neuranta-tooltip::before {
    max-width: 280px;
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
  }
  
  .conversations-table th,
  .transactions-table th {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .conversations-table td,
  .transactions-table td {
    padding: 0.625rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* ─────────── Animación de carga para fechas ─────────── */
.date-loading {
  background: linear-gradient(90deg, 
    rgba(255, 215, 0, 0.1) 0%, 
    rgba(255, 215, 0, 0.3) 50%, 
    rgba(255, 215, 0, 0.1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  height: 1em;
  width: 100px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─────────── Estados de error ─────────── */
.date-error {
  color: #ff4757;
  font-style: italic;
  font-size: 0.8rem;
}

.date-error::before {
  content: '⚠️ ';
}

/* ─────────── Mejoras adicionales ─────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: rgba(255, 215, 0, 0.6);
}

.empty-state h4 {
  color: #FFD700;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255, 215, 0, 0.7);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: rgba(255, 215, 0, 0.1);
  color: #FFD700;
  transform: scale(1.1);
}

.back-button {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #FFD700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.back-button:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateX(-2px);
}