/* ==========================================================================
   HISTRIX ERP | MUNDO IT — DESIGN SYSTEM
   Fusión: Identidad Visual de Mundo IT (www.mundoit.com.ar) + Estilo PostHog (posthog.com)
   ========================================================================== */

:root {
  /* Paleta Oficial de Mundo IT & Histrix ERP */
  --deep: #060012;
  --dark: #0f0525;
  --brand: #1a0a3e;
  --bg-card: #100624;
  --bg-card-hover: #170a34;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);

  /* Violeta Institucional Mundo IT */
  --accent: #9b51e0;
  --accent-hover: #8638cf;
  --accent-light: #c084fc;
  --accent-lavender: #f0eaff;
  --glass: rgba(155, 81, 224, 0.08);
  --glass-border: rgba(155, 81, 224, 0.25);
  --glow-purple: rgba(155, 81, 224, 0.35);

  /* Acentos Eléctricos & Neón PostHog */
  --cyan: #22ffd9;
  --cyan-dark: #06b6d4;
  --cyan-glow: rgba(34, 255, 217, 0.3);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.25);
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;

  /* Jerarquía de Texto */
  --text-pure: #ffffff;
  --text-main: #f0eaff;
  --text-muted: #a395bf;
  --text-subtle: #756591;

  /* Bordes y Sombras Neo-Brutalistas PostHog */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(155, 81, 224, 0.28);
  --border-strong: rgba(155, 81, 224, 0.55);
  --border-cyan: rgba(34, 255, 217, 0.45);
  
  --shadow-brutal: 4px 4px 0px #000;
  --shadow-brutal-sm: 2px 2px 0px #000;
  --shadow-brutal-purple: 4px 4px 0px rgba(155, 81, 224, 0.5);
  --shadow-brutal-cyan: 4px 4px 0px rgba(34, 255, 217, 0.45);

  /* Tipografías Oficiales */
  --font-heading: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Transiciones */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  background-color: var(--deep);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--deep);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 15px;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.font-mono-data {
  font-family: var(--font-mono);
}

/* Fluid Typography */
.hero-headline {
  font-size: clamp(1.75rem, 2.7vw + 0.5rem, 2.85rem);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-headline {
  font-size: clamp(1.7rem, 2.9vw + 0.5rem, 2.6rem);
  line-height: 1.15;
  font-weight: 800;
}

/* PostHog Inline Highlight */
.hero-highlight {
  background: linear-gradient(135deg, var(--cyan) 0%, #a855f7 50%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* Keyboard Tag (PostHog Style) */
kbd, .kbd-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  padding: 1px 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 1px 1px 0px #000;
}

/* ==========================================================================
   Iluminación Ambiental & Grilla Técnica (Mundo IT x PostHog)
   ========================================================================== */
.grid-background {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(155, 81, 224, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 81, 224, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 81, 224, 0.16) 0%, rgba(34, 255, 217, 0.04) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
  opacity: 0.8;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}
.ambient-glow-1 {
  width: 550px;
  height: 550px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.22) 0%, transparent 70%);
}
.ambient-glow-2 {
  width: 500px;
  height: 500px;
  bottom: 5%;
  right: -80px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.16) 0%, transparent 70%);
}

/* ==========================================================================
   PostHog Telemetry Bar (Top System Status)
   ========================================================================== */
.top-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(16, 6, 36, 0.88);
  border-bottom: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-brutal);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: var(--font-mono);
  font-size: 11.5px;
  position: relative;
  z-index: 30;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse-dot 2.2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.badge-subtle {
  color: var(--accent-light);
  background: rgba(155, 81, 224, 0.12);
  border: 1px solid rgba(155, 81, 224, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
}

.badge-cyan {
  color: var(--cyan);
  background: rgba(34, 255, 217, 0.10);
  border: 1.5px solid var(--border-cyan);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  box-shadow: 1px 1px 0px #000;
}

.badge-iso {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  box-shadow: 1px 1px 0px #000;
}

/* ==========================================================================
   Header Navigation (PostHog x Mundo IT)
   ========================================================================== */
.site-header {
  background: rgba(6, 0, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all var(--transition-fast);
}

.brand-product-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
  color: var(--text-pure);
  border: 1px solid var(--accent-light);
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: 1px 1px 0px #000;
  letter-spacing: 0.04em;
}

/* Nav Link Pill Styling */
.nav-link-item {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: #a395bf;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: all var(--transition-fast);
}

.nav-link-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link-item.active {
  color: var(--cyan);
  background: rgba(34, 255, 217, 0.10);
}

/* Nav Buttons with PostHog Tactile Feel */
.nav-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 2px 2px 0px #000;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 3px 3px 0px rgba(155, 81, 224, 0.4);
}

