/**
 * Omni-Quantum Design System — Supremacía visual MED-BOLIVIA / OmniMed
 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;600;700&family=Urbanist:wght@400;500;600;700&display=swap');
@import url('/css/nexo-omni-cuantico.css');
@import url('/css/omnimed-oraculo.css');

:root {
  --omni-bg: #040b14;
  --omni-panel: rgba(8, 14, 28, 0.72);
  --omni-glass: rgba(6, 12, 24, 0.55);
  --cyan-glow: #00ffff;
  --magenta-glow: #ff00ff;
  --omni-text: #e8f4ff;
  --omni-muted: #7a8fa8;
  --omni-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --omni-dur: 0.38s;
  --omni-glow-border: 0 0 12px rgba(0, 255, 255, 0.35), 0 0 32px rgba(255, 0, 255, 0.12);
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Urbanist', 'Rajdhani', system-ui, sans-serif;

  --nexo-bg: var(--omni-bg);
  --nexo-panel: var(--omni-panel);
  --nexo-cyan: var(--cyan-glow);
  --nexo-magenta: var(--magenta-glow);
  --nexo-cyan-dim: rgba(0, 255, 255, 0.35);
  --nexo-magenta-dim: rgba(255, 0, 255, 0.35);
  --nexo-text: var(--omni-text);
  --nexo-muted: var(--omni-muted);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.nexo-body,
body.omnimed-ecosistema {
  background: var(--omni-bg) !important;
  color: var(--omni-text);
  font-family: var(--font-body);
  transition: background-color var(--omni-dur) var(--omni-ease), color var(--omni-dur) var(--omni-ease);
}

/* ── Cabecera premium unificada ── */
.omnimed-quantum-premium-bar,
.omnimed-ecosistema-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.55rem 1rem;
  margin: 0;
  border-bottom: 1px solid rgba(0, 255, 255, 0.35);
  background: var(--omni-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--omni-glow-border);
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 200;
}

.omni-bar-brand {
  color: var(--cyan-glow);
  text-decoration: none;
  font-weight: 700;
}

.omni-bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
}

.omni-bar-links a,
.omnimed-ecosistema-bar a {
  color: var(--cyan-glow);
  text-decoration: none;
  transition: color var(--omni-dur), text-shadow var(--omni-dur);
}

.omni-bar-links a:hover,
.omnimed-ecosistema-bar a:hover {
  color: #fff;
  text-shadow: 0 0 12px var(--cyan-glow);
}

.omni-bar-links a[aria-current='page'] {
  color: var(--magenta-glow);
  text-shadow: 0 0 10px var(--magenta-glow);
}

/* ── Glassmorphism + glowing ── */
.omni-glass,
.nexo-panel,
.nexo-hex-frame,
.oraculo-shell,
body.omnimed-ecosistema .rounded-3xl,
body.omnimed-ecosistema .rounded-2xl,
body.omnimed-ecosistema .rounded-xl,
body.omnimed-ecosistema .bg-white,
body.omnimed-ecosistema .bg-gray-50,
body.omnimed-ecosistema .bg-slate-50 {
  background: var(--omni-glass) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 255, 255, 0.28) !important;
  box-shadow: var(--omni-glow-border);
}

.nexo-bg-grid {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 255, 255, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 0, 255, 0.06), transparent 50%),
    linear-gradient(180deg, var(--omni-bg) 0%, #0a0f1a 100%) !important;
}

#omni-orb-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

body.omni-dash-orb #omni-orb-layer {
  opacity: 0.38;
}

.nexo-hub,
.nexo-dash {
  position: relative;
  z-index: 1;
}

/* ── Dashboard: fade-in + slide-up por sección ── */
.nexo-dash .nexo-panel,
.nexo-dash .nexo-matriz-section {
  animation: omni-slide-up 0.55s var(--omni-ease) both;
}

