/* ══════════════════════════════════════════════════
   NEXUS-STREAM // TELEMETRY FRAMEWORK v2.5
   Network Telemetry Core — DASH Edition
   ══════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─── */
:root {
  --void:          #020509;
  --deep:          #040c14;
  --surface:       #070f1a;
  --panel:         #091220;
  --raised:        #0d1b2e;
  --border-dim:    #0f2038;
  --border-mid:    #1a3450;
  --border-hot:    #1e4a70;
  --cyan:          #00f3ff;
  --cyan-dim:      rgba(0,243,255,0.15);
  --magenta:       #ff0055;
  --magenta-dim:   rgba(255,0,85,0.15);
  --green:         #00ff66;
  --green-dim:     rgba(0,255,102,0.15);
  --yellow:        #ffcc00;
  --yellow-dim:    rgba(255,204,0,0.15);
  --text:          #b4c6ef;
  --text-dim:      #6279a3;
  --text-bright:   #ffffff;
  --glitch-speed:  4s;
}

/* ─── RESET & BASE ─── */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Rajdhani', sans-serif; }
body { background-color: var(--void); color: var(--text); overflow-x: hidden; padding: 20px; min-height: 100vh; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ─── HEADER / HUD ─── */
.hud-header {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--border-mid); background: var(--surface);
  padding: 15px 25px; border-radius: 6px; margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5), inset 0 0 15px var(--cyan-dim);
  position: relative; overflow: hidden;
}
.hud-header::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scanline 3s linear infinite;
}
@keyframes scanline { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.brand { display: flex; align-items: center; gap: 15px; }
.logo-core {
  width: 32px; height: 32px; border: 2px solid var(--cyan); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 18px;
  color: var(--cyan); text-shadow: 0 0 8px var(--cyan);
  animation: pulse-border 2s infinite ease-in-out;
}
@keyframes pulse-border { 0%, 100% { box-shadow: 0 0 5px var(--cyan-dim); } 50% { box-shadow: 0 0 15px var(--cyan); } }
.brand-text h1 { font-family: 'Orbitron', sans-serif; font-size: 20px; font-weight: 700; letter-spacing: 2px; color: var(--text-bright); }
.brand-text p { font-family: 'Share Tech Mono', monospace; font-size: 11px; color: var(--cyan); letter-spacing: 1px; text-transform: uppercase; }

.sys-chips { display: flex; gap: 15px; align-items: center; }
.chip {
  background: var(--panel); border: 1px solid var(--border-dim);
  padding: 6px 14px; border-radius: 4px; display: flex; align-items: center; gap: 8px;
  font-family: 'Share Tech Mono', monospace; font-size: 12px;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip.clock { color: var(--cyan); border-color: rgba(0,243,255,0.3); }

/* ─── GRID LAYOUT ─── */
.hud-grid { display: grid; grid-template-columns: 320px 1fr 400px; gap: 20px; align-items: start; }
@media (max-width: 1200px) { .hud-grid { grid-template-columns: 1fr; } }

/* ─── PANELS ─── */
.panel {
  background: var(--surface); border: 1px solid var(--border-dim);
  border-radius: 6px; padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6); position: relative;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 15px; border-bottom: 1px solid var(--border-dim); padding-bottom: 10px;
}
.panel-title {
  font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--text-bright); letter-spacing: 1px; display: flex; align-items: center; gap: 8px;
}
.panel-title::before { content: '//'; color: var(--cyan); font-family: 'Share Tech Mono', monospace; }
.panel-stat { font-family: 'Share Tech Mono', monospace; font-size: 11px; color: var(--text-dim); }

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block; font-family: 'Share Tech Mono', monospace; font-size: 11px;
  color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.5px;
}
.cyber-select {
  width: 100%; background: var(--panel); border: 1px solid var(--border-mid);
  padding: 10px 12px; border-radius: 4px; color: var(--cyan);
  font-family: 'Share Tech Mono', monospace; font-size: 13px;
  cursor: pointer; outline: none; transition: all 0.3s;
}
.cyber-select:focus, .cyber-select:hover { border-color: var(--cyan); box-shadow: 0 0 10px var(--cyan-dim); }
.cyber-select option { background: var(--surface); color: var(--text); }

/* ─── TELEMETRY CARDS ─── */
.telemetry-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.t-card {
  background: var(--panel); border: 1px solid var(--border-dim); border-radius: 4px;
  padding: 12px 15px; display: flex; justify-content: space-between; align-items: center;
  transition: all 0.2s;
}
.t-card:hover { border-color: var(--border-mid); background: var(--raised); }
.t-label { font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--text-dim); text-transform: uppercase; }
.t-val { font-family: 'Orbitron', sans-serif; font-size: 15px; font-weight: 600; color: var(--cyan); text-shadow: 0 0 4px var(--cyan-dim); }
.t-val.alert { color: var(--magenta); text-shadow: 0 0 4px var(--magenta-dim); }
.t-val.good { color: var(--green); text-shadow: 0 0 4px var(--green-dim); }

