/* ==========================================================================
   Windows 95 style core stylesheet
   ========================================================================== */

@font-face {
  font-family: "Sarasa Fixed SC";
  src: url("../data/assets/sarasa-fixed-sc-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --w95-bg: #008080;
  --w95-gray: #c0c0c0;
  --w95-gray-dark: #808080;
  --w95-gray-darker: #404040;
  --w95-gray-light: #dfdfdf;
  --w95-white: #ffffff;
  --w95-blue: #000080;
  --w95-blue-light: #1084d0;
  --w95-black: #000000;
  --w95-font: "Sarasa Fixed SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--w95-font);
  font-size: 13px;
  background: var(--w95-bg);
  user-select: none;
}

/* -------------------------------------------------------------------------
   3D border helpers (classic Win95 bevel look)
   ------------------------------------------------------------------------- */
.bevel-out {
  border-top: 1px solid var(--w95-white);
  border-left: 1px solid var(--w95-white);
  border-right: 1px solid var(--w95-gray-darker);
  border-bottom: 1px solid var(--w95-gray-darker);
  box-shadow: inset 1px 1px 0 var(--w95-gray-light),
              inset -1px -1px 0 var(--w95-gray-dark);
}

.bevel-in {
  border-top: 1px solid var(--w95-gray-darker);
  border-left: 1px solid var(--w95-gray-darker);
  border-right: 1px solid var(--w95-white);
  border-bottom: 1px solid var(--w95-white);
  box-shadow: inset 1px 1px 0 var(--w95-gray-dark),
              inset -1px -1px 0 var(--w95-gray-light);
}

/* -------------------------------------------------------------------------
   Desktop
   ------------------------------------------------------------------------- */
.desktop {
  position: relative;
  width: 100%;
  height: calc(100% - 30px);
  background: var(--w95-bg);
  overflow: hidden;
}

.desktop-icons {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 4px;
  height: calc(100% - 16px);
  align-content: flex-start;
}

.desktop-icon {
  width: 76px;
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 4px;
  cursor: pointer;
  color: var(--w95-white);
  text-align: center;
}

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

.desktop-icon .icon-glyph {
  font-size: 32px;
  line-height: 32px;
}

.desktop-icon .icon-label {
  font-size: 12px;
  text-shadow: 1px 1px 1px #000;
  word-break: break-all;
}

.window-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.window-layer > * {
  pointer-events: auto;
}

/* -------------------------------------------------------------------------
   Window
   ------------------------------------------------------------------------- */
.win95-window {
  position: absolute;
  min-width: 260px;
  min-height: 160px;
  background: var(--w95-gray);
  padding: 3px;
  display: flex;
  flex-direction: column;
}

.win95-window.bevel-out {
  /* re-apply thicker window frame */
  border-top: 2px solid var(--w95-gray-light);
  border-left: 2px solid var(--w95-gray-light);
  border-right: 2px solid var(--w95-gray-darker);
  border-bottom: 2px solid var(--w95-gray-darker);
}

.win95-window.focused {
  z-index: 10;
}

.win95-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, var(--w95-gray-dark), var(--w95-gray));
  color: var(--w95-gray-light);
  padding: 3px 4px;
  cursor: move;
  height: 20px;
}

.win95-window.focused .win95-titlebar {
  background: linear-gradient(90deg, var(--w95-blue), var(--w95-blue-light));
  color: var(--w95-white);
}