.nexo-dash .nexo-panel:nth-of-type(1) {
  animation-delay: 0.05s;
}
.nexo-dash .nexo-panel:nth-of-type(2) {
  animation-delay: 0.12s;
}
.nexo-dash .nexo-panel:nth-of-type(3) {
  animation-delay: 0.18s;
}
.nexo-dash .nexo-matriz-section:nth-child(1) {
  animation-delay: 0.22s;
}
.nexo-dash .nexo-matriz-section:nth-child(2) {
  animation-delay: 0.28s;
}
.nexo-dash .nexo-matriz-section:nth-child(3) {
  animation-delay: 0.34s;
}
.nexo-dash .nexo-matriz-section:nth-child(4) {
  animation-delay: 0.4s;
}
.nexo-dash .nexo-matriz-section:nth-child(5) {
  animation-delay: 0.46s;
}
.nexo-dash .nexo-matriz-section:nth-child(6) {
  animation-delay: 0.52s;
}
.nexo-dash .nexo-dash__nav {
  animation: omni-fade-in 0.6s var(--omni-ease) 0.35s both;
}

@keyframes omni-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes omni-slide-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.omni-panel-enter {
  animation: omni-slide-up 0.5s var(--omni-ease) both;
}

/* ── Micro-interacciones ── */
.nexo-hub-card,
.nexo-btn,
.nexo-matriz-card,
.nexo-nav-link,
.nexo-metric,
.oraculo-msg,
button,
a.nexo-btn,
body.omnimed-ecosistema button,
body.omnimed-ecosistema a[class*='bg-blue'] {
  transition:
    transform var(--omni-dur) var(--omni-ease),
    box-shadow var(--omni-dur) var(--omni-ease),
    border-color var(--omni-dur) var(--omni-ease),
    color var(--omni-dur) var(--omni-ease),
    background var(--omni-dur) var(--omni-ease);
  font-family: var(--font-body);
}

.nexo-hub-card:hover,
.nexo-matriz-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 28px var(--nexo-cyan-dim);
}

.nexo-hub-card:active,
.nexo-btn:active,
#oraculoSend:active {
  transform: translateY(0) scale(0.98);
}

/* ── Módulos: Farmacia · Oráculo · Bóveda ── */
body.omnimed-ecosistema h1,
body.omnimed-ecosistema h2,
body.omnimed-ecosistema .font-logo,
.oraculo-header h1,
.nexo-hub__title,
.nexo-panel__title {
  font-family: var(--font-display) !important;
  letter-spacing: 0.08em;
}

body.omnimed-ecosistema table,
body.omnimed-ecosistema .divide-y,
.oraculo-messages {
  border-color: rgba(0, 255, 255, 0.22) !important;
}

body.omnimed-ecosistema table th,
body.omnimed-ecosistema table td,
body.omnimed-ecosistema thead,
body.omnimed-ecosistema tbody tr {
  border-color: rgba(0, 255, 255, 0.2) !important;
  color: var(--omni-text) !important;
}

body.omnimed-ecosistema table thead {
  background: rgba(0, 255, 255, 0.08) !important;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.omnimed-ecosistema table tbody tr:hover {
  background: rgba(255, 0, 255, 0.06) !important;
  box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.08);
}

/* ── Legado integrado ── */
body.omnimed-ecosistema {
  background: var(--omni-bg) !important;
  color: var(--omni-text) !important;
}

body.omnimed-ecosistema::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(0, 255, 255, 0.07), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 100%, rgba(255, 0, 255, 0.05), transparent 50%);
}

body.omnimed-ecosistema > *:not(script) {
  position: relative;
  z-index: 1;
}