/* ─── SIGNAL BARS ─── */
.sig-bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.sig-bar { width: 3px; background: var(--border-mid); height: 100%; transform-origin: bottom; }
.sig-bar:nth-child(1) { height: 25%; }
.sig-bar:nth-child(2) { height: 45%; }
.sig-bar:nth-child(3) { height: 65%; }
.sig-bar:nth-child(4) { height: 85%; }
.sig-bar:nth-child(5) { height: 100%; }
.sig-bars[data-bars="1"] .sig-bar:nth-child(-n+1) { background: var(--magenta); box-shadow: 0 0 5px var(--magenta); }
.sig-bars[data-bars="2"] .sig-bar:nth-child(-n+2) { background: var(--yellow); box-shadow: 0 0 5px var(--yellow); }
.sig-bars[data-bars="3"] .sig-bar:nth-child(-n+3) { background: var(--cyan); box-shadow: 0 0 5px var(--cyan); }
.sig-bars[data-bars="4"] .sig-bar:nth-child(-n+4) { background: var(--cyan); box-shadow: 0 0 5px var(--cyan); }
.sig-bars[data-bars="5"] .sig-bar:nth-child(-n+5) { background: var(--green); box-shadow: 0 0 5px var(--green); }

/* ─── VIDEO VIEWPORT ─── */
.video-viewport {
  background: #000; border: 1px solid var(--border-mid); border-radius: 6px;
  overflow: hidden; position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8); margin-bottom: 20px; aspect-ratio: 16/9;
}
.video-viewport::after {
  content: ''; position: absolute; inset: 0;
  border: 1px solid var(--cyan-dim); pointer-events: none; border-radius: 5px;
}
video { width: 100%; height: 100%; display: block; object-fit: contain; }

/* ─── VIDEO IDLE OVERLAY ─── */
.video-idle-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: rgba(2,5,9,0.92);
  z-index: 5; transition: opacity 0.5s ease;
}
.video-idle-overlay.hidden { opacity: 0; pointer-events: none; }
.video-idle-icon {
  width: 64px; height: 64px; border: 2px solid var(--cyan-dim);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  animation: pulse-border 2.5s infinite ease-in-out;
}
.video-idle-icon svg { width: 28px; height: 28px; fill: var(--cyan); opacity: 0.7; }
.video-idle-text {
  font-family: 'Share Tech Mono', monospace; font-size: 12px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px;
}

/* ─── BUTTONS ─── */
.export-btn {
  width: 100%; background: linear-gradient(135deg, #005f73, #0a9396);
  border: 1px solid var(--cyan); padding: 12px; border-radius: 4px;
  color: var(--text-bright); font-family: 'Orbitron', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: all 0.3s; text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0,243,255,0.2); margin-top: 15px;
}
.export-btn:hover {
  background: linear-gradient(135deg, #0a9396, #94d2bd);
  color: var(--void); transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--cyan-dim);
}
.export-btn:active { transform: translateY(1px); }

/* ─── CHARTS ─── */
.chart-container {
  background: var(--panel); border: 1px solid var(--border-dim);
  border-radius: 4px; padding: 15px; min-height: 260px; margin-bottom: 20px; position: relative;
}

/* ─── LOG TERMINAL ─── */
.log-terminal {
  background: var(--panel); border: 1px solid var(--border-dim);
  border-radius: 4px; padding: 12px; height: 260px; overflow-y: auto;
  font-family: 'Share Tech Mono', monospace; font-size: 11px;
  line-height: 1.5; color: #8fa0c2; border-left: 2px solid var(--cyan);
}
.log-row {
  padding: 4px 6px; border-bottom: 1px solid rgba(15,32,56,0.3);
  display: grid; grid-template-columns: 50px 40px 1fr; gap: 10px;
}
.log-row:hover { background: var(--raised); color: var(--text-bright); }
.log-time { color: var(--cyan); }
.log-tag { color: var(--yellow); text-transform: uppercase; font-weight: 600; }

/* ─── FOOTER ─── */
.hud-footer {
  margin-top: 20px; border-top: 1px solid var(--border-dim); padding-top: 15px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Share Tech Mono', monospace; font-size: 11px; color: var(--text-dim);
}

/* ─── TOAST NOTIFICATIONS ─── */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--surface); border: 1px solid var(--cyan);
  border-radius: 4px; padding: 12px 20px;
  font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--cyan);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px var(--cyan-dim);
  z-index: 9999; display: flex; align-items: center; gap: 10px;
  transform: translateY(100px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-ico {
  width: 16px; height: 16px; background: var(--cyan-dim);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: bold;
}

/* ══════════════════════════════════════════════════
   UPLOAD VIDEO — UI COMPONENTS
   ══════════════════════════════════════════════════ */

/* ─── UPLOAD ZONE (Drag & Drop) ─── */
.upload-zone {
  border: 2px dashed var(--border-mid);
  border-radius: 6px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  background: var(--panel);
}
.upload-zone::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--cyan-dim), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--cyan);
  box-shadow: 0 0 25px var(--cyan-dim), inset 0 0 20px var(--cyan-dim);
}
.upload-zone:hover::before,
.upload-zone.drag-over::before { opacity: 1; }