.win95-titlebar-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win95-titlebar-icon { cursor: pointer; line-height: 16px; }
.win95-system-menu {
  position: absolute;
  top: 24px;
  left: 2px;
  z-index: 1000;
  min-width: 130px;
  padding: 2px;
  background: var(--w95-gray);
  border: 2px outset var(--w95-white);
  box-shadow: 2px 2px 3px rgba(0, 0, 0, .3);
}
.win95-system-menu[hidden] { display: none; }
.win95-system-menu button {
  display: block;
  width: 100%;
  padding: 3px 14px;
  border: 0;
  background: transparent;
  color: #000;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.win95-system-menu button:hover { background: var(--w95-blue); color: var(--w95-white); }
.win95-system-menu-separator { height: 1px; margin: 2px 0; border-top: 1px solid var(--w95-gray-dark); border-bottom: 1px solid var(--w95-white); }

.win95-titlebar-controls {
  display: flex;
  gap: 2px;
}

.win95-titlebar-controls button {
  width: 16px;
  height: 14px;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  background: var(--w95-gray);
  cursor: pointer;
}

.win95-window-body {
  flex: 1;
  overflow: auto;
  background: var(--w95-white);
  margin-top: 2px;
  padding: 6px;
  border-top: 1px solid var(--w95-gray-darker);
  border-left: 1px solid var(--w95-gray-darker);
  border-right: 1px solid var(--w95-white);
  border-bottom: 1px solid var(--w95-white);
}

.win95-window-resize-handle {
  position: absolute;
  z-index: 4;
}
.win95-resize-n,
.win95-resize-s {
  left: 8px;
  right: 8px;
  height: 6px;
  cursor: ns-resize;
}
.win95-resize-n { top: -3px; }
.win95-resize-s { bottom: -3px; }
.win95-resize-e,
.win95-resize-w {
  top: 8px;
  bottom: 8px;
  width: 6px;
  cursor: ew-resize;
}
.win95-resize-e { right: -3px; }
.win95-resize-w { left: -3px; }
.win95-resize-ne,
.win95-resize-nw,
.win95-resize-se,
.win95-resize-sw {
  width: 12px;
  height: 12px;
}
.win95-resize-ne { top: -3px; right: -3px; cursor: nesw-resize; }
.win95-resize-nw { top: -3px; left: -3px; cursor: nwse-resize; }
.win95-resize-se { right: -3px; bottom: -3px; cursor: nwse-resize; }
.win95-resize-sw { left: -3px; bottom: -3px; cursor: nesw-resize; }
.win95-window.resizing,
.win95-window.resizing * {
  user-select: none;
}

.win95-window.maximized .win95-window-resize-handle {
  display: none;
}

/* -------------------------------------------------------------------------
   Buttons / Inputs
   ------------------------------------------------------------------------- */
.win95-btn {
  background: var(--w95-gray);
  border: none;
  font-family: var(--w95-font);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.win95-btn.bevel-out:active {
  border-top: 1px solid var(--w95-gray-darker);
  border-left: 1px solid var(--w95-gray-darker);
  border-right: 1px solid var(--w95-white);
  border-bottom: 1px solid var(--w95-white);
  box-shadow: inset 1px 1px 0 var(--w95-gray-dark),
              inset -1px -1px 0 var(--w95-gray-light);
}

.win95-input,
.win95-select,
.win95-textarea {
  font-family: var(--w95-font);
  font-size: 12px;
  padding: 3px 4px;
  background: var(--w95-white);
  border-top: 1px solid var(--w95-gray-darker);
  border-left: 1px solid var(--w95-gray-darker);
  border-right: 1px solid var(--w95-white);
  border-bottom: 1px solid var(--w95-white);
}

/* -------------------------------------------------------------------------
   Taskbar
   ------------------------------------------------------------------------- */
.taskbar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 30px;
  background: var(--w95-gray);
  border-top: 1px solid var(--w95-gray-light);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  z-index: 1000;
}

.start-button {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
}

.start-icon {
  font-size: 14px;
}

.taskbar-tasks {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow: hidden;
  height: 100%;
}

.taskbar-task {
  min-width: 120px;
  max-width: 180px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.taskbar-task.active {
  border-top: 1px solid var(--w95-gray-darker);
  border-left: 1px solid var(--w95-gray-darker);
  border-right: 1px solid var(--w95-white);
  border-bottom: 1px solid var(--w95-white);
  box-shadow: inset 1px 1px 0 var(--w95-gray-dark);
}

.taskbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 8px;
  border-top: 1px solid var(--w95-gray-darker);
  border-left: 1px solid var(--w95-gray-darker);
  border-right: 1px solid var(--w95-white);
  border-bottom: 1px solid var(--w95-white);
  font-size: 12px;
}

.taskbar-clock.early-morning-warning {
  color: #cc0000;
  font-weight: bold;
}

/* -------------------------------------------------------------------------
   Start menu
   ------------------------------------------------------------------------- */
.start-menu {
  position: fixed;
  left: 2px;
  bottom: 32px;
  width: 240px;
  background: var(--w95-gray);
  z-index: 1001;
  padding: 4px;
}

.start-menu.hidden {
  display: none;
}

.start-menu-group-title {
  padding: 5px 8px 3px;
  color: var(--w95-gray-dark);
  border-bottom: 1px solid var(--w95-gray-dark);
  font-size: 11px;
  font-weight: bold;
}

.start-menu-separator {
  height: 2px;
  margin: 4px 0;
  border-top: 1px solid var(--w95-gray-dark);
  border-bottom: 1px solid var(--w95-white);
}

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

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

.start-menu-item-icon {
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
  font-size: 16px;
}

.start-menu-phase-item {
  min-height: 42px;
  margin: 2px 0;
  padding: 8px 10px;
  background: var(--w95-blue);
  color: var(--w95-white);
  font-size: 14px;
  font-weight: bold;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.55), inset -1px -1px 0 rgba(0, 0, 0, 0.45);
}

.start-menu-phase-item .start-menu-item-icon {
  font-size: 22px;
}

.start-menu-phase-item:hover {
  background: #174a9c;
}

/* -------------------------------------------------------------------------
   Notification banner
   ------------------------------------------------------------------------- */
.notification-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  background: var(--w95-gray);
  border: 2px solid var(--w95-gray-dark);
  box-shadow: 2px 2px 0 var(--w95-black, #000);
  padding: 8px 16px;
  font-size: 12px;
  max-width: 80vw;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.notification-banner.hidden {
  display: none;
}

.notification-banner.visible {
  opacity: 1;
}
