/* ==========================================================================
   DEBCORE OS 2.0 (Phantom) — CSS Design System
   Aesthetic: Premium Glassmorphic Cyber-HUD with dynamic glow states
   ========================================================================== */

/* Root Variables */
:root {
  --bg-primary: #04060f;
  --bg-secondary: #0a0f25;
  --bg-glass: rgba(10, 15, 37, 0.6);
  --border-glass: rgba(0, 240, 255, 0.12);
  --border-glass-hover: rgba(189, 0, 255, 0.25);
  
  --neon-cyan: #00f0ff;
  --neon-purple: #bd00ff;
  --neon-pink: #ff007a;
  
  --text-primary: #ffffff;
  --text-secondary: #8c9cb5;
  --text-muted: #4e5f78;
  
  --font-hud: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-neon-cyan: 0 0 15px rgba(0, 240, 255, 0.3);
  --shadow-neon-purple: 0 0 15px rgba(189, 0, 255, 0.3);
}

/* Reset & Base Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-cyan) var(--bg-primary);
}

html {
  scroll-behavior: smooth;
}

body.cyber-theme {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background WebGL canvas */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: auto;
}

/* Glassmorphism Scrollbars */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

/* HUD Overlay Layer */
.hud-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  pointer-events: none; /* Let canvas receive hover/drag underneath */
}

/* Force enable mouse clicks for interactive panels */
.hud-header,
.hud-panel,
.hud-center-workspace,
.hud-features-grid,
.hud-download-section,
.hud-footer {
  pointer-events: auto;
}

/* HEADER STYLING */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  backdrop-filter: blur(12px) saturate(180%);
  margin-bottom: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}
.hud-header:hover {
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 8px 32px 0 rgba(0, 240, 255, 0.05);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-node {
  font-size: 28px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  animation: logo-spin 8s linear infinite;
}
.logo-text {
  font-family: var(--font-hud);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-primary);
}
.logo-text span {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
}

.hud-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-hud);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  position: relative;
  padding: 6px 0;
}
.nav-link:hover {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
  transition: var(--transition-smooth);
}
.nav-link:hover::after {
  width: 100%;
}
.nav-divider {
  color: var(--text-muted);
}
.download-tab {
  color: var(--neon-cyan) !important;
  text-shadow: var(--shadow-neon-cyan);
  animation: pulse-glow 2s infinite;
}
.download-tab::after {
  background: var(--neon-cyan) !important;
  box-shadow: var(--shadow-neon-cyan) !important;
}

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }
  50% { text-shadow: 0 0 18px rgba(0, 240, 255, 0.8), 0 0 25px rgba(0, 240, 255, 0.4); }
}

/* MAIN DASHBOARD GRID */
.hud-main-grid {
  display: grid;
  grid-template-columns: 360px 1fr 400px;
  gap: 20px;
  margin-bottom: 20px;
  min-height: 550px;
}

/* PANELS */
.hud-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  backdrop-filter: blur(12px) saturate(180%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}
.hud-panel:hover {
  border-color: var(--border-glass-hover);
  box-shadow: 0 8px 32px 0 rgba(189, 0, 255, 0.05);
}

.panel-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-tag {
  font-family: var(--font-hud);
  font-size: 10px;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}
.panel-header h2 {
  font-family: var(--font-hud);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.panel-body {
  padding: 25px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* LEFT PANEL CONTENT */
.tagline {
  font-family: var(--font-hud);
  font-size: 18px;
  font-weight: 800;
  color: var(--neon-cyan);
  margin-bottom: 15px;
  letter-spacing: 1px;
}
.description {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 25px;
}

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}
.spec-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}
.spec-icon {
  font-size: 20px;
  padding: 8px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  color: var(--neon-cyan);
}
.spec-item h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.spec-item p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}
.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: var(--bg-primary);
  border: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
}
.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  transition: 0.75s;
}
.btn:hover .btn-glow {
  left: 150%;
}
.btn-text {
  position: relative;
  z-index: 2;
  color: #000000;
  font-weight: 800;
}