body.omnimed-ecosistema .bg-\[\#0F172A\],
body.omnimed-ecosistema .bg-slate-950,
body.omnimed-ecosistema .bg-\[\#030712\],
body.omnimed-ecosistema .bg-\[\#070b14\] {
  background: var(--omni-glass) !important;
  border-color: rgba(0, 255, 255, 0.2) !important;
}

body.omnimed-ecosistema .text-gray-900,
body.omnimed-ecosistema .text-slate-900,
body.omnimed-ecosistema .text-\[\#0F172A\] {
  color: var(--omni-text) !important;
}

body.omnimed-ecosistema .text-gray-400,
body.omnimed-ecosistema .text-gray-500,
body.omnimed-ecosistema .text-slate-400,
body.omnimed-ecosistema .text-slate-500 {
  color: var(--omni-muted) !important;
}

body.omnimed-ecosistema .bg-blue-600,
body.omnimed-ecosistema .bg-blue-500,
body.omnimed-ecosistema button[type='submit'] {
  background: rgba(0, 255, 255, 0.14) !important;
  border: 1px solid var(--cyan-glow) !important;
  color: var(--cyan-glow) !important;
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.2);
}

body.omnimed-ecosistema input,
body.omnimed-ecosistema select,
body.omnimed-ecosistema textarea,
#oraculoInput {
  background: rgba(0, 0, 0, 0.45) !important;
  color: var(--omni-text) !important;
  border: 1px solid rgba(0, 255, 255, 0.32) !important;
  border-radius: 0.5rem;
  transition: border-color var(--omni-dur), box-shadow var(--omni-dur);
  font-family: var(--font-body);
}

body.omnimed-ecosistema input:focus,
body.omnimed-ecosistema select:focus,
body.omnimed-ecosistema textarea:focus,
#oraculoInput:focus {
  border-color: var(--cyan-glow) !important;
  box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.25), 0 0 20px rgba(0, 255, 255, 0.15) !important;
  outline: none;
}

/* ── Transiciones globales entre vistas (sin saltos bruscos) ── */
body.omnimed-ecosistema main,
body.omnimed-ecosistema > section,
body.omnimed-ecosistema .omni-view-enter,
body.nexo-body .nexo-hub,
body.nexo-body .nexo-dash {
  animation: omni-page-fade 0.48s var(--omni-ease) both;
}

@keyframes omni-page-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tarjetas glass premium */
body.omnimed-ecosistema [class*='rounded'],
.nexo-matriz-card,
.nexo-hub-card,
.nexo-panel {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Fase 4: móvil + accesibilidad (44px táctil, sin overflow) ── */
html,
body.nexo-body,
body.omnimed-ecosistema {
  overflow-x: clip;
  max-width: 100vw;
}

button,
.nexo-btn,
.nexo-hub-card,
.nexo-matriz-card,
.nexo-nav-link,
#oraculoSend,
.oraculo-btn-sm,
body.omnimed-ecosistema a[class*='px-'],
body.omnimed-ecosistema button {
  min-height: 44px;
  min-width: 44px;
}

.oraculo-input-row .nexo-btn,
.oraculo-btn-sm {
  min-height: 44px;
  padding: 0.65rem 1rem;
}

.omnimed-quantum-premium-bar a,
.skip-link:focus {
  outline: 3px solid var(--cyan-glow);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .oraculo-chat-header__actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .nexo-hub__grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Génesis: Pasaporte QR ── */
.omni-pasaporte-genesis {
  text-align: center;
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.omni-pasaporte-genesis__title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-glow);
}

.omni-pasaporte-genesis__desc {
  font-size: 0.8rem;
  color: var(--omni-muted);
  margin: 0.5rem 0 1rem;
  line-height: 1.4;
}

.omni-pasaporte-genesis__qr-wrap {
  display: inline-block;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 1rem;
  border: 1px solid rgba(0, 255, 255, 0.45);
  box-shadow: 0 0 28px rgba(0, 255, 255, 0.2);
}

.omni-pasaporte-genesis__qr-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
}

.omni-pasaporte-genesis__code {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--magenta-glow);
  margin: 0.75rem 0;
}

.omni-pasaporte-genesis__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}
