/**
 * filemon_cockpit.css
 *
 * Estilos Obsidian-Gold Glassmorphism para Filemón Prime Copilot.
 * Integración nativa con la estética de Store Director Grimoire y Showroom de lujo.
 *
 * @author Filemón Coder
 * @version 1.0.0 (Septiembre 2026)
 */

/* ==========================================================================
   1. TRIGGER BADGE FLOTANTE
   ========================================================================== */
.filemon-trigger-badge {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 29, 0.92);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.25);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
}

.filemon-trigger-badge:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 30px rgba(212, 175, 55, 0.45);
}

.filemon-trigger-badge:active {
  transform: scale(0.96);
}

.filemon-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.filemon-halo-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  opacity: 0.6;
  animation: filemonHaloPulse 3s infinite ease-in-out;
  pointer-events: none;
}

@keyframes filemonHaloPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.12); opacity: 0.85; }
}

.filemon-pulse-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #060911;
  box-shadow: 0 0 8px #10b981;
}

.filemon-pulse-dot.amber {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.filemon-pulse-dot.ruby {
  background: #f43f5e;
  box-shadow: 0 0 8px #f43f5e;
}

/* ==========================================================================
   2. TARJETA COCKPIT EXPANDIBLE (GLASSMORPHISM)
   ========================================================================== */
.filemon-cockpit-card {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: rgba(8, 13, 26, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 40px rgba(212, 175, 55, 0.15);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: filemonPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f8fafc;
}

@keyframes filemonPopIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.filemon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filemon-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filemon-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.5);
  object-fit: cover;
}

.filemon-name {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #fcf6ba 0%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.filemon-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filemon-lat-badge {
  color: #34d399;
  font-weight: 700;
}

.filemon-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filemon-icon-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.filemon-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

/* Radar Breadcrumbs Bar */
.filemon-radar-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  overflow-x: auto;
  white-space: nowrap;
}

