/* Windows 95 / 98 / ME / 2000 (Win9x) Window Manager Skin */
[data-wm-style="win9x"].webos-window {
  border-radius: 0;
  border: none;
  box-shadow: inset 1px 1px 0 #ffffff, inset 2px 2px 0 #dfdfdf, inset -1px -1px 0 #000000, inset -2px -2px 0 #808080, 2px 2px 8px rgba(0, 0, 0, 0.5);
  background: #c0c0c0;
  color: #000000;
}

[data-wm-style="win9x"] > .window-header {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  color: #ffffff;
  padding: 2px 3px 2px 3px;
  height: 20px;
  min-height: 20px;
  display: flex;
  align-items: center;
  user-select: none;
  cursor: default;
}

/* Inactive window title bar: classic gray gradient */
[data-wm-style="win9x"].webos-window:not(.is-active) > .window-header {
  background: linear-gradient(90deg, #808080 0%, #b5b5b5 100%);
  color: #d4d0c8;
}

[data-wm-style="win9x"] > .window-header > .window-title-group {
  order: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-family: "Tahoma", "MS Sans Serif", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  margin-right: auto;
  max-width: calc(100% - 75px);
  cursor: default;
}

[data-wm-style="win9x"] > .window-header > .window-title-group > .window-icon {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-wm-style="win9x"] > .window-header > .window-title-group > .window-title-text {
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-wm-style="win9x"].webos-window:not(.is-active) > .window-header > .window-title-group > .window-title-text {
  color: #d4d0c8;
}

[data-wm-style="win9x"] > .window-header > .window-header-actions {
  order: 2;
  margin-right: 4px;
}

[data-wm-style="win9x"] > .window-header > .window-traffic-lights {
  order: 3;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Classic Win9x 16x14px 3D Beveled Buttons */
[data-wm-style="win9x"] > .window-header .win-btn {
  width: 16px;
  height: 14px;
  border-radius: 0;
  border: none;
  background: #c0c0c0;
  box-shadow: inset 1px 1px 0 #ffffff, inset 2px 2px 0 #dfdfdf, inset -1px -1px 0 #000000, inset -2px -2px 0 #808080;
  color: transparent !important;
  font-size: 0 !important;
  padding: 0;
  margin: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none !important;
  filter: none !important;
  cursor: default;
}

[data-wm-style="win9x"] > .window-header .win-btn:active {
  box-shadow: inset 1px 1px 0 #000000, inset 2px 2px 0 #808080, inset -1px -1px 0 #ffffff !important;
}

/* Order of buttons: Minimize, Maximize, Close */
[data-wm-style="win9x"] > .window-header .win-btn.win-minimize {
  order: 1;
}

[data-wm-style="win9x"] > .window-header .win-btn.win-minimize::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 4px;
  width: 6px;
  height: 2px;
  background: #000000;
}

[data-wm-style="win9x"] > .window-header .win-btn.win-minimize:active::after {
  bottom: 1px;
  left: 5px;
}

[data-wm-style="win9x"] > .window-header .win-btn.win-maximize {
  order: 2;
}

[data-wm-style="win9x"] > .window-header .win-btn.win-maximize::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 3px;
  width: 9px;
  height: 9px;
  border: 1px solid #000000;
  border-top-width: 2px;
  box-sizing: border-box;
}

[data-wm-style="win9x"] > .window-header .win-btn.win-maximize:active::after {
  top: 3px;
  left: 4px;
}

/* Restore Icon when window is maximized */
[data-wm-style="win9x"].is-maximized > .window-header .win-btn.win-maximize::after {
  width: 9px;
  height: 9px;
  border: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9'%3E%3Cpath fill='%23000' d='M2 0h7v6H7V2H2V0zm5 3H0v6h7V3zM1 4h5v4H1V4z'/%3E%3C/svg%3E") no-repeat center;
}

/* Close Button with 2px extra separation */
[data-wm-style="win9x"] > .window-header .win-btn.win-close {
  order: 3;
  margin-left: 2px;
}

[data-wm-style="win9x"] > .window-header .win-btn.win-close::after {
  content: '';
  width: 8px;
  height: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7' viewBox='0 0 8 7'%3E%3Cpath fill='%23000' d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1h1v1h1v1H8v2H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0V0z'/%3E%3C/svg%3E") no-repeat center;
}

[data-wm-style="win9x"] > .window-header .win-btn.win-close:active::after {
  transform: translate(1px, 1px);
}

/* Win9x Window Body with Inset Bevel */
[data-wm-style="win9x"] > .window-body {
  border: 2px inset #ffffff;
  background: #ffffff;
  color: #000000;
  margin: 3px;
}

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