/* ===================================================================
   KRASH DEV OS — AWAINNOVA INDUSTRIAL AUTOMATION STYLESHEET
   Page: /tecnologia/automatizacion
   Theme: Industrial Control & Process Orchestration (Dashboard UX)
   =================================================================== */

:root {
  --auto-navy-dark: #071624;
  --auto-navy-panel: #0B1E2D;
  --auto-navy-card: rgba(11, 30, 45, 0.85);
  --auto-blue-ctrl: #004A98;
  --auto-blue-light: #38BDF8;
  --auto-amber-alert: #F59E0B;
  --auto-green-safe: #10B981;
  --auto-red-alarm: #EF4444;
  --auto-purple-event: #8B5CF6;
  --auto-border: rgba(56, 189, 248, 0.2);
  --auto-border-active: #38BDF8;
  --auto-font-mono: 'IBM Plex Mono', SFMono-Regular, Consolas, monospace;
  --auto-font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Page baseline */
.page-automatizacion {
  background-color: var(--auto-navy-dark);
  color: #F8FAFC;
  font-family: var(--auto-font-sans);
  overflow-x: hidden;
}

/* Typography & Badges — Anti-Slop: Kickers disabled by default */
.auto-kicker {
  display: none !important;
}

.auto-title-h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.auto-title-h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.22;
  color: #FFFFFF;
}

.auto-title-h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: #FFFFFF;
}

.auto-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: #CBD5E1;
  line-height: 1.65;
}

.auto-badge {
  font-family: var(--auto-font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--auto-blue-light);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Cards & Containers */
.auto-card {
  background: var(--auto-navy-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--auto-border);
  border-radius: 14px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.auto-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

/* Hero Section */
.auto-hero-section {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h, 84px) + 2rem);
  padding-bottom: 4rem;
  overflow: hidden;
}

.auto-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auto-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
}

.auto-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(7, 22, 36, 0.95) 0%,
    rgba(7, 22, 36, 0.88) 48%,
    rgba(7, 22, 36, 0.5) 75%,
    rgba(7, 22, 36, 0.25) 100%
  );
  z-index: 1;
}

@media (max-width: 768px) {
  .auto-hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(7, 22, 36, 0.75) 0%,
      rgba(7, 22, 36, 0.94) 50%,
      rgba(7, 22, 36, 0.98) 100%
    );
  }
}

.auto-hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

/* Industrial Buttons */
.auto-btn-primary {
  background: linear-gradient(135deg, var(--auto-blue-light), var(--auto-blue-ctrl));
  color: #071624;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auto-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
  color: #071624;
}

.auto-btn-outline {
  background: rgba(11, 30, 45, 0.6);
  color: #F8FAFC;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.auto-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #FFFFFF;
  color: #FFFFFF;
}

/* System Explorer (Interactive Diagram & Progressive Disclosure) */
.auto-explorer-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 1.5rem;
  position: relative;
}

@media (max-width: 767.98px) {
  .auto-explorer-diagram {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--auto-blue-light) transparent;
  }
  .auto-explorer-diagram::-webkit-scrollbar {
    height: 4px;
  }
  .auto-explorer-diagram::-webkit-scrollbar-thumb {
    background: var(--auto-blue-light);
    border-radius: 4px;
  }
  .auto-explorer-node {
    flex: 0 0 auto;
    min-width: 140px;
    scroll-snap-align: start;
    white-space: normal;
  }
}

.auto-explorer-node {
  background: rgba(11, 30, 45, 0.7);
  border: 1px solid var(--auto-border);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.auto-explorer-node:hover,
.auto-explorer-node.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--auto-blue-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.auto-explorer-node.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--auto-blue-light);
}

.auto-node-code {
  font-family: var(--auto-font-mono);
  font-size: 0.68rem;
  color: var(--auto-blue-light);
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.auto-node-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #FFFFFF;
}

/* Progressive Disclosure Button & Collapse */
.auto-toggle-tech-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--auto-blue-light);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--auto-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.auto-toggle-tech-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--auto-blue-light);
  color: #FFFFFF;
}

