/* Operation Hellfire Specific Stylesheet */

:root {
  --bg-ops: #0a0a0c;
  --bg-panel: rgba(16, 16, 20, 0.7);
  --bg-panel-header: rgba(30, 30, 38, 0.8);
  --border-ops: rgba(255, 51, 51, 0.15);
  --border-ops-glow: rgba(255, 51, 51, 0.4);
  
  --neon-red: #ff3333;
  --neon-orange: #ff7700;
  --neon-green: #33ff33;
  
  --text-ops-main: #fca5a5;
  --text-ops-bright: #ffcccc;
  --text-ops-muted: #7f5f5f;
  
  --font-ops: 'JetBrains Mono', monospace;
  
  --shadow-red-glow: 0 0 15px rgba(255, 51, 51, 0.35);
  --transition-fast: all 0.15s ease;
}

/* CRT Screen Scanline & Flicker overlays */
.crt-screen {
  background-color: var(--bg-ops);
  color: var(--text-ops-main);
  font-family: var(--font-ops);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background-image: 
    linear-gradient(to bottom, rgba(10, 10, 12, 0.85), rgba(10, 10, 12, 0.95)),
    url('../assets/hellfire-bg.png');
  background-size: cover;
  background-position: center;
  position: relative;
}

/* CRT Screen Scanline Overlay */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg, 
    rgba(255, 0, 0, 0.06), 
    rgba(0, 255, 0, 0.02), 
    rgba(0, 0, 255, 0.06)
  );
  background-size: 100% 4px, 6px 100%;
  z-index: 200;
  pointer-events: none;
}

/* CRT Flicker Animation */
@keyframes crt-flicker {
  0% { opacity: 0.985; }
  50% { opacity: 0.992; }
  100% { opacity: 0.985; }
}

.flicker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 16, 16, 0.02);
  opacity: 0;
  z-index: 201;
  pointer-events: none;
  animation: crt-flicker 0.15s infinite;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: var(--text-ops-muted);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-red);
}

/* Layout Wrapper */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* Header & HUD Details */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-ops);
  box-shadow: var(--shadow-red-glow);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.hud-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hud-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--neon-red);
  text-shadow: 0 0 8px rgba(255, 51, 51, 0.6);
  margin: 0;
}

.pulse-red-dot {
  width: 10px;
  height: 10px;
  background-color: var(--neon-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-red);
  animation: pulse-red 1.5s infinite ease-in-out;
}

@keyframes pulse-red {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 18px var(--neon-red); }
}

.hud-stats {
  display: flex;
  gap: 2.5rem;
}

.stat-group {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
}

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

.stat-val {
  font-weight: 700;
}

.text-red {
  color: var(--neon-red);
  text-shadow: 0 0 5px rgba(255, 51, 51, 0.3);
}

.text-orange {
  color: var(--neon-orange);
  text-shadow: 0 0 5px rgba(255, 119, 0, 0.3);
}

.text-green {
  color: var(--neon-green);
  text-shadow: 0 0 5px rgba(51, 255, 51, 0.3);
}

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

.back-link {
  font-size: 0.85rem;
  color: var(--text-ops-main);
  text-decoration: none;
  border: 1px solid var(--border-ops);
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  transition: var(--transition-fast);
  font-weight: 700;
}

.back-link:hover {
  background: var(--neon-red);
  color: #000;
  box-shadow: 0 0 10px var(--neon-red);
  border-color: var(--neon-red);
}

/* Dashboard Main Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  flex: 1;
  min-height: 0; /* fixes flexbox item height bug */
}

/* HUD Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-ops);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.panel-header {
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-ops);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-ops-bright);
  letter-spacing: 0.05em;
}

.panel-meta {
  font-size: 0.75rem;
  color: var(--text-ops-muted);
}

.panel-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Terminal Console Panel */
.terminal-panel {
  min-height: 0;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 51, 51, 0.1);
  padding-top: 1rem;
}

.prompt {
  color: var(--neon-orange);
  font-weight: 700;
  user-select: none;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-ops-bright);
  font-family: var(--font-ops);
  font-size: 0.9rem;
  caret-color: var(--neon-red);
}

/* Side Column panels */
.side-hud-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

.node-panel {
  flex: 1.3;
}

.meter-panel {
  flex: 1;
}

/* Nodes Grid */
.nodes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.node-cell {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.node-cell:hover {
  background: rgba(255, 51, 51, 0.04);
  border-color: rgba(255, 51, 51, 0.3);
}

.node-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.node-indicator.green {
  background-color: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green);
}

.node-indicator.orange {
  background-color: var(--neon-orange);
  box-shadow: 0 0 6px var(--neon-orange);
}

.node-indicator.red {
  background-color: var(--neon-red);
  box-shadow: 0 0 6px var(--neon-red);
}

.node-indicator.gray {
  background-color: #666;
}

.node-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-ops-bright);
}

.node-status {
  font-size: 0.7rem;
  font-weight: 800;
}

/* Diagnostic Meters */
.meter-group {
  margin-bottom: 1rem;
}

.meter-group:last-child {
  margin-bottom: 0;
}

.meter-label {
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-ops-muted);
}

.meter-bar-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.meter-bar {
  height: 100%;
  border-radius: 4px;
}

.meter-bar.bg-red {
  background-color: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red);
}

.meter-bar.bg-green {
  background-color: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
}

.meter-bar.bg-orange {
  background-color: var(--neon-orange);
  box-shadow: 0 0 8px var(--neon-orange);
}

.meter-value {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
}

/* Blink Utility */
.blink {
  animation: blinker-ops 1s linear infinite;
}

@keyframes blinker-ops {
  50% { opacity: 0.2; }
}

/* Responsive adjustments */
@media (max-width: 968px) {
  .dashboard-wrapper {
    height: auto;
    overflow-y: auto;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .terminal-panel {
    height: 400px;
  }
  
  .hud-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .hud-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}
