/* ============================================================================
   RACK CONSOLE v4.0 — PRODUCTION PALETTE
   Cowley Road Studios Signal Path Interface
   Brand Colors: Nettle Green, Mustard, Fire Red, Vegetation Dark
   ============================================================================ */

:root {
  /* Brand Palette Implementation */
  --nettle-green: #2d3a27;           /* Nettle green */
  --mustard-mus: #e3b448;            /* Mustard mus */
  --fire-red: #d32f2f;               /* Fire colors */
  --vegetation-dark: #1b2618;        /* Vegetation tones */
  --rack-grey: #404940;              /* 40yy 49/400 grey */
  --panel-black: #121212;
  --led-glow: #39ff14;
  --text-light: #f5f5f5;
  --text-muted: rgba(245, 245, 245, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   SIGNAL RAIL - SPINE AND PULSING DOT
   ============================================================================ */

.signal-rail {
  position: relative;
  padding-left: 30px;
}

.signal-rail::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--rack-grey);
  border-left: 2px solid var(--mustard-mus);
  box-shadow: 0 0 8px var(--mustard-mus);
}

.signal-rail::after {
  content: '';
  position: absolute;
  left: 13px;
  width: 8px;
  height: 8px;
  background: var(--led-glow);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--led-glow);
  animation: signal-travel 4s infinite linear;
}

@keyframes signal-travel {
  0% { top: 0%; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

.rack-container {
  background-color: var(--vegetation-dark);
  background-image: linear-gradient(var(--rack-grey) 1px, transparent 1px);
  background-size: 100% 4px; /* Mimics rack-unit spacing */
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: var(--text-light);
  max-width: 1440px;
  margin: 0 auto;
}

/* ============================================================================
   MODULE STRUCTURE
   ============================================================================ */

.rack-module {
  border: 2px solid var(--nettle-green);
  background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.rack-module.op-intro {
  border: 3px solid var(--mustard-mus);
  background: linear-gradient(to right, rgba(227, 180, 72, 0.05), rgba(227, 180, 72, 0.02));
  padding: 3rem 2rem;
  text-align: center;
}

/* Parent Chassis for Rehearsals */
.rack-module.parent {
  border: 3px solid var(--nettle-green);
  border-left: 8px solid var(--nettle-green); /* Visual "handle" */
  background: var(--panel-black);
  padding: 20px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

/* Individual Sub-Modules (Cowley & Cricket) */
.rack-module.sub-rack {
  border: 1px solid var(--rack-grey);
  background: #1e1e1e;
  padding: 15px;
  position: relative;
}

/* ============================================================================
   MODULE HEADER (LED + TITLE + ID)
   ============================================================================ */

.module-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.rack-module.sub-rack .module-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 10px;
}

.led.green {
  background: var(--led-glow);
  box-shadow: 0 0 10px var(--led-glow);
}

.led.yellow {
  background: #ffff00;
  box-shadow: 0 0 10px #ffff00;
}

.led.orange {
  background: #ff9f1c;
  box-shadow: 0 0 10px #ff9f1c;
}

.led.fire {
  background: var(--fire-red);
  box-shadow: 0 0 10px var(--fire-red);
}

.module-title {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0;
  color: var(--text-light);
  text-transform: uppercase;
}

.rack-module.sub-rack .module-title {
  font-size: 1rem;
}

.module-id {
  font-size: 0.75rem;
  color: var(--mustard-mus);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
}

.phase-id {
  font-size: 0.7rem;
  color: var(--mustard-mus);
  letter-spacing: 2px;
  display: block;
  margin-bottom: -5px;
  text-transform: uppercase;
  font-weight: 600;
}

.label-block {
  flex: 1;
}

.label-block h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-light);
  text-transform: uppercase;
}

.led-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pulsing {
  animation: led-pulse 2s infinite ease-in-out;
}

@keyframes led-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ============================================================================
   MODULE BODY & CONTENT
   ============================================================================ */

.module-body {
  position: relative;
  z-index: 1;
}

.module-video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 1rem;
  opacity: 0.7;
  filter: saturate(0.8);
}

.rack-module.sub-rack .module-video {
  height: 120px;
  margin-bottom: 0.75rem;
}

.module-description,
.sub-rack-description,
.system-status,
.op-blurb {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

.op-blurb {
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--text-light);
  margin: 0;
}

.contact-info {
  font-size: 0.9rem;
  line-height: 1.8;
}

.contact-info p {
  margin: 0.5rem 0;
}

.contact-info a {
  color: var(--mustard-mus);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.contact-info a:hover {
  color: var(--fire-red);
  text-decoration: underline;
}

/* ============================================================================
   SUB-RACK ROW (PARENT CHILDREN)
   ============================================================================ */

.sub-rack-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

@media (max-width: 768px) {
  .sub-rack-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============================================================================
   PATCH POINT (QR + CTA)
   ============================================================================ */

.patch-out,
.patch-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.rack-module.sub-rack .patch-point {
  margin-top: 1rem;
  padding-top: 1rem;
}

.qr-container {
  background: white;
  padding: 0.5rem;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.qr-code {
  width: 150px;
  height: 150px;
  display: block;
}

.rack-module.sub-rack .qr-code {
  width: 100px;
  height: 100px;
}

/* ============================================================================
   CALL-TO-ACTION BUTTONS (The Functional "Patch Point")
   ============================================================================ */

.cta-button {
  background: var(--mustard-mus);
  color: var(--panel-black);
  font-weight: 900;
  text-decoration: none;
  padding: 12px 24px;
  display: block;
  text-align: center;
  border: 2px solid #000;
  box-shadow: 2px 2px 0px #000;
  transition: transform 0.1s;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.cta-button:hover {
  background: var(--fire-red);
  color: var(--text-light);
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
}

.cta-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #000;
}

.cta-button-primary {
  width: 100%;
  text-align: center;
}

/* ============================================================================
   RESPONSIVE BEHAVIOR
   ============================================================================ */

@media (max-width: 768px) {
  .rack-container {
    padding: 1rem 0.5rem;
    gap: 1rem;
  }

  .rack-module {
    padding: 1rem;
  }

  .rack-module.parent {
    padding: 1.5rem;
  }

  .rack-module.op-intro {
    padding: 2rem 1rem;
  }

  .module-header {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .module-title {
    font-size: 1rem;
  }

  .module-id {
    font-size: 0.65rem;
  }

  .module-video {
    height: 150px;
  }

  .qr-code {
    width: 120px;
    height: 120px;
  }

  .cta-button {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

/* ============================================================================
   ANIMATION & EFFECTS
   ============================================================================ */

.rack-module {
  animation: rack-mount 0.4s ease-out;
}

@keyframes rack-mount {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.led {
  animation: led-pulse 2s infinite;
}

@keyframes led-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.text-muted {
  color: var(--text-muted);
}

.text-mustard {
  color: var(--mustard-mus);
}

.text-nettle {
  color: var(--nettle-green);
}

.text-fire {
  color: var(--fire-red);
}

/* CSS LIVE MARKER TEST */
body::after {
  content: "CSS LIVE MARKER";
  position: fixed;
  bottom: 6px;
  right: 10px;
  font-size: 12px;
  color: #ffcc00;
  opacity: 0.3;
  z-index: 9999;
}
