/* Windows 3.11 (Classic Workgroups) Window Manager Skin */
[data-wm-style="win311"].webos-window {
  border-radius: 0;
  border: 1px solid #000000;
  box-shadow: inset 0 0 0 1px #ffffff, inset 0 0 0 4px #c0c0c0, inset 0 0 0 5px #000000, 3px 3px 0 rgba(0, 0, 0, 0.6);
  background: #c0c0c0;
  color: #000000;
}

[data-wm-style="win311"] > .window-header {
  background: #000080;
  color: #ffffff;
  padding: 1px 2px;
  height: 20px;
  min-height: 20px;
  border-bottom: 1px solid #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  cursor: default;
}

[data-wm-style="win311"].webos-window:not(.is-active) > .window-header {
  background: #808080;
  color: #c0c0c0;
}

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

/* 1. Control-Menu Box (Signature Windows 3.1 Dash on the FAR LEFT) */
[data-wm-style="win311"] > .window-header .win-btn.win-close {
  order: 1;
  width: 18px;
  height: 18px;
  border-radius: 0;
  border: 1px solid #000000;
  background: #c0c0c0;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
  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="win311"] > .window-header .win-btn.win-close::after {
  content: '';
  width: 12px;
  height: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='4' viewBox='0 0 12 4'%3E%3Crect width='12' height='2' fill='%23ffffff'/%3E%3Crect y='2' width='12' height='2' fill='%23000000'/%3E%3Crect x='1' y='1' width='10' height='2' fill='%23c0c0c0'/%3E%3C/svg%3E") no-repeat center;
}

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

/* 2. Centered Windows 3.11 Title */
[data-wm-style="win311"] > .window-header > .window-title-group {
  order: 2;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-family: "MS Sans Serif", "System", "Fixedsys", monospace, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  cursor: default;
}

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

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

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

/* 4. Minimize Arrow ▼ (on the FAR RIGHT) */
[data-wm-style="win311"] > .window-header .win-btn.win-minimize {
  order: 4;
  width: 18px;
  height: 18px;
  border-radius: 0;
  border: 1px solid #000000;
  background: #c0c0c0;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
  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="win311"] > .window-header .win-btn.win-minimize::after {
  content: '';
  width: 8px;
  height: 5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpolygon points='0,0 8,0 4,4' fill='%23000'/%3E%3C/svg%3E") no-repeat center;
}

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

/* 5. Maximize Arrow ▲ (on the FAR RIGHT) */
[data-wm-style="win311"] > .window-header .win-btn.win-maximize {
  order: 5;
  width: 18px;
  height: 18px;
  border-radius: 0;
  border: 1px solid #000000;
  background: #c0c0c0;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
  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="win311"] > .window-header .win-btn.win-maximize::after {
  content: '';
  width: 8px;
  height: 5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpolygon points='4,0 0,4 8,4' fill='%23000'/%3E%3C/svg%3E") no-repeat center;
}

/* Restore double arrow ▲▼ when maximized */
[data-wm-style="win311"].is-maximized > .window-header .win-btn.win-maximize::after {
  width: 8px;
  height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='9' viewBox='0 0 8 9'%3E%3Cpolygon points='4,0 0,4 8,4' fill='%23000'/%3E%3Cpolygon points='0,5 8,5 4,9' fill='%23000'/%3E%3C/svg%3E") no-repeat center;
}

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

/* Win311 Window Body */
[data-wm-style="win311"] > .window-body {
  border: 1px solid #000000;
  background: #ffffff;
  color: #000000;
  margin: 4px;
}

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