.nav-btn-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #000;
}

.nav-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  color: #ffffff;
  border: 1.5px solid var(--accent-light);
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 3px 3px 0px #000;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-btn-primary:hover {
  background: linear-gradient(135deg, #a855f7 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 4px 4px 0px #000;
}

.nav-btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

/* ==========================================================================
   Neo-Brutalist Surfaces & Cards (PostHog Style)
   ========================================================================== */
.card-material {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-brutal);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.card-material:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-brutal-purple);
  background: var(--bg-card-hover);
}

.card-material-cyan:hover {
  border-color: var(--border-cyan);
  box-shadow: var(--shadow-brutal-cyan);
}

.link-card {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-brutal);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.link-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-brutal-purple);
}

.link-card:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

/* Icon Containers with PostHog solid border */
.card-icon-wrapper {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-subtle);
  box-shadow: 2px 2px 0px #000;
  transition: transform var(--transition-fast);
}

.card-material:hover .card-icon-wrapper,
.link-card:hover .card-icon-wrapper {
  transform: scale(1.08) rotate(-2deg);
}

.theme-cyan {
  background: rgba(6, 182, 212, 0.14);
  color: var(--cyan);
  border-color: rgba(6, 182, 212, 0.35);
}
.theme-purple {
  background: rgba(155, 81, 224, 0.16);
  color: var(--accent-light);
  border-color: rgba(155, 81, 224, 0.4);
}
.theme-green {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.theme-amber {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.theme-blue {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   Botones Táctiles PostHog (Con compresión mecánica al click)
   ========================================================================== */
.btn-primary-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  color: #fff;
  border: 1.5px solid var(--accent-light);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 3px 3px 0px #000;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary-hero:hover {
  background: linear-gradient(135deg, #a855f7 0%, var(--accent) 100%);
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px #000;
}

.btn-primary-hero:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

.btn-secondary-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 3px 3px 0px #000;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary-hero:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px rgba(155, 81, 224, 0.45);
}

.btn-secondary-hero:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

.btn-cyan-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  background: linear-gradient(135deg, var(--cyan) 0%, #06b6d4 100%);
  color: #060012;
  border: 1.5px solid #67e8f9;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 3px 3px 0px #000;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cyan-hero:hover {
  background: linear-gradient(135deg, #a5f3fc 0%, var(--cyan) 100%);
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px #000;
}

.btn-cyan-hero:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

/* ==========================================================================
   PostHog Console & Folder Tabs (Proporción Optimizada Viewport)
   ========================================================================== */
.console-wrapper {
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55), var(--shadow-brutal-purple);
  overflow: hidden;
}

.console-titlebar {
  background: var(--dark);
  padding: 8px 14px;
  border-bottom: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.console-tabs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(16, 6, 36, 0.95);
  border-bottom: 1.5px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.console-tabs-row::-webkit-scrollbar {
  display: none;
}

.console-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-height: 32px;
}

.console-tab:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.05);
}

.console-tab.active {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border-color: var(--accent-light);
  color: var(--text-pure);
  box-shadow: 2px 2px 0px #000;
}

/* ==========================================================================
   Range Slider
   ========================================================================== */
input[type=range] {
  -webkit-appearance: none;
  background: #170936;
  border-radius: 9999px;
  height: 8px;
  border: 1px solid var(--border-subtle);
  outline: none;
  width: 100%;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 12px var(--cyan), 2px 2px 0px #000;
  border: 2px solid #ffffff;
  transition: transform var(--transition-fast);
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* ==========================================================================
   Formularios & Checkboxes Táctiles
   ========================================================================== */
.diag-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--dark);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-pure);
  font-size: 13px;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.diag-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--glow-purple);
  background: var(--bg-card);
}

.diag-check-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-main);
  box-shadow: 2px 2px 0px #000;
  font-family: var(--font-mono);
  font-size: 12px;
}

.diag-check-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.diag-check-pill input:checked + span {
  color: var(--cyan);
  font-weight: 600;
}

/* ==========================================================================
   Custom Scrollbars
   ========================================================================== */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--deep);
}
::-webkit-scrollbar-thumb {
  background: #1e0b3d;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