.upload-zone.drag-over {
  transform: scale(1.01);
}

.upload-icon {
  position: relative; z-index: 1;
  margin: 0 auto 12px;
  width: 48px; height: 48px;
  border: 2px solid var(--border-mid);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s ease;
}
.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-dim);
}
.upload-icon svg {
  width: 22px; height: 22px;
  fill: var(--text-dim);
  transition: fill 0.3s;
}
.upload-zone:hover .upload-icon svg,
.upload-zone.drag-over .upload-icon svg { fill: var(--cyan); }

.upload-label {
  position: relative; z-index: 1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
  line-height: 1.6;
}
.upload-label strong {
  color: var(--cyan); font-weight: 600;
  display: block; margin-bottom: 2px;
}
.upload-label span { font-size: 10px; opacity: 0.6; }
.upload-input { display: none; }

/* ─── UPLOAD PROGRESS ─── */
.upload-progress-wrap {
  margin-top: 12px;
  display: none;
}
.upload-progress-wrap.active { display: block; }

.upload-progress-info {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.upload-filename {
  font-family: 'Share Tech Mono', monospace; font-size: 11px;
  color: var(--cyan); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 180px;
}
.upload-percent {
  font-family: 'Orbitron', sans-serif; font-size: 12px;
  font-weight: 700; color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan-dim);
}

.upload-progress-bar {
  width: 100%; height: 6px;
  background: var(--deep); border-radius: 3px;
  overflow: hidden; position: relative;
  border: 1px solid var(--border-dim);
}
.upload-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #005f73, var(--cyan), #00f3ff);
  border-radius: 3px;
  transition: width 0.3s ease;
  position: relative;
  box-shadow: 0 0 8px var(--cyan-dim);
}
.upload-progress-fill::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: progress-shimmer 1.2s infinite;
}
@keyframes progress-shimmer {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.upload-status-text {
  font-family: 'Share Tech Mono', monospace; font-size: 10px;
  color: var(--text-dim); margin-top: 6px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.upload-status-text.converting { color: var(--yellow); }
.upload-status-text.success { color: var(--green); }
.upload-status-text.error { color: var(--magenta); }

/* ─── (Conversion progress removed — not needed for direct MP4 mode) ─── */

/* ─── VIDEO LIST / SELECTOR ─── */
.video-list-wrap { margin-top: 15px; }

.video-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 180px; overflow-y: auto;
}
.video-list:empty::after {
  content: 'NO_STREAMS_AVAILABLE';
  display: block;
  font-family: 'Share Tech Mono', monospace; font-size: 11px;
  color: var(--text-dim); text-align: center; padding: 15px;
  opacity: 0.5;
}

.video-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
.video-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--border-mid);
  transition: all 0.3s;
}
.video-item:hover {
  border-color: var(--border-mid);
  background: var(--raised);
}
.video-item:hover::before { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.video-item.active {
  border-color: var(--cyan);
  background: var(--raised);
}
.video-item.active::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); width: 3px; }

.video-item-icon {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.video-item-icon svg { width: 14px; height: 14px; fill: var(--text-dim); }
.video-item.active .video-item-icon svg { fill: var(--cyan); }

.video-item-info { flex: 1; min-width: 0; }
.video-item-name {
  font-family: 'Share Tech Mono', monospace; font-size: 11px;
  color: var(--text); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.video-item.active .video-item-name { color: var(--cyan); }
.video-item-meta {
  font-family: 'Share Tech Mono', monospace; font-size: 9px;
  color: var(--text-dim); margin-top: 1px;
}

.video-item-status {
  font-family: 'Share Tech Mono', monospace; font-size: 9px;
  padding: 2px 6px; border-radius: 2px; text-transform: uppercase;
  letter-spacing: 0.5px; flex-shrink: 0;
}
.video-item-status.ready {
  color: var(--green); background: var(--green-dim);
  border: 1px solid rgba(0,255,102,0.2);
}
.video-item-status.converting {
  color: var(--yellow); background: var(--yellow-dim);
  border: 1px solid rgba(255,204,0,0.2);
  animation: pulse-dot 1.5s infinite;
}
.video-item-status.error {
  color: var(--magenta); background: var(--magenta-dim);
  border: 1px solid rgba(255,0,85,0.2);
}

/* ─── SECTION DIVIDER ─── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-mid), transparent);
  margin: 18px 0;
}
