/* Window chrome. */

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-window);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-window-idle);
  overflow: hidden;
  transition: box-shadow 0.22s ease;
  will-change: transform;
}

.window.is-focused {
  box-shadow: var(--shadow-window);
}

.window-titlebar {
  position: relative;
  flex: none;
  height: 38px;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  box-shadow: 0 0.5px 0 var(--hairline);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.window.is-compact .window-titlebar {
  height: 32px;
  background: transparent;
  box-shadow: none;
}

/* Dark-native apps keep dark chrome in both themes. */
.window.is-dark-app {
  --surface: #1c1c1e;
  --surface-2: #242426;
  --surface-3: #2e2e30;
  --ink: #f5f5f7;
  --ink-2: #98989d;
  --hairline: rgba(255, 255, 255, 0.14);
  --hairline-strong: rgba(255, 255, 255, 0.22);
  --accent: #0a84ff;
  --accent-selection: rgba(10, 132, 255, 0.24);
  --up: #30d158;
  --down: #ff453a;
  --sidebar-bg: rgba(36, 36, 38, 0.82);
}

.window-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.85;
  letter-spacing: 0.01em;
  pointer-events: none;
  white-space: nowrap;
}

.window:not(.is-focused) .window-title { opacity: 0.4; }

/* Traffic lights */

.traffic-lights {
  display: flex;
  gap: 8px;
  padding: 0 12px;
  align-items: center;
}

.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
  cursor: default;
  padding: 0;
}

.tl svg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.traffic-lights:hover .tl svg { opacity: 1; }

.tl-close { background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2); }
.tl-min   { background: #febc2e; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2); }
.tl-zoom  { background: #28c840; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2); }

.tl-close:active { background: #e0443e; }
.tl-min:active   { background: #dea123; }
.tl-zoom:active  { background: #1fa62f; }

.window:not(.is-focused) .tl {
  background: var(--tl-idle);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}

.tl:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.window-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
