/* =========================================================
  03 WINDOW SHELL
  Shared material and positioning for every fake window.
========================================================= */
.window {
  position: absolute;
  left: 365px;
  top: 168px;
  width: 560px;
  height: 360px;
  min-width: 360px;
  min-height: 220px;

  color: var(--text-main);
  /* unified glass material: apply the same translucency and shadow to all windows */
  background: var(--glass-window-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--window-radius);
  overflow: hidden;

  /* apply consistent shadow and blur across all windows */
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.window.focused {
  box-shadow:
    0 18px 38px rgba(0,0,0,0.28),
    0 2px 8px rgba(0,0,0,0.22);
}

/* Only lift a window above the Dock when the Dock would physically cover its
   traffic-light controls. The Dock keeps its normal layer everywhere else. */
.window.traffic-over-dock {
  z-index: 9001 !important;
}

.window.maximized {
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  box-shadow: none !important;
}

/* Fullscreen chrome stays off-screen until the pointer reaches the top edge. */
.window.maximized .traffic-lights {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-58px);
  transition:
    transform 240ms cubic-bezier(.22, .78, .22, 1),
    opacity 150ms ease;
}

body.menubar-revealed .window.maximized .traffic-lights {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Fullscreen uses the same 44px chrome geometry as a normal window.  The
   cluster therefore keeps its normal 14px inset below the 27px menu bar. */
body.menubar-revealed .window.maximized > .traffic-lights,
body.menubar-revealed .window.maximized > .titlebar > .traffic-lights {
  position: absolute !important;
  top: calc(var(--menubar-h) + 14px) !important;
  left: 15px !important;
  z-index: 30 !important;
}

/* Stored geometry is applied before an opening window is painted. */
.window.restoring-window-state,
.window.restoring-window-state * {
  transition: none !important;
  animation: none !important;
}

.window.hidden { display: none !important; }

/* Sonoma "Show Desktop": the actual window geometry stays untouched so the
   same positions can be restored after the temporary edge animation. */
.window.desktop-shelved {
  transition: transform 420ms cubic-bezier(.22,.78,.22,1), opacity 240ms ease !important;
  will-change: transform;
}
body.show-desktop .window.desktop-shelved {
  transform: translate3d(var(--show-desktop-shift-x, 0px), 0, 0) !important;
}
#desktop::after {
  content:'';
  position:absolute;
  top:var(--menubar-h);
  right:0;
  bottom:0;
  left:0;
  z-index:8998;
  pointer-events:none;
  opacity:0;
  box-shadow:
    inset 0 0 0 16px rgba(118,117,122,.78),
    inset 0 0 18px 18px rgba(0,0,0,.18);
  transition:opacity 190ms ease;
}
body.show-desktop #desktop::after { opacity:1; }

.window-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px;
  /* transparent so the parent window's glass material shows through */
  background: transparent;
  /* no additional blur here; rely on the parent window */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.restore-btn { display: none; }

.system-window .window-content {
  padding: 0;
  display: grid;
  grid-template-columns: 185px 1fr;
  background: transparent;
}

.system-sidebar {
  padding: 18px 14px;
  background: rgba(0,0,0,.14);
  border-right: 1px solid var(--glass-border-soft);
}

.system-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.system-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f7, #565554);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.system-user strong { display: block; font-size: 13px; }
.system-user span { display: block; color: var(--text-soft); font-size: 11px; margin-top: 1px; }

.system-nav-item {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  border-radius: 7px;
  padding: 0 8px;
  margin-bottom: 4px;
}

.system-nav-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--accent);
  display: inline-block;
}

.system-pane {
  padding: 18px 18px 22px;
}

.system-pane h2 {
  font-size: 16px;
  line-height: 1;
  margin-bottom: 16px;
}

.settings-card {
  border: 1px solid var(--glass-border-soft);
  border-radius: 6px;
  padding: 0 15px;
  background: rgba(255,255,255,.035);
}

.settings-row {
  height: 36px;
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
  font-size: 13px;
}

.settings-row:last-child { border-bottom: 0; }

.fake-slider {
  position: relative;
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,.11);
}

.fake-slider::before {
  content: "";
  position: absolute;
  left: var(--slider, 42%);
  top: 50%;
  width: 5px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255,255,255,.9);
  transform: translate(-50%, -50%);
}

.spotlight {
  position: absolute;
  left: 50%;
  top: 350px;
  width: 540px;
  transform: translateX(-50%);
  z-index: 9999;
  border-radius: 13px;
  overflow: hidden;
  background: rgba(236,236,238,.88);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 22px 60px rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  backdrop-filter: blur(30px) saturate(140%);
}

.spotlight.hidden { display: none; }

.spotlight-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
}

.spotlight-search img { width: 22px; height: 22px; opacity: .65; }
#spotlight-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 24px;
  color: rgba(0,0,0,.72);
}

.spotlight-results { color: rgba(0,0,0,.72); }
.spotlight-result {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  font-size: 14px;
}
.spotlight-result.active { background: rgba(59,130,247,.25); }
.spotlight-result-icon {
  width: 18px;
  height: 14px;
  border-radius: 3px;
  background: #38bdf8;
}

/* === Touchups 2026-06: fixed window sizes where requested === */
.window.no-resize .resize-handle { display: none !important; }
.system-window .window-content {
  height: calc(100% - var(--titlebar-h));
  overflow: hidden;
  grid-template-columns: 185px 1fr;
}
.system-sidebar {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 16px;
}
.system-pane {
  height: 100%;
  overflow: hidden;
  padding: 18px 18px 22px;
}
.system-nav-title {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  margin-bottom: 8px;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.system-nav-item { height: 28px; }
.system-nav-icon { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.app-touchdesigner { background: #18a058; }
.app-logic { background: #303030; }
.app-figma { background: #f24e1e; }
.app-adobe { background: #e3262e; }
.app-vscode { background: #2488d8; }
.app-python { background: #3776ab; }
.app-github { background: #111; }
.app-blender { background: #f5792a; }
.app-unity { background: #222; }
.app-html { background: var(--accent); }


/* === Touchups 2026-06-30: restore macOS-like settings identity header === */
.system-window .window-content {
  grid-template-columns: 185px 1fr;
  overflow: hidden !important;
}
.system-sidebar {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 16px 12px 18px !important;
}
.system-user {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0 0 14px;
  padding: 0 7px;
}
.system-avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 25%, rgba(255,255,255,.60), transparent 32%),
    linear-gradient(135deg, #3b82f7, #6b6b6b 62%, #303030);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), 0 1px 3px rgba(0,0,0,.25);
}
.system-user strong { display:block; font-size:13px; line-height:15px; color:rgba(255,255,255,.92); }
.system-user span { display:block; margin-top:1px; font-size:11px; line-height:13px; color:rgba(255,255,255,.52); }
.system-nav-title { margin-top: 2px; }
.system-pane { overflow: hidden !important; }
