/* ============================================================
   win95.css -- minimal, from-scratch Windows 95 UI toolkit
   built with the classic "box-shadow bevel" technique.
   ============================================================ */

:root {
  --w95-face: #c0c0c0;
  --w95-face-dark: #808080;
  --w95-face-darker: #0a0a0a;
  --w95-face-light: #dfdfdf;
  --w95-face-lighter: #ffffff;
  --w95-desktop: #008080;
  --w95-titlebar-active-1: #000080;
  --w95-titlebar-active-2: #1084d0;
  --w95-titlebar-inactive-1: #808080;
  --w95-titlebar-inactive-2: #b5b5b5;
  --w95-selection: #000080;
  --w95-selection-text: #ffffff;
  --w95-font: "Tahoma", "Segoe UI", "MS Sans Serif", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: var(--w95-font);
  font-size: 13px;
  color: #000;
  -webkit-font-smoothing: none;
}

::selection {
  background: var(--w95-selection);
  color: var(--w95-selection-text);
}

/* raised bevel (buttons, windows, taskbar) */
.w95-raised {
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-darker),
    inset 1px 1px 0 0 var(--w95-face-lighter),
    inset -2px -2px 0 0 var(--w95-face-dark),
    inset 2px 2px 0 0 var(--w95-face-light);
}

/* sunken bevel (textboxes, listboxes, statusbar cells) */
.w95-sunken {
  background: #fff;
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

/* ---------------- Desktop & Taskbar ---------------- */

#desktop {
  position: fixed;
  inset: 0;
  background: var(--w95-desktop);
  overflow: hidden;
  user-select: none;
}

.desktop-icon {
  position: absolute;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  cursor: pointer;
  color: #fff;
  text-align: center;
  text-shadow: 1px 1px 1px #000;
}

.desktop-icon:focus,
.desktop-icon.selected {
  background: rgba(0, 0, 128, 0.4);
  outline: 1px dotted #fff;
}

.desktop-icon .icon-glyph {
  width: 32px;
  height: 32px;
}

.desktop-icon span {
  font-size: 12px;
  line-height: 1.2;
}

#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  z-index: 10000;
  display: flex;
  align-items: center;
  padding: 3px 3px;
  gap: 4px;
  background: var(--w95-face);
  box-shadow: inset 0 1px 0 0 var(--w95-face-lighter);
}

#start-button {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
}

#start-button.active {
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

#start-button .start-logo {
  width: 16px;
  height: 16px;
  flex: none;
}

#taskbar-sep {
  width: 2px;
  align-self: stretch;
  margin: 0 2px;
  box-shadow: inset -1px 0 0 0 var(--w95-face-lighter), inset 1px 0 0 0 var(--w95-face-dark);
}

#taskbar-windows {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow: hidden;
  height: 100%;
  align-items: center;
}

.taskbar-button {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.taskbar-button.active {
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

#taskbar-clock {
  height: 24px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 12px;
  min-width: 56px;
  justify-content: center;
}

/* ---------------- Start Menu ---------------- */

#start-menu {
  position: fixed;
  left: 3px;
  bottom: 35px;
  width: 200px;
  z-index: 10001;
  padding: 3px;
  display: none;
  flex-direction: row;
}

#start-menu.open {
  display: flex;
}

.start-menu-banner {
  width: 24px;
  background: linear-gradient(180deg, var(--w95-titlebar-active-1), var(--w95-titlebar-active-2));
  color: #fff;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: bold;
  font-size: 16px;
  display: flex;
  align-items: flex-end;
  padding: 8px 4px;
  letter-spacing: 1px;
}

.start-menu-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2px;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}

.start-menu-item:hover {
  background: var(--w95-selection);
  color: var(--w95-selection-text);
}

.start-menu-sep {
  height: 1px;
  margin: 3px 2px;
  box-shadow: inset 0 -1px 0 0 var(--w95-face-lighter), inset 0 1px 0 0 var(--w95-face-dark);
}

/* ---------------- Windows ---------------- */

.window {
  position: absolute;
  min-width: 260px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.window.focused {
  z-index: 500;
}

.title-bar {
  height: 20px;
  display: flex;
  align-items: center;
  padding: 2px 3px;
  gap: 6px;
  color: #fff;
  background: linear-gradient(90deg, var(--w95-titlebar-inactive-1), var(--w95-titlebar-inactive-2));
  cursor: default;
}

.window.focused .title-bar {
  background: linear-gradient(90deg, var(--w95-titlebar-active-1), var(--w95-titlebar-active-2));
}

.title-bar-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.title-bar-text {
  flex: 1;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-bar-controls {
  display: flex;
  gap: 2px;
}

.title-bar-controls button {
  width: 16px;
  height: 14px;
  padding: 0;
  font-size: 10px;
  line-height: 1;
  font-family: "Marlett", var(--w95-font);
  font-weight: bold;
  cursor: pointer;
}

.window-body {
  flex: 1;
  background: var(--w95-face);
  padding: 8px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.status-bar {
  display: flex;
  gap: 2px;
  padding: 2px 3px 0;
}

.status-bar-field {
  flex: 1;
  font-size: 11px;
  padding: 2px 6px;
}

/* ---------------- Form controls ---------------- */

button.w95-btn {
  font-family: var(--w95-font);
  font-size: 13px;
  min-width: 75px;
  padding: 4px 12px;
  cursor: pointer;
  color: #000;
}

button.w95-btn:active,
button.w95-btn.pressed {
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
  padding: 5px 11px 3px 13px;
}

button.w95-btn:focus {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

button:disabled {
  color: #808080;
  text-shadow: 1px 1px 0 var(--w95-face-lighter);
  cursor: default;
}

input[type="text"].w95-input,
input[type="password"].w95-input {
  font-family: var(--w95-font);
  font-size: 13px;
  padding: 4px 6px;
  border: none;
  background: #fff;
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

input[type="text"].w95-input:focus,
input[type="password"].w95-input:focus {
  outline: 1px solid #000;
  outline-offset: -2px;
}

.w95-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.w95-field-row label {
  width: 92px;
  flex: none;
  text-align: right;
}

.w95-field-row input {
  flex: 1;
}

.w95-tabs {
  display: flex;
}

.w95-tab {
  padding: 4px 14px;
  cursor: pointer;
  font-size: 12px;
  position: relative;
  top: 1px;
}

.w95-tab.active {
  background: var(--w95-face);
  box-shadow: inset -1px 0 0 0 var(--w95-face-dark), inset 1px 0 0 0 var(--w95-face-lighter),
    inset 0 1px 0 0 var(--w95-face-lighter);
  font-weight: bold;
}

.w95-listbox {
  overflow-y: auto;
}

.w95-list-item {
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.w95-list-item.selected {
  background: var(--w95-selection);
  color: var(--w95-selection-text);
}

.w95-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 4px;
  font-size: 12px;
  color: #800000;
}

/* scrollbars, Win95-flavoured */
.w95-sunken::-webkit-scrollbar,
.window-body::-webkit-scrollbar {
  width: 16px;
}
.w95-sunken::-webkit-scrollbar-track,
.window-body::-webkit-scrollbar-track {
  background: var(--w95-face);
}
.w95-sunken::-webkit-scrollbar-thumb,
.window-body::-webkit-scrollbar-thumb {
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-darker), inset 1px 1px 0 0 var(--w95-face-lighter),
    inset -2px -2px 0 0 var(--w95-face-dark), inset 2px 2px 0 0 var(--w95-face-light);
}

.hidden {
  display: none !important;
}
