* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a1a;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#viewport canvas {
  display: block;
}

/* ─── HUD ─────────────────────────────────────────────────────────────── */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.panel {
  pointer-events: auto;
  background: rgba(10, 10, 30, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 210, 255, 0.15);
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  z-index: 20;
}

.logo {
  font-size: 16px;
  font-weight: 700;
  color: #00d2ff;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.system-info {
  font-size: 12px;
  color: #666;
  flex: 1;
}

.status-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status-label {
  color: #888;
}

.connected {
  color: #00ff88;
}

.disconnected {
  color: #ff4444;
}

.sidebar {
  position: fixed;
  top: 56px;
  left: 8px;
  width: 220px;
  padding: 16px;
  border-radius: 8px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #00d2ff;
  margin: 16px 0 8px;
}

.sidebar h3:first-child {
  margin-top: 0;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background: #00d2ff;
  color: #0a0a1a;
  font-weight: 600;
}

.btn-primary:hover {
  background: #33ddff;
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  background: rgba(0, 210, 255, 0.1);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.2);
}

.btn-small:hover {
  background: rgba(0, 210, 255, 0.2);
}

.btn-vr {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #00d2ff, #0066ff);
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.btn-vr:hover {
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
  border: 1px solid rgba(255, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 68, 68, 0.4);
}

.btn-tiny {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
}

/* ─── Monitor List ────────────────────────────────────────────────────── */
.monitor-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.monitor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  font-size: 13px;
}

.empty-text {
  color: #555;
  font-size: 12px;
  font-style: italic;
}

.help-text {
  margin-top: 16px;
  font-size: 11px;
  color: #555;
  line-height: 1.6;
}

.help-text strong {
  color: #888;
}

/* ─── Debug Console ───────────────────────────────────────────────────── */
.console-panel {
  position: fixed;
  bottom: 8px;
  left: 8px;
  width: 500px;
  max-width: calc(100vw - 16px);
  border-radius: 8px;
  z-index: 30;
  pointer-events: auto;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(0, 210, 255, 0.1);
}

.console-header h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #00d2ff;
  margin: 0;
}

.console-log {
  height: 200px;
  overflow-y: auto;
  padding: 6px 10px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.console-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 1px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.console-info {
  color: #8a8a9a;
}

.console-warn {
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.05);
}

.console-error {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.08);
}

/* ─── RDP Dialog ──────────────────────────────────────────────────────── */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.dialog {
  background: #1a1a2e;
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dialog h3 {
  color: #00d2ff;
  margin-bottom: 16px;
  font-size: 16px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(0, 210, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.1);
}

.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.dialog-actions .btn {
  flex: 1;
}

/* ─── Notifications ───────────────────────────────────────────────────── */
#notifications {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notification {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 400px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 4.7s;
  pointer-events: auto;
}

.notification.info {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #00d2ff;
}

.notification.warning {
  background: rgba(255, 170, 0, 0.15);
  border: 1px solid rgba(255, 170, 0, 0.3);
  color: #ffaa00;
}

.notification.error {
  background: rgba(255, 68, 68, 0.15);
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #ff4444;
}

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 210, 255, 0.2);
  border-radius: 2px;
}