.auto-tech-details-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.auto-tech-details-collapse.open {
  max-height: 480px;
  transition: max-height 0.35s ease-in-out;
}

/* Sequential State Machine */
.auto-seq-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: var(--auto-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 30, 45, 0.8);
  color: #F8FAFC;
  transition: all 0.2s ease;
}

.auto-nav-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--auto-blue-light);
  color: #FFFFFF;
}

.auto-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
}

.auto-nav-btn.reset {
  border-color: rgba(245, 158, 11, 0.35);
  color: #FCD34D;
}

.auto-nav-btn.reset:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #F59E0B;
  color: #FFFFFF;
}

.auto-sequence-timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 1.5rem;
}

.auto-seq-step-btn {
  flex: 1;
  min-width: 120px;
  background: rgba(11, 30, 45, 0.6);
  border: 1px solid var(--auto-border);
  border-radius: 8px;
  padding: 10px 8px;
  color: #94A3B8;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.auto-seq-step-btn:hover,
.auto-seq-step-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--auto-green-safe);
  color: #FFFFFF;
}

.auto-seq-num {
  font-family: var(--auto-font-mono);
  font-size: 0.68rem;
  display: block;
  font-weight: 700;
  color: var(--auto-green-safe);
}

.auto-seq-label {
  font-size: 0.82rem;
  font-weight: 700;
}

/* Safety & Status Matrix */
.auto-safety-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.auto-state-card {
  border-radius: 10px;
  padding: 16px;
  background: rgba(7, 22, 36, 0.7);
  border-left: 4px solid;
  transition: transform 0.2s;
  cursor: pointer;
}

.auto-state-card:hover,
.auto-state-card.active {
  transform: translateY(-2px);
  background: rgba(11, 30, 45, 0.9);
}

.auto-state-normal { border-color: var(--auto-green-safe); }
.auto-state-warning { border-color: var(--auto-amber-alert); }
.auto-state-alarm { border-color: var(--auto-red-alarm); }
.auto-state-intervention { border-color: var(--auto-blue-light); }

.auto-state-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.auto-state-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.auto-state-normal .auto-state-indicator { background: var(--auto-green-safe); box-shadow: 0 0 8px var(--auto-green-safe); }
.auto-state-warning .auto-state-indicator { background: var(--auto-amber-alert); box-shadow: 0 0 8px var(--auto-amber-alert); }
.auto-state-alarm .auto-state-indicator { background: var(--auto-red-alarm); box-shadow: 0 0 8px var(--auto-red-alarm); }
.auto-state-intervention .auto-state-indicator { background: var(--auto-blue-light); box-shadow: 0 0 8px var(--auto-blue-light); }

/* Technical Telemetry Callout HUD */
.auto-hud-tag {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--auto-blue-light);
  padding: 10px 14px;
  font-family: var(--auto-font-mono);
  font-size: 0.8rem;
  color: #CBD5E1;
  border-radius: 0 6px 6px 0;
  margin-top: 1rem;
}

/* Section 5: Telemetry MER Showcase */
.auto-telemetry-showcase {
  background: linear-gradient(180deg, rgba(11, 30, 45, 0.95), rgba(7, 22, 36, 0.98));
  border: 1px solid var(--auto-border);
  border-radius: 16px;
  padding: clamp(1.5rem, 3.5vw, 2.8rem);
}

.auto-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 1.25rem;
}

.auto-telemetry-metric {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
}

/* Section 6: In-line vs Laboratory Comparison Table */
.auto-comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--auto-border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(11, 30, 45, 0.8);
}

.auto-comparison-table th,
.auto-comparison-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.auto-comparison-table th {
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--auto-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auto-blue-light);
}

/* Section 7: Human Operator Checklist */
.auto-operator-checklist {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auto-operator-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
}

.auto-operator-ico {
  color: var(--auto-green-safe);
  flex-shrink: 0;
  margin-top: 2px;
}

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