* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ─── Aurora Background ─────────────────────────────────────────────────── */
.aurora-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background-color: #f8fafc;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.55;
  border-radius: 50%;
  animation: float-blob 18s infinite alternate ease-in-out;
}

.blob-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(14, 165, 233, 0.08) 70%);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.3) 0%, rgba(99, 102, 241, 0.08) 70%);
  bottom: -150px;
  right: -100px;
  animation-duration: 22s;
}

.blob-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.22) 0%, rgba(245, 158, 11, 0.04) 70%);
  top: 40%;
  left: 30%;
  animation-duration: 15s;
}

@keyframes float-blob {
  0% { transform: translate(0px, 0px) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.1); }
  100% { transform: translate(-40px, 50px) scale(0.95); }
}

/* ─── Canvas Particle Lơ lửng ───────────────────────────────────────────── */
#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* ─── Hiệu ứng Glow chạy theo con trỏ chuột ─────────────────────────────── */
#cursor-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.16) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: width 0.3s, height 0.3s;
}

/* ─── Floating Dynamic Island ───────────────────────────────────────────── */
#dynamic-island {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.6);
  border-radius: 9999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 95vw;
}

#dynamic-island:hover {
  box-shadow: 0 16px 36px -4px rgba(14, 165, 233, 0.16), 0 0 0 1px rgba(56, 189, 248, 0.4);
}

/* ─── Floating Glass Dock (Left Flank on Desktop, Bottom on Mobile) ─────── */
#floating-dock {
  position: fixed;
  z-index: 45;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.7);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#floating-dock:hover {
  box-shadow: 0 20px 48px -6px rgba(14, 165, 233, 0.2), 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.dock-item {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s, color 0.2s;
}

.dock-item:hover {
  color: #0284c7;
  background: white;
  border-color: #bae6fd;
  box-shadow: 0 12px 20px -4px rgba(2, 132, 199, 0.25);
  z-index: 10;
}

.dock-item-live::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Tooltip trên dock */
.dock-item .dock-tooltip {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.9);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Desktop: Vertical Left Dock */
@media (min-width: 1024px) {
  #floating-dock {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 26px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  #dock-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .dock-divider {
    width: 22px;
    height: 1px;
    background: rgba(226, 232, 240, 0.85);
    margin: 4px 0;
  }
  .dock-item:hover {
    transform: translateX(6px) scale(1.18);
  }
  .dock-item-live::after {
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
  }
  .dock-item .dock-tooltip {
    top: 50%;
    left: 54px;
    transform: translateY(-50%) scale(0.9);
  }
  .dock-item:hover .dock-tooltip {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* Mobile & Tablet: Horizontal Bottom Dock */
@media (max-width: 1023px) {
  #floating-dock {
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 24px;
    padding: 6px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #floating-dock::-webkit-scrollbar {
    display: none;
  }
  #dock-items {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-shrink: 0;
  }
  .dock-item {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    flex-shrink: 0;
  }
  .dock-divider {
    width: 1px;
    height: 20px;
    background: rgba(226, 232, 240, 0.85);
    margin: 0 2px;
    flex-shrink: 0;
  }
  .dock-item:hover {
    transform: translateY(-3px) scale(1.1);
  }
  .dock-item-live::after {
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
  }
  .dock-item .dock-tooltip {
    top: -34px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
  }
  .dock-item:hover .dock-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

/* ─── Border Beam Animation Cho Thẻ Trực Tuyến ───────────────────────────── */
.has-border-beam {
  position: relative;
}

.has-border-beam::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  padding: 1.5px;
  background: conic-gradient(from var(--beam-angle, 0deg), transparent 75%, #38bdf8 88%, #818cf8 94%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: rotate-beam 6s linear infinite;
}

@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-beam {
  to {
    --beam-angle: 360deg;
  }
}

/* ─── Filter Tags ───────────────────────────────────────────────────────── */
.os-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 10px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  border: none;
}

.os-tag:hover {
  color: #0f172a;
}

.os-tag.active {
  background: white;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ─── Frosted Glass Cards (3D Tilt Ready) ────────────────────────────────── */
.os-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 6px 20px -4px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.6);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

.os-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.os-card:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: #bae6fd;
  box-shadow: 0 24px 40px -10px rgba(14, 165, 233, 0.18), 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.os-card:hover::before {
  opacity: 1;
}

/* ─── Language Switcher Pill ────────────────────────────────────────────── */
.lang-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  border-radius: 9999px;
  transition: all 0.2s ease;
  color: #64748b;
  cursor: pointer;
  border: none;
  background: transparent;
}

.lang-btn:hover {
  color: #0f172a;
}

.lang-btn.active {
  background: white;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ─── Desktop Launchpad (Fit 100vh - Zero Scroll) ───────────────────────── */
@media (min-width: 1024px) {
  body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
  #workspace-viewport {
    overflow: hidden;
  }
  .desktop-fit-cards {
    gap: 16px !important;
  }
  .desktop-fit-cards .os-card {
    padding: 16px 20px !important;
  }
  #orbit-container {
    height: calc(100vh - 100px);
    min-height: 580px;
  }
}

/* ─── Orbit Galaxy View (Expanded & Cinematic) ─────────────────────────── */
#orbit-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 175px);
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 36px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0%, rgba(240, 249, 255, 0.65) 45%, rgba(248, 250, 252, 0.2) 90%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 25px 60px -15px rgba(14, 165, 233, 0.08), inset 0 0 100px rgba(14, 165, 233, 0.05);
}

@media (max-width: 640px) {
  #orbit-container {
    height: calc(100vh - 150px);
    min-height: 440px;
    border-radius: 24px;
  }
  .hud-window {
    border-radius: 24px;
  }
}

#orbit-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.orbit-center-node {
  position: absolute;
  z-index: 20;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.orbit-center-node:hover {
  transform: translate(-50%, -50%) scale(1.12) !important;
}

.orbit-satellite {
  position: absolute;
  z-index: 25;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.orbit-satellite:hover {
  transform: translate(-50%, -50%) scale(1.18) !important;
  z-index: 35;
}

/* ─── Holographic Spatial Inspection HUD ────────────────────────────────── */
#spatial-hud-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#spatial-hud-modal.active {
  display: flex;
}

.hud-window {
  width: 100%;
  max-width: 660px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(56, 189, 248, 0.35);
  overflow: hidden;
  animation: hud-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes hud-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.hud-pipeline-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.hud-pipeline-flow {
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  position: relative;
  overflow: hidden;
  border-radius: 9999px;
}

.hud-pipeline-flow::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  background: white;
  animation: flow-beam 1.4s infinite linear;
}

@keyframes flow-beam {
  from { left: -40%; }
  to { left: 100%; }
}

/* Thanh cuộn mềm */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}