/* =========================================================
   PANJNET.UK — DESIGN SYSTEM v2 (STABLE BUILD)
   Retro Workbench Inspired Interface
   ========================================================= */


/* =========================================================
   1. RESET / BASE LAYER
========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.5;
  color: #d6d6d6;
  background:
    radial-gradient(circle at 20% 10%, #1a2230 0%, transparent 40%),
    radial-gradient(circle at 80% 60%, #101820 0%, transparent 45%),
    #0d1117;
  overflow: hidden;
  display: block;
}


/* CRT scanlines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    transparent 2px,
    transparent 4px
  );
  z-index: 9998;
}


/* vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0,0,0,0.45)
  );
  z-index: 9997;
}


/* =========================================================
   2. DESIGN TOKENS
========================================================= */

:root {
  --bg: #0d1117;
  --panel: #3d3d3d;
  --panel-dark: #7a7a7a;
  --panel-light: #ffffff;
  --accent-blue: #4a90e2;
  --accent-amber: #ffb347;
  --text: #d6d6d6;
  --text-dark: #111;
  --shadow-in: #5a5a5a;
  --shadow-out: #ffffff;
  --radius: 4px;
  --max-width: 1400px;
}


/* =========================================================
   3. TYPOGRAPHY
========================================================= */

h1, h2, h3 {
  font-family: "VT323", monospace;
  letter-spacing: 1px;
  margin-top: 0;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* =========================================================
   4. LAYOUT SYSTEM
========================================================= */

.container,
.site-shell {
  width: 100%;
  max-width: var(--max-width);
  height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* MAIN LAYOUT FOR ALL PAGES - consistent with retrosystems */
.hardware-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

/* HOME PAGE LAYOUT - single column, full width */
.home-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

/* For pages with two columns */
.two-column-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.page-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .two-column-layout {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   5. PANEL / WINDOW SYSTEM
========================================================= */

.panel {
  background-color: var(--panel);
  border-top: 2px solid var(--shadow-out);
  border-left: 2px solid var(--shadow-out);
  border-right: 2px solid var(--shadow-in);
  border-bottom: 2px solid var(--shadow-in);
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #6a6a6a,
    0 10px 25px rgba(0,0,0,0.35);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  transition: 0.15s ease;
  min-height: 0;
  overflow-y: visible;
}

.panel:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #6a6a6a,
    0 12px 28px rgba(0,0,0,0.5);
}

/* Only apply scrolling to content panels, NOT the header/nav/footer */
.main-content .panel,
.home-layout .panel,
.two-column-layout .panel,
.hardware-layout .panel {
  overflow-y: auto;
}

/* Panel titles - no margin changes, keep original */
.panel-title {
  background: linear-gradient(90deg, var(--accent-blue), #2f6fb3);
  color: #FFAA00;
  padding: 6px 10px;
  font-weight: bold;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.35);
}

.panel-title::after {
  content: "■ □ ×";
  font-size: 10px;
  opacity: 0.6;
  letter-spacing: 2px;
}


/* =========================================================
   7. HEADER SYSTEM
========================================================= */

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  overflow: visible;
}

.logo {
  font-family: "VT323", monospace;
  font-size: 42px;
  letter-spacing: 2px;
  color: var(--accent-blue);
  text-shadow: 2px 2px 0 #000;
}

/* SVG LOGO - size controlled by HTML attributes only */
.panjnet-logo {
  display: block;
  flex-shrink: 0;
}


/* =========================================================
   SVG ANIMATIONS - Firefox Compatible
   ========================================================= */

@keyframes pulse1 {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(4.5); }
}

@keyframes pulse2 {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(4.5); }
}

@keyframes pulse3 {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(4.5); }
}

.panjnet-logo .signal {
  fill: none;
  stroke: #FFAA00;
  stroke-width: 2;
  opacity: 0;
  transform-origin: 42px 35px;
}

.panjnet-logo .wave1 {
  animation: pulse1 2s ease-out infinite;
}

.panjnet-logo .wave2 {
  animation: pulse2 2s ease-out infinite 0.6s;
}

.panjnet-logo .wave3 {
  animation: pulse3 2s ease-out infinite 1.2s;
}


/* =========================================================
   NAVIGATION SYSTEM
========================================================= */

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
}

.nav a {
  background-color: #c9c9c9;
  color: var(--text-dark);
  padding: 6px 10px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #6f6f6f;
  border-bottom: 2px solid #6f6f6f;
  display: inline-block;
}

.nav a:hover {
  background: var(--accent-blue);
  color: #FFAA00;
}


/* =========================================================
   BUTTONS
========================================================= */

.button {
  background-color: #c9c9c9;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #6f6f6f;
  border-bottom: 2px solid #6f6f6f;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}


/* =========================================================
   RETRO SYSTEMS SPECIFIC
========================================================= */

.hardware-layout.retro-grid {
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.machine-grid {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
}

.machine-card {
  background-color: #c9c9c9;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #6f6f6f;
  border-bottom: 2px solid #6f6f6f;
  padding: 12px;
  cursor: pointer;
  transition: 0.15s ease;
  color: #111;
}

.machine-card:hover {
  transform: translateY(-2px);
  background: #d6d6d6;
}

.machine-card.active {
  background: var(--accent-blue);
  color: #FFAA00;
  border-top: 2px solid #6f6f6f;
  border-left: 2px solid #6f6f6f;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.machine-name {
  font-family: "VT323", monospace;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}

.machine-meta {
  font-size: 13px;
  opacity: 0.85;
}

#systemView {
  min-height: 0;
  height: 100%;
}

.machine-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 20px;
}

.spec-box {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-width: 0;
}

.spec-box strong {
  display: block;
  color: #FFAA00;
  margin-bottom: 4px;
}

.machine-log {
  margin-top: 24px;
}

.machine-log-entry {
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(0,0,0,0.15);
  border-left: 3px solid var(--accent-blue);
}

.machine-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}


/* =========================================================
   UTILITIES
========================================================= */

.text-center {
  text-align: center;
}

.small {
  font-size: 0.9em;
  opacity: 0.85;
}


/* =========================================================
   LIGHTBOX GALLERY
========================================================= */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-window {
  max-width: 90vw;
  max-height: 90vh;
  margin: auto;
  background-color: var(--panel);
  border-radius: var(--radius);
}

.gallery-title {
  position: relative;
  padding-right: 36px;
}

.lightbox-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
}

#gallery-image {
  max-width: 70vw;
  max-height: 70vh;
  object-fit: contain;
}

.gallery-nav {
  width: 48px;
  height: 48px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  background-color: #c9c9c9;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #6f6f6f;
  border-bottom: 2px solid #6f6f6f;
}

.gallery-nav:hover {
  background: var(--accent-blue);
  color: #FFAA00;
}

.lightbox-close {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  color: #FFAA00;
  background: #2f6fb3;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #1b4f87;
  border-bottom: 1px solid #1b4f87;
}

.lightbox-close:hover {
  background: #3f7fc3;
}


/* =========================================================
   END OF SYSTEM
========================================================= */