/* Mac OS Classic (System 7 / Platinum) Window Manager Skin */
[data-wm-style="macos-classic"].webos-window {
  border-radius: 3px 3px 0 0;
  border: 1px solid #000000;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #777777, 2px 2px 0 rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #cecece;
  color: #000000;
}

[data-wm-style="macos-classic"] > .window-header {
  background: repeating-linear-gradient(180deg, #000000 0px, #000000 1px, #ffffff 1px, #ffffff 2px, #cecece 2px, #cecece 3px);
  padding: 2px 5px;
  height: 20px;
  min-height: 20px;
  border-bottom: 1px solid #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  cursor: default;
}

/* Allow buttons inside .window-traffic-lights to split between Left and Right */
[data-wm-style="macos-classic"] > .window-header > .window-traffic-lights {
  display: contents;
}

/* 1. Go-Away Box (Close button on FAR LEFT) */
[data-wm-style="macos-classic"] > .window-header .win-btn.win-close {
  order: 1;
  width: 12px;
  height: 12px;
  border-radius: 0;
  border: 1px solid #000000;
  background: #cecece;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #888888;
  color: transparent !important;
  font-size: 0 !important;
  padding: 0;
  margin: 0 4px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none !important;
  filter: none !important;
  cursor: default;
}

[data-wm-style="macos-classic"] > .window-header .win-btn.win-close:active {
  background: #000000;
  box-shadow: inset 1px 1px 0 #888888;
}

/* 2. Centered Window Title in Chicago Font with Frame Breaking the Pinstripes */
[data-wm-style="macos-classic"] > .window-header > .window-title-group {
  order: 2;
  margin: 0 auto;
  background: #cecece;
  padding: 0 8px;
  border-left: 1px solid #000000;
  border-right: 1px solid #000000;
  border-radius: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #000000;
  font-family: "Chicago", "Charcoal", "Geneva", -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
}

[data-wm-style="macos-classic"] > .window-header > .window-title-group > .window-title-text {
  color: #000000;
}

/* 3. Window Actions */
[data-wm-style="macos-classic"] > .window-header > .window-header-actions {
  order: 3;
}

/* 4. Zoom Box (Maximize on FAR RIGHT) */
[data-wm-style="macos-classic"] > .window-header .win-btn.win-maximize {
  order: 4;
  width: 12px;
  height: 12px;
  border-radius: 0;
  border: 1px solid #000000;
  background: #cecece;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #888888;
  color: transparent !important;
  font-size: 0 !important;
  padding: 0;
  margin: 0 2px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none !important;
  filter: none !important;
  cursor: default;
}

[data-wm-style="macos-classic"] > .window-header .win-btn.win-maximize::after {
  content: '';
  width: 8px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Crect x='0.5' y='0.5' width='7' height='7' fill='none' stroke='%23000'/%3E%3Crect x='3.5' y='3.5' width='4' height='4' fill='%23000'/%3E%3C/svg%3E") no-repeat center;
}

[data-wm-style="macos-classic"] > .window-header .win-btn.win-maximize:active {
  background: #888888;
}

/* 5. WindowShade Box (Minimize on FAR RIGHT) */
[data-wm-style="macos-classic"] > .window-header .win-btn.win-minimize {
  order: 5;
  width: 12px;
  height: 12px;
  border-radius: 0;
  border: 1px solid #000000;
  background: #cecece;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #888888;
  color: transparent !important;
  font-size: 0 !important;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none !important;
  filter: none !important;
  cursor: default;
}

[data-wm-style="macos-classic"] > .window-header .win-btn.win-minimize::after {
  content: '';
  width: 8px;
  height: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Crect width='8' height='1' fill='%23000'/%3E%3Crect y='2' width='8' height='2' fill='%23888'/%3E%3C/svg%3E") no-repeat center;
}

[data-wm-style="macos-classic"] > .window-header .win-btn.win-minimize:active {
  background: #888888;
}

/* Mac OS Classic Window Body */
[data-wm-style="macos-classic"] > .window-body {
  border: 1px solid #777777;
  background: #ffffff;
  color: #000000;
  margin: 1px;
}

[data-theme="dark-glass"][data-wm-style="macos-classic"] > .window-body,
[data-theme="cyberpunk"][data-wm-style="macos-classic"] > .window-body {
  background: #1e1e24;
  color: #e2e8f0;
}

/* Mac OS Classic Bottom-Right Resize Box (Size Box) */
[data-wm-style="macos-classic"] .win-resize-handle.res-se {
  width: 14px;
  height: 14px;
  bottom: 1px;
  right: 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Crect x='1' y='7' width='6' height='6' fill='none' stroke='%23000'/%3E%3Crect x='7' y='1' width='6' height='12' fill='none' stroke='%23000'/%3E%3C/svg%3E") no-repeat center;
  border: none;
}
