/* --- VARIABLES --- */
:root {
  --chassis-color: #e8e8e8;
  --screen-bezel: #333;
  --btn-face: #fdfdfd;
  --btn-text: #333;
  --accent-color: #ff4400; /* Rams Orange */
}

/* --- GLOBAL LAYOUT --- */
html { box-sizing: border-box; font-size: 16px; }
*, *::before, *::after { box-sizing: inherit; }

body {
  background-color: #2e2e2e;
  background-image: radial-gradient(#383838 1px, transparent 1px);
  background-size: 20px 20px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  margin: 0; padding: 2vh 2vw; /* Dynamic padding */
}

/* --- DYNAMIC CONTAINER (WIDE SCREEN FIX) --- */
.container { 
  width: 95%;        /* Fills 95% of the screen width */
  max-width: 2500px; /* Cap it only at huge resolutions */
  display: flex; flex-direction: column;
  /* Optional: Ensures it looks substantial on vertical monitors */
  min-height: 85vh; 
}

/* --- THE CHASSIS --- */
.control-panel {
  background-color: var(--chassis-color);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(0,0,0,0.05) 100%);
  border-radius: 4px; padding: 40px; 
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.8), inset -1px -1px 0 rgba(0,0,0,0.2), 0 15px 30px rgba(0,0,0,0.5), 0 0 0 1px #000;
  position: relative;
  
  display: flex; flex-direction: column;
  flex-grow: 1; /* Forces chassis to fill the container height */
}

/* Decorative Screws */
.control-panel::before, .control-panel::after, .screws-bottom::before, .screws-bottom::after {
  content: '+'; position: absolute; color: #999; font-family: monospace; font-size: 24px; opacity: 0.5; line-height: 1;
}
.control-panel::before { left: 15px; top: 15px; }
.control-panel::after { right: 15px; top: 15px; }
.screws-bottom { position: absolute; bottom: 15px; left: 0; right: 0; height: 24px; pointer-events: none; }
.screws-bottom::before { left: 15px; }
.screws-bottom::after { right: 15px; }

/* --- HEADER --- */
header {
  margin-bottom: 20px; border-bottom: 2px solid #ccc; padding-bottom: 15px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
}
h1 { font-size: 1.5rem; margin: 0; color: #333; text-transform: uppercase; letter-spacing: 1px; }
.model-number { font-family: monospace; color: #666; font-size: 0.85rem; border: 1px solid #999; padding: 4px 8px; border-radius: 2px; }

/* --- NAVIGATION --- */
.nav {
  display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 10px; 
  margin-bottom: 20px; background: #dcdcdc; padding: 15px; border-radius: 4px;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
}

.nav-btn {
  text-decoration: none; font-weight: bold; font-size: 0.85rem;
  text-transform: uppercase; color: var(--btn-text); padding: 10px 20px;
  background: var(--btn-face); border: 1px solid #bbb; border-radius: 3px;
  box-shadow: 0 4px 0 #999, 0 5px 5px rgba(0,0,0,0.2);
  transition: transform 0.1s, box-shadow 0.1s; display: inline-block; position: relative;
  
  /* Buttons stretch to fill width evenly */
  flex-grow: 1; text-align: center; max-width: 250px; 
}

/* Half-Press Hover Effect */
.nav-btn:hover:not(.active) { transform: translateY(2px); box-shadow: 0 2px 0 #999, 0 3px 3px rgba(0,0,0,0.15); }
/* Full Press Active Effect */
.nav-btn:active, .nav-btn.active { transform: translateY(4px); box-shadow: 0 0 0 #999, inset 0 2px 5px rgba(0,0,0,0.1); background-color: #f0f0f0; }
.nav-btn.active { color: var(--accent-color); }

/* --- LED INDICATOR STYLING --- */

/* 1. Base LED Style (The "Off" State - Visible on all buttons) */
.nav-btn::after {
  content: ''; 
  display: block; 
  width: 6px; 
  height: 6px;
  border-radius: 50%;
  position: absolute; 
  top: 6px; 
  right: 6px;
  
  /* Dark / Recessed Appearance */
  background-color: #444; 
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.1); 
  transition: all 0.1s;
}

/* 2. Active LED Style (The "On" State - Only on selected button) */
.nav-btn.active::after {
  background-color: var(--accent-color);
  /* Remove inset shadow, add outer glow */
  box-shadow: 0 0 2px var(--accent-color), 0 0 5px var(--accent-color);
  /* Apply the flicker animation */
  animation: indicator-flicker 0.15s infinite;
}

/* Flicker Animation */
@keyframes indicator-flicker {
  0% { opacity: 1; } 5% { opacity: 0.8; } 10% { opacity: 0.9; } 20% { opacity: 1; } 
  30% { opacity: 0.9; } 40% { opacity: 0.8; } 50% { opacity: 0.9; } 60% { opacity: 1; } 
  70% { opacity: 0.9; } 80% { opacity: 0.8; } 90% { opacity: 1; } 100% { opacity: 1; }
}

/* --- SCREEN CONTAINER --- */
.screen-wrapper {
  background-color: var(--screen-bezel); padding: 20px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 5px 15px rgba(0,0,0,0.3);
  
  /* Expands to fill available vertical space */
  flex-grow: 1; 
  display: flex; flex-direction: column;
}

/* The Empty Bay (Standard Dark Box) */
.screen-readout {
  background-color: #1a1b1c; 
  padding: 2rem; min-height: 200px; border-radius: 2px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8); border: 1px solid #000;
  position: relative; overflow: hidden;
}

footer { margin-top: 20px; color: #666; font-size: 0.75rem; text-align: center; }

/* --- MOBILE BAREBONES MODE --- */
@media (max-width: 768px) {
  body { padding: 0; background: #111; }
  .container { width: 100%; max-width: 100%; }
  
  .control-panel {
    border-radius: 0; padding: 15px; 
    background-image: none; /* Remove texture */
    box-shadow: none;       /* Remove 3D depth */
    min-height: 100vh;
  }
  
  /* Remove screws */
  .control-panel::before, .control-panel::after, .screws-bottom { display: none; }

  header { border-bottom: 1px solid #999; padding-bottom: 10px; margin-bottom: 15px; }
  
  .nav { padding: 10px; margin-bottom: 15px; gap: 8px; }
  .nav-btn { font-size: 0.75rem; padding: 8px 12px; max-width: none; }
  
  .screen-wrapper { padding: 10px; flex-grow: 1; }
}