.filemon-radar-tag {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* Chat Stream */
.filemon-chat-stream {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.filemon-msg {
  max-width: 90%;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.filemon-msg.user {
  align-self: flex-end;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 14px 14px 2px 14px;
}

.filemon-msg.bot {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  padding: 12px 16px;
  border-radius: 14px 14px 14px 2px;
}

.filemon-msg.bot h3 {
  font-size: 14px;
  color: #fbbf24;
  margin-top: 0;
  margin-bottom: 8px;
}

.filemon-msg.bot p {
  margin: 0 0 8px 0;
}

.filemon-msg.bot p:last-child {
  margin-bottom: 0;
}

.filemon-msg.bot ul, .filemon-msg.bot ol {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.filemon-msg.bot li {
  margin-bottom: 4px;
}

.filemon-msg.bot code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #38bdf8;
}

/* Action Chips Bar */
.filemon-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 12px 16px;
  background: rgba(0, 0, 0, 0.15);
}

.filemon-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #f8fafc;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.filemon-chip-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: #fbbf24;
  color: #fff;
  transform: translateY(-1px);
}

.filemon-chip-btn:active {
  transform: scale(0.96);
}

/* Form Input */
.filemon-form {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 8px;
}

.filemon-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

.filemon-input:focus {
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.filemon-send-btn {
  background: linear-gradient(135deg, #d4af37, #aa771c);
  border: none;
  color: #060911;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.filemon-send-btn:hover {
  transform: scale(1.05);
}

.filemon-send-btn:active {
  transform: scale(0.95);
}

/* Toast */
.filemon-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 185, 129, 0.95);
  color: #060911;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: filemonFadeToast 2.5s forwards;
  z-index: 1000000;
}

@keyframes filemonFadeToast {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  15%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* Highlight Pulse en DOM */
.filemon-highlight-pulse {
  animation: filemonElementPulse 2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes filemonElementPulse {
  0% { outline: 3px solid #fbbf24; box-shadow: 0 0 25px #fbbf24; }
  100% { outline: 3px solid transparent; box-shadow: none; }
}

/* Responsive Mobile Bottom Sheet */
@media (max-width: 600px) {
  .filemon-cockpit-card {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 80vh;
    border-radius: 20px 20px 0 0;
  }
}

/* ==========================================================================
   7. LIVING AMBIENT BEACON & CSD TELEMETRY PILL
   ========================================================================== */
.filemon-beacon-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.filemon-beacon-wrapper.filemon-dragging {
  cursor: grabbing !important;
  transition: none !important;
  user-select: none !important;
  transform: scale(1.05);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

.filemon-beacon-wrapper.filemon-dragging * {
  cursor: grabbing !important;
  pointer-events: none;
}

/* Ensure Filemón never covers a sticky dock footer or bottom action bar */
body:has(.vx-dock-footer) .filemon-beacon-wrapper,
body:has(#vx-dock-footer) .filemon-beacon-wrapper,
body:has(#btn-cockpit-stamp) .filemon-beacon-wrapper,
body:has(.vx-btn-stamp) .filemon-beacon-wrapper,
body.has-dock-footer .filemon-beacon-wrapper {
  bottom: calc(var(--vx-dock-height, 72px) + 18px) !important;
}

.filemon-beacon-wrapper .filemon-trigger-badge {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  cursor: inherit !important;
}

.filemon-beacon-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 14, 28, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.15);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  user-select: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filemon-beacon-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 24px rgba(56, 189, 248, 0.3);
}

.filemon-beacon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: filemonLedPulse 2s infinite ease-in-out;
}

.filemon-beacon-pill.warning .filemon-beacon-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.filemon-beacon-pill.critical .filemon-beacon-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: filemonLedFastPulse 0.8s infinite ease-in-out;
}

@keyframes filemonLedPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes filemonLedFastPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ==========================================================================
   8. HOVER MICRO-HUD FLYOUT CARD
   ========================================================================== */
.filemon-micro-hud {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: 300px;
  background: rgba(7, 11, 22, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f1f5f9;
  pointer-events: auto;
  animation: filemonHudIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes filemonHudIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.filemon-hud-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 999px;
}

.filemon-hud-latency {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: #34d399;
}

.filemon-hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 7px;
}

.filemon-hud-label {
  color: #94a3b8;
  font-weight: 500;
}

.filemon-hud-val {
  font-weight: 700;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.filemon-hud-ok {
  color: #34d399;
}

.filemon-hud-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

.filemon-hud-footer kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  color: #cbd5e1;
}

/* ==========================================================================
   9. DOM TELEKINESIS LASER HIGHLIGHT
   ========================================================================== */
.qx-tele-highlight {
  position: relative !important;
  outline: 2px solid rgba(56, 189, 248, 0.9) !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.6), inset 0 0 15px rgba(56, 189, 248, 0.2) !important;
  animation: qxTelePulse 2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  transition: all 0.3s ease !important;
}

@keyframes qxTelePulse {
  0% { transform: scale(1.02); filter: brightness(1.3); }
  50% { transform: scale(1.03); filter: brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* ==========================================================================
   10. IN-COCKPIT HOLOGRAPHIC MICRO-WIDGETS
   ========================================================================== */
.filemon-widget-card {
  margin: 10px 0;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.filemon-widget-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #38bdf8 0%, #10b981 50%, #f59e0b 100%);
}

.filemon-widget-title {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Radar Sweep Animation */
.filemon-radar-sweep-box {
  width: 100%;
  height: 90px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(3, 7, 18, 0.9) 70%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.filemon-radar-sweep-needle {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: conic-gradient(from 0deg, rgba(16, 185, 129, 0.4) 0deg, transparent 60deg);
  animation: qxRadarSpin 2s linear infinite;
  pointer-events: none;
}

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

.filemon-radar-center-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 12px #10b981;
  z-index: 2;
}

.filemon-widget-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.filemon-stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}

.filemon-stat-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.filemon-stat-lbl {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
}

/* CSD Progress Bar */
.filemon-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.filemon-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  border-radius: 999px;
  transition: width 0.5s ease;
}