/* CENTER WORKSPACE (3D SCENE WINDOW) */
.hud-center-workspace {
  position: relative;
  border: 1px solid rgba(0, 240, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.hud-center-workspace:hover {
  border-color: rgba(0, 240, 255, 0.15);
}

.3d-viewer-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(4, 6, 15, 0.8), transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-hud);
  font-size: 10px;
  letter-spacing: 1px;
}
.viewer-legend {
  display: flex;
  gap: 15px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.node-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.node-dot.core { background-color: var(--text-primary); }
.node-dot.ai { background-color: var(--neon-pink); box-shadow: 0 0 6px var(--neon-pink); }
.node-dot.security { background-color: var(--neon-cyan); box-shadow: 0 0 6px var(--neon-cyan); }
.node-dot.dev { background-color: var(--neon-purple); box-shadow: 0 0 6px var(--neon-purple); }

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

/* RIGHT PANEL: LIVE INTERACTIVE TERMINAL */
.terminal-body {
  background: rgba(2, 4, 10, 0.85);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}
.terminal-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 5px;
  max-height: 400px;
}
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  border-top: 1px solid rgba(0, 240, 255, 0.1);
  padding-top: 15px;
}
.prompt {
  color: var(--neon-cyan);
  white-space: nowrap;
}
#term-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 1;
  caret-color: var(--neon-cyan);
}
.highlight {
  color: var(--neon-cyan);
  font-weight: bold;
}
.highlight-alt {
  color: var(--neon-purple);
  font-weight: bold;
}
.term-line {
  height: 1px;
  background: rgba(0, 240, 255, 0.05);
}

/* FEATURES GRID SECTION */
.hud-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.grid-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 25px;
  backdrop-filter: blur(12px) saturate(180%);
  transition: var(--transition-smooth);
}
.grid-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px 0 rgba(189, 0, 255, 0.04);
}
.card-icon {
  font-size: 28px;
  margin-bottom: 15px;
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.3));
}
.grid-card h3 {
  font-family: var(--font-hud);
  font-size: 16px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.grid-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* DOWNLOAD & FLASHING GUIDE SECTION */
.hud-download-section {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 40px;
  backdrop-filter: blur(12px) saturate(180%);
  margin-bottom: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}
.hud-download-section:hover {
  border-color: rgba(0, 240, 255, 0.2);
}

.download-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: center;
}

