/* ==========================================================================
   AgencIAdata + GIO BOT: Suite de Coworkers Autónomos de Inteligencia Artificial
   Estilos Glassmorphism Cyber, Componentes Reactivos y Bitácora Forense
   ========================================================================== */

/* Botón Flotante del Agente */
.openbot-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 14px;
  background: rgba(10, 17, 36, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 50px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}

.openbot-floating-btn:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--color-accent-cyan, #00F0FF);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.45);
}

.openbot-btn-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B5CFF, #00F0FF);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #040813;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
}

.openbot-btn-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid #040813;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.openbot-btn-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.openbot-btn-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.openbot-btn-sub {
  font-size: 0.68rem;
  color: #94A3B8;
  letter-spacing: 0.3px;
}

/* Modal Drawer Principal */
.openbot-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 19, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.openbot-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.openbot-drawer {
  position: fixed;
  top: 16px;
  bottom: 16px;
  right: 16px;
  width: 520px;
  max-width: calc(100vw - 32px);
  background: rgba(10, 17, 36, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 240, 255, 0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}

.openbot-drawer.active {
  transform: translateX(0);
}

/* Drawer Header */
.openbot-header {
  padding: 16px 20px;
  background: rgba(13, 22, 45, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.openbot-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.openbot-header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1B5CFF, #00F0FF);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #040813;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.openbot-header-titles h3 {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 0.95rem;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.openbot-header-badge {
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.openbot-header-meta {
  font-size: 0.7rem;
  color: #94A3B8;
  margin-top: 2px;
}

.openbot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.openbot-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.openbot-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Tabs de Navegación */
.openbot-tabs {
  display: flex;
  background: rgba(7, 12, 26, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  gap: 6px;
  overflow-x: auto;
}

.openbot-tab {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.openbot-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.openbot-tab.active {
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
}

/* Selector de Coworkers */
.openbot-coworker-bar {
  padding: 10px 16px;
  background: rgba(13, 22, 45, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.openbot-coworker-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  color: #94A3B8;
  font-size: 0.74rem;
  font-weight: 500;
}

.openbot-coworker-chip:hover {
  border-color: rgba(0, 240, 255, 0.3);
  color: #ffffff;
  background: rgba(0, 240, 255, 0.05);
}

.openbot-coworker-chip.active {
  background: linear-gradient(135deg, rgba(27, 92, 255, 0.25), rgba(0, 240, 255, 0.15));
  border-color: #00F0FF;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.openbot-coworker-chip span.emoji {
  font-size: 0.95rem;
}

/* Body / Chat Area */
.openbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Mensajes */
.openbot-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  gap: 4px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.openbot-msg.agent {
  align-self: flex-start;
}

.openbot-msg.user {
  align-self: flex-end;
}

.openbot-msg-meta {
  font-size: 0.65rem;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.openbot-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.openbot-msg.agent .openbot-msg-bubble {
  background: rgba(17, 27, 56, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.18);
  color: #E2E8F0;
  border-top-left-radius: 4px;
}

.openbot-msg.user .openbot-msg-bubble {
  background: linear-gradient(135deg, #1B5CFF, #1040B8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-top-right-radius: 4px;
}

/* Tarjetas Dinámicas de Validación y Hallazgos */
.openbot-card {
  margin-top: 10px;
  background: rgba(7, 13, 29, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.openbot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.openbot-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #00F0FF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.openbot-status-badge {
  font-size: 0.64rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.openbot-status-badge.aprobado {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.openbot-status-badge.alerta {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.openbot-status-badge.rechazado {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Pasos de Validación 7 Pasos */
.openbot-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.openbot-step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  font-size: 0.74rem;
  color: #CBD5E1;
}

.openbot-step-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.openbot-step-check {
  color: #10B981;
  font-weight: bold;
}

.openbot-step-warn {
  color: #F59E0B;
  font-weight: bold;
}

/* Indicador de Desfase Semáforo */
.openbot-gauge {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
}

.openbot-gauge-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.openbot-gauge-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.openbot-gauge-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Quick Action Prompts */
.openbot-quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: rgba(7, 12, 26, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.openbot-quick-btn {
  font-size: 0.7rem;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 20px;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.openbot-quick-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: #00F0FF;
  color: #ffffff;
}

/* Footer / Input Bar */
.openbot-footer {
  padding: 14px 16px;
  background: rgba(13, 22, 45, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.openbot-input-box {
  flex: 1;
  background: rgba(4, 8, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.82rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.openbot-input-box:focus {
  border-color: #00F0FF;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.openbot-input-box::placeholder {
  color: #64748B;
}

.openbot-send-btn {
  background: linear-gradient(135deg, #1B5CFF, #00F0FF);
  border: none;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #040813;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.openbot-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

/* Auditoría CEL Log View */
.openbot-audit-log {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.72rem;
  color: #94A3B8;
  background: #030610;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.openbot-audit-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.openbot-audit-time {
  color: #475569;
}

.openbot-audit-tag {
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: bold;
}

.openbot-audit-tag.pass {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.openbot-audit-tag.deny {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

/* Navbar Link Indicator */
.nav-link-openbot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  background: rgba(0, 240, 255, 0.08) !important;
  border: 1px solid rgba(0, 240, 255, 0.25) !important;
  border-radius: 20px !important;
  padding: 5px 12px !important;
  color: #00F0FF !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.nav-link-openbot:hover {
  background: rgba(0, 240, 255, 0.16) !important;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3) !important;
  color: #ffffff !important;
}

.nav-openbot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  animation: pulse-dot 2s infinite;
}
