/* ============================================================
   Windows 7 Simulator (v86) - Aero-inspired UI
   ============================================================ */

:root {
  --aero-1: #0c3a63;
  --aero-2: #1b6fa8;
  --aero-3: #2f9fd6;
  --glass: rgba(233, 244, 255, 0.82);
  --glass-line: rgba(255, 255, 255, 0.6);
  --win-bg: #eef4fb;
  --ink: #0e2438;
  --ink-soft: #4a6076;
  --line: #c3d4e6;
  --accent: #2f7fd0;
  --accent-dark: #1b5fa0;
  --danger: #c0392b;
  --font-ui: "Segoe UI", Tahoma, Geneva, Verdana, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  overflow: hidden;
  background: #04121f;
}

.desktop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 22px 62px;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(47, 159, 214, 0.55), transparent 60%),
    radial-gradient(1000px 700px at 90% 90%, rgba(20, 90, 150, 0.7), transparent 60%),
    linear-gradient(160deg, #06243c 0%, #0a3355 45%, #041a2c 100%);
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.glow-a {
  width: 520px;
  height: 520px;
  top: -160px;
  right: -120px;
  background: rgba(90, 190, 245, 0.35);
}

.glow-b {
  width: 460px;
  height: 460px;
  bottom: -160px;
  left: -120px;
  background: rgba(30, 120, 190, 0.4);
}

/* ---------- Window chrome ---------- */

.window {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  height: min(760px, calc(100vh - 96px));
  background: var(--win-bg);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(0, 25, 45, 0.55),
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 6px 0 12px;
  color: #f4fbff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.02) 45%, rgba(0, 0, 0, 0.12)),
    linear-gradient(180deg, var(--aero-3), var(--aero-1));
  border-bottom: 1px solid rgba(0, 30, 60, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.tb-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #bfe6ff;
}

.tb-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-controls {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.winbtn {
  position: relative;
  width: 34px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05));
  opacity: 0.85;
}

.winbtn.min::before {
  content: "";
  position: absolute;
  left: 32%;
  right: 32%;
  bottom: 7px;
  height: 2px;
  background: #eaf6ff;
}

.winbtn.max::before {
  content: "";
  position: absolute;
  inset: 6px 31% 6px 31%;
  border: 1.5px solid #eaf6ff;
}

.winbtn.close {
  background: linear-gradient(180deg, #ff7a6b, #b8271a);
}

.winbtn.close::before,
.winbtn.close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 27%;
  right: 27%;
  height: 1.8px;
  background: #fff;
}

.winbtn.close::before { transform: rotate(45deg); }
.winbtn.close::after { transform: rotate(-45deg); }

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f7fbff, #e4eefa);
  border-bottom: 1px solid var(--line);
}

.toolbar-spacer {
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(47, 127, 208, 0.09);
  border: 1px solid rgba(47, 127, 208, 0.25);
  border-radius: 999px;
}

.badge.status {
  color: var(--accent-dark);
}

.badge.status.busy {
  color: #8a5a00;
  background: rgba(230, 175, 60, 0.16);
  border-color: rgba(230, 175, 60, 0.45);
}

.badge.status.live {
  color: #1c6b3f;
  background: rgba(70, 190, 120, 0.16);
  border-color: rgba(70, 190, 120, 0.45);
}

.tb-btn {
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #e3edf8);
  border: 1px solid #b7cbe0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.tb-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff, #d5e6f7);
  border-color: var(--accent);
}

.tb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tb-btn.ghost {
  color: var(--accent-dark);
  background: rgba(47, 127, 208, 0.08);
  border-color: rgba(47, 127, 208, 0.35);
}

/* ---------- Screen ---------- */

.screen-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.screen > div {
  color: #d7d7d7;
  margin: 0;
  padding: 0;
}

.screen > canvas {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  outline: none;
}

.screen-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #cfe6ff;
  background: #04101c;
}