.download-info h2 {
  font-family: var(--font-hud);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 15px;
  background: linear-gradient(to right, #ffffff, var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 30px;
}

.guide-steps h3 {
  font-family: var(--font-hud);
  font-size: 14px;
  color: var(--neon-cyan);
  margin-bottom: 15px;
  letter-spacing: 1px;
}
.guide-steps ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-steps li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.guide-steps strong {
  color: var(--text-primary);
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  padding: 30px;
  background: rgba(0, 240, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.08);
  border-radius: 12px;
}

.stat-card {
  text-align: center;
}
.stat-number {
  font-family: var(--font-hud);
  font-size: 42px;
  font-weight: 900;
  color: var(--neon-purple);
  text-shadow: var(--shadow-neon-purple);
  margin-bottom: 5px;
}
.stat-name {
  font-family: var(--font-hud);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.btn-large {
  width: 100%;
  padding: 18px;
  font-size: 14px;
}

.download-hash {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.download-hash code {
  color: var(--text-secondary);
  word-break: break-all;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.05);
}

/* FOOTER */
.hud-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  backdrop-filter: blur(12px) saturate(180%);
  font-size: 11px;
  color: var(--text-muted);
}
.hud-footer p {
  letter-spacing: 0.5px;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
}
.footer-links a:hover {
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
}

/* ANIMATIONS */
@keyframes logo-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.blink {
  animation: blink 1.5s infinite;
}

/* ==========================================================================
   COMPACT DYNAMIC TABBED LEFT-PANEL STYLES
   ========================================================================== */

/* Active and inactive states */
.tab-panel {
  display: none;
  animation: panel-fade-in 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
.tab-panel.active {
  display: block;
}

@keyframes panel-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-sub-title {
  font-family: var(--font-hud);
  font-size: 13px;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.panel-sub-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 20px;
}

/* TAB 2: DOWNLOAD PANEL STYLES */
.download-action-box {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 15px;
  background: rgba(0, 240, 255, 0.02);
  border: 1px solid rgba(0, 240, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 20px;
}
.download-specs-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.spec-row-mini {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 240, 255, 0.04);
  padding-bottom: 4px;
}
.spec-row-mini span {
  color: var(--text-muted);
}
.spec-row-mini code {
  color: var(--text-secondary);
}
.hash-code-mini {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guide-steps-mini h4 {
  font-family: var(--font-hud);
  font-size: 11px;
  color: var(--neon-cyan);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.guide-steps-mini ol {
  padding-left: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* TAB 3: VERSIONS COMPACT TABLE */
.versions-table-container {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid rgba(0, 240, 255, 0.05);
  border-radius: 6px;
}
.versions-table-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.versions-table-mini th, .versions-table-mini td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 240, 255, 0.04);
}
.versions-table-mini th {
  font-family: var(--font-hud);
  font-size: 9px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}
.versions-table-mini td {
  color: var(--text-secondary);
}
.versions-table-mini tr:hover td {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.01);
}
.glow-cell-mini {
  color: var(--neon-cyan) !important;
  font-weight: 500;
  text-shadow: var(--shadow-neon-cyan);
}

/* TAB 4: HISTORY TIMELINE */
.history-timeline-mini {
  position: relative;
  padding-left: 15px;
  border-left: 1px solid rgba(0, 240, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}
.timeline-item-mini {
  position: relative;
}
.timeline-item-mini::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -19px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
}
.timeline-date-mini {
  font-family: var(--font-hud);
  font-size: 8px;
  font-weight: 800;
  color: var(--neon-purple);
  text-shadow: var(--shadow-neon-purple);
  display: block;
  margin-bottom: 3px;
}
.timeline-item-mini h5 {
  font-family: var(--font-hud);
  font-size: 11px;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.timeline-item-mini p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* TAB 5: DEVELOPER & SYSTEM REQUIREMENT BULLETS */
.dev-spec-section-mini h4 {
  font-family: var(--font-hud);
  font-size: 11px;
  color: var(--neon-purple);
  text-shadow: var(--shadow-neon-purple);
  margin-top: 15px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.dev-spec-section-mini ul {
  padding-left: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  list-style: square;
}

/* TAB 6: SECURITY PRE-CODES */
.sec-pre-mini {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.06);
  border-radius: 4px;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow-x: auto;
  margin-bottom: 15px;
}
.sec-tools-section-mini h4 {
  font-family: var(--font-hud);
  font-size: 11px;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.sec-tools-section-mini ul {
  padding-left: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  list-style: circle;
}

/* HANDBOOK COMPACT PANEL STYLES */
.handbook-container-mini {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}
.handbook-container-mini::-webkit-scrollbar {
  width: 4px;
}
.handbook-container-mini::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
.handbook-container-mini::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 2px;
}
.handbook-section-mini h4 {
  font-family: var(--font-hud);
  font-size: 11px;
  color: var(--neon-cyan);
  margin-top: 15px;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.handbook-section-mini p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}
.handbook-section-mini code {
  color: var(--text-primary);
  font-size: 10px;
  background: rgba(0, 240, 255, 0.05);
  padding: 1px 4px;
  border-radius: 3px;
}
.handbook-download-box {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 240, 255, 0.05);
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   RESPONSIVE MEDIA BREAKPOINTS
   ========================================================================== */

@media (max-width: 1200px) {
  .hud-main-grid {
    grid-template-columns: 360px 1fr;
  }
  .right-panel {
    grid-column: span 2;
    min-height: 250px;
  }
}

@media (max-width: 900px) {
  .hud-main-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .right-panel {
    grid-column: span 1;
  }
  .hud-center-workspace {
    height: 350px;
  }
}

@media (max-width: 600px) {
  .hud-wrapper {
    padding: 10px;
  }
  .hud-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    align-items: center;
  }
  .hud-footer {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}
