/* Host-level virtual machine controls */
.vm-toolbar {
  position: fixed;
  z-index: 5000;
  top: 0;
  left: 50%;
  width: 174px;
  height: 35px;
  border-radius: 0 0 14px 14px;
  color: #f8fafc;
  background: #07090d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 12px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.vm-toolbar-trigger {
  width: 100%;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 0 0 14px 14px;
  padding: 0 12px 2px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease;
}

.vm-toolbar-trigger:hover,
.vm-toolbar.expanded .vm-toolbar-trigger {
  background: #171b23;
}

.vm-toolbar-trigger:active {
  background: #242b36;
}

.vm-toolbar-trigger:focus-visible,
.vm-system-option:focus-visible {
  outline: 2px solid #7bb6ff;
  outline-offset: 2px;
}

.vm-monitor {
  position: relative;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border: 1px solid #233348;
  border-radius: 50%;
  background: #111a28;
  box-shadow: 0 0 0 2px #0b0e14;
}

.vm-monitor::before {
  content: none;
}

.vm-chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.66;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.vm-toolbar.expanded .vm-chevron {
  transform: translateY(2px) rotate(225deg);
}

.vm-system-options {
  position: absolute;
  top: 42px;
  left: 50%;
  width: 242px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 8px;
  background: #1c2027;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
  animation: vm-options-in 140ms ease-out;
}

@keyframes vm-options-in {
  from {
    opacity: 0;
    transform: translate(-50%, -5px) scale(0.98);
  }
}

.vm-options-label {
  padding: 3px 8px 5px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vm-system-option {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  padding: 5px 8px;
  color: #f8fafc;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.vm-system-option:hover,
.vm-system-option.active {
  background: rgba(255, 255, 255, 0.1);
}

.vm-system-option.active {
  box-shadow: inset 2px 0 #65a8ff;
}

.vm-system-option strong,
.vm-system-option small {
  display: block;
}

.vm-system-option strong {
  font-size: 12px;
}

.vm-system-option small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
}

.vm-os-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  overflow: hidden;
}

.vm-os-macos {
  color: #111827;
  background: linear-gradient(145deg, #f8fafc 0 48%, #72b7f8 49%);
}

.vm-os-windows {
  grid-template-columns: repeat(2, 7px);
  gap: 2px;
  background: #eef7ff;
}

.vm-os-windows i {
  width: 7px;
  height: 7px;
  background: #1687dc;
}

.vm-os-ubuntu {
  color: #fff;
  background: #e95420;
  box-shadow: inset 0 0 0 7px #e95420;
}

.vm-os-ubuntu::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px dotted currentColor;
  border-radius: 50%;
}

body.os-switching .mac-screen {
  animation: os-shell-in 400ms ease;
}

@keyframes os-shell-in {
  0% { opacity: 0.45; filter: blur(5px); }
  100% { opacity: 1; filter: blur(0); }
}


@media (max-width: 780px) {
  .vm-toolbar {
    width: 150px;
    height: 32px;
    border-radius: 0 0 12px 12px;
  }

  .vm-toolbar-trigger {
    height: 32px;
    border-radius: 0 0 12px 12px;
  }

  .vm-system-options {
    width: min(242px, calc(100vw - 18px));
    top: 39px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.os-switching .mac-screen,
  .vm-system-options {
    animation: none;
  }

  .vm-toolbar-trigger,
  .vm-chevron {
    transition: none;
  }
}