.screen-loading p {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(120, 190, 240, 0.25);
  border-top-color: var(--aero-3);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Boot overlay ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background:
    radial-gradient(700px 400px at 50% 0%, rgba(47, 159, 214, 0.25), transparent 70%),
    linear-gradient(160deg, #07223a, #04162a);
}

.panel {
  width: min(620px, 100%);
  padding: 26px 28px 24px;
  background: rgba(9, 32, 54, 0.72);
  border: 1px solid rgba(120, 190, 240, 0.35);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #dcecfb;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.panel h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.panel .sub {
  margin: 0 0 18px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #a9c6e0;
}

.panel strong {
  color: #cfe9ff;
}

.field {
  display: block;
  margin-bottom: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b8d2ea;
}

.field > span {
  display: block;
  margin-bottom: 5px;
}

.field code {
  padding: 1px 5px;
  font-size: 0.75rem;
  color: #bfe1ff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.field input[type="url"],
.field input[type="file"],
.field select {
  display: block;
  width: 100%;
  padding: 9px 11px;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  color: #f2f9ff;
  background: rgba(4, 18, 32, 0.8);
  border: 1px solid rgba(120, 190, 240, 0.35);
  border-radius: 6px;
  outline: none;
}

.field input[type="url"]:focus,
.field select:focus {
  border-color: var(--aero-3);
  box-shadow: 0 0 0 2px rgba(47, 159, 214, 0.25);
}

.field input[type="file"] {
  padding: 7px;
  font-size: 0.78rem;
}

.field input::placeholder {
  color: #6f8ba5;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
  color: #7d9ab5;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(120, 190, 240, 0.25);
}

.error {
  margin: 0 0 12px;
  padding: 9px 12px;
  font-size: 0.8rem;
  color: #ffd5d0;
  background: rgba(204, 60, 44, 0.22);
  border: 1px solid rgba(255, 120, 100, 0.55);
  border-radius: 6px;
}

.big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 6px 0 16px;
  padding: 12px 18px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #3a9fe0, #1b6aa8);
  border: 1px solid #84c4ee;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(20, 90, 150, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: filter 0.15s, transform 0.15s;
}

.big-btn:hover {
  filter: brightness(1.08);
}

.big-btn:active {
  transform: translateY(1px);
}

.big-btn-icon {
  font-size: 0.8rem;
}

.hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: #8aa8c2;
}

.state-block {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(120, 190, 240, 0.25);
  border-radius: 6px;
  background: rgba(4, 18, 32, 0.35);
}

.state-block > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: #bfe1ff;
}

.state-block > summary::-webkit-details-marker {
  display: none;
}

.state-block > summary::before {
  content: "\25B8 ";
}

.state-block[open] > summary::before {
  content: "\25BE ";
}

.state-block[open] > summary {
  margin-bottom: 10px;
}

.state-note {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #8aa8c2;
}

.state-block .field:last-child {
  margin-bottom: 0;
}

/* ---------- Taskbar ---------- */

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 10px;
  color: #eaf6ff;
  background:
    linear-gradient(180deg, rgba(70, 150, 210, 0.55), rgba(6, 40, 70, 0.85)),
    rgba(6, 34, 58, 0.8);
  border-top: 1px solid rgba(160, 215, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}

.start-orb {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background:
    radial-gradient(circle at 35% 30%, #bff0ff, #3aa7dd 45%, #14618f 80%);
  box-shadow: 0 0 12px rgba(90, 190, 245, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.start-orb:hover {
  filter: brightness(1.1);
}

.task-items {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.task-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  padding: 6px 12px;
  font-size: 0.76rem;
  color: #eaf6ff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-item.active {
  background: rgba(120, 190, 240, 0.32);
  border-color: rgba(190, 230, 255, 0.6);
}

.task-item .tb-icon {
  width: 16px;
  height: 16px;
  color: #cdeaff;
}

.tray {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
}

.tray-icon {
  font-size: 0.85rem;
  opacity: 0.8;
}

.clock {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .desktop {
    padding: 10px 10px 58px;
  }

  .window {
    height: calc(100vh - 78px);
    border-radius: 6px;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px 18px;
  }

  .panel h1 {
    font-size: 1.25rem;
  }

  .task-item span:last-child {
    display: none;
  }

  #cadBtn {
    display: none;
  }
}
