/* ============================================================
   XäT OS 95 — Win95-on-X11 CSS
   Pure CSS for the entire visual stack.
   ============================================================ */

/* --- Fonts --- */
@font-face {
  font-family: "Fixedsys Excelsior";
  src: url("/os/static/fonts/FSEX302.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000080;
  color: #FFF;
  padding: 4px 8px;
  z-index: 99999;
  font-size: 12px;
}
.skip-link:focus {
  left: 0;
}

/* ============================================================
   2.1  X11 root window background
   ============================================================ */
html, body {
  margin: 0; height: 100%; overflow: hidden;
  /* 2×2 checkerboard via repeating-conic-gradient */
  background: repeating-conic-gradient(#7B7B7B 0% 25%, #848484 25% 50%) 0 0 / 2px 2px;
  image-rendering: pixelated;
  cursor: url("/os/static/cursors/x11_cursor.svg") 8 8, crosshair;
}

/* ============================================================
   2.2  Desktop container
   ============================================================ */
#desktop {
  position: absolute;
  width: 640px; height: 480px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: #008080;
  overflow: hidden;
  font-family: "Pixelated MS Sans Serif", "MS Sans Serif", Tahoma, "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  color: #000;
  cursor: url("/os/static/cursors/pointer.svg") 0 0, default;
}

@media (max-width: 660px), (max-height: 500px) {
  #desktop {
    width: 100dvw; height: 100dvh;
    left: 0; top: 0;
    transform: none;
  }
}

/* ============================================================
   2.3  Win95 bevel system
   ============================================================ */
.bevel-raised {
  border-top: 1px solid #FFF;
  border-left: 1px solid #FFF;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  outline: 1px solid #000;
  outline-offset: -1px;
}
.bevel-raised:not(button) {
  outline-offset: 0;
}

.bevel-sunken {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #FFF;
  border-bottom: 1px solid #FFF;
  outline: 1px solid #000;
  outline-offset: -1px;
}

.bevel-window {
  border-top: 2px solid #DFDFDF;
  border-left: 2px solid #DFDFDF;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  outline: 1px solid #000;
}

/* ============================================================
   2.4  Taskbar
   ============================================================ */
#taskbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: #C0C0C0;
  border-top: 2px solid #FFF;
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  z-index: 900;
}

#start-button {
  height: 22px;
  padding: 1px 4px 1px 2px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #C0C0C0;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}
#start-button:active, #start-button.bevel-sunken {
  padding: 2px 3px 0 3px;
}

.start-logo {
  display: inline-block;
  width: 16px; height: 16px;
  background: url("/os/static/icons/win_flag.svg") no-repeat center / contain;
  image-rendering: pixelated;
}

.start-text { line-height: 16px; }

#taskbar-buttons {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow: hidden;
}

.taskbar-btn {
  height: 22px;
  padding: 1px 6px;
  background: #C0C0C0;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  text-align: left;
}

#system-tray {
  height: 22px;
  padding: 1px 6px;
  background: #C0C0C0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#clock {
  font-size: 11px;
  font-family: inherit;
}

/* ============================================================
   2.5  Start Menu
   ============================================================ */
#start-menu {
  position: absolute;
  bottom: 28px; left: 2px;
  width: 160px;
  background: #C0C0C0;
  z-index: 950;
  display: flex;
}

.start-sidebar {
  width: 22px;
  background: linear-gradient(to top, #000080, #808080);
  color: #C0C0C0;
  font-weight: bold;
  font-size: 14px;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 2px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.start-items {
  flex: 1;
  padding: 2px 0;
}

.start-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 8px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}
.start-item:hover {
  background: #000080;
  color: #FFF;
}

.power-icon {
  display: inline-block;
  width: 16px; height: 16px;
  background: url("/os/static/icons/power.svg") no-repeat center / contain;
  image-rendering: pixelated;
}

/* ============================================================
   2.6  Desktop icons
   ============================================================ */
#desktop-area {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 28px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  padding: 8px;
  gap: 4px;
}

.desktop-icon {
  width: 75px;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  gap: 2px;
  text-align: center;
}

.icon-image {
  width: 32px; height: 32px;
  background: url("/os/static/icons/notepad.svg") no-repeat center / contain;
  image-rendering: pixelated;
  position: relative;
  flex-shrink: 0;
}

.icon-recycle {
  background: url("/os/static/icons/recycle_empty.svg") no-repeat center / contain !important;
  image-rendering: pixelated;
}

.icon-label {
  color: #FFF;
  text-shadow: 1px 1px 0 #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 72px;
  line-height: 1.2;
}

.desktop-icon.selected .icon-label {
  background: #000080;
  color: #FFF;
  text-shadow: none;
  padding: 0 2px;
}

.desktop-icon.selected .icon-image {
  filter: brightness(0.7) saturate(2);
}

/* ============================================================
   2.7  Notepad window
   ============================================================ */
.notepad-window {
  position: absolute;
  width: 420px;
  height: 320px;
  min-width: 200px;
  min-height: 120px;
  background: #C0C0C0;
  display: flex;
  flex-direction: column;
}

.notepad-window.minimized {
  display: none;
}

.notepad-window.maximized {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: calc(100% - 28px) !important;
}

.notepad-titlebar {
  height: 18px;
  background: linear-gradient(90deg, #808080, #C0C0C0);
  display: flex;
  align-items: center;
  padding: 1px 2px;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.notepad-window.active .notepad-titlebar {
  background: linear-gradient(90deg, #000080, #1084D0);
}

.notepad-title {
  color: #C0C0C0;
  font-weight: bold;
  font-size: 11px;
  flex: 1;
  padding-left: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notepad-window.active .notepad-title {
  color: #FFF;
}

.title-buttons {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}

.title-btn {
  width: 16px; height: 14px;
  background: #C0C0C0;
  border-top: 1px solid #FFF;
  border-left: 1px solid #FFF;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  cursor: pointer;
  position: relative;
  padding: 0;
  font-size: 0;
}
.title-btn:active {
  border-top: 1px solid #000;
  border-left: 1px solid #000;
  border-right: 1px solid #FFF;
  border-bottom: 1px solid #FFF;
}

/* Close button (×) */
.btn-close {
  background: #C0C0C0 url("/os/static/icons/btn_close.svg") no-repeat center / 10px 10px;
}

/* Minimize button (—) */
.btn-minimize {
  background: #C0C0C0 url("/os/static/icons/btn_min.svg") no-repeat center / 10px 10px;
}

/* Maximize button (□) */
.btn-maximize {
  background: #C0C0C0 url("/os/static/icons/btn_max.svg") no-repeat center / 10px 10px;
}

.notepad-menubar {
  height: 18px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}

.menu-label {
  padding: 1px 6px;
  font-size: 11px;
  cursor: default;
}
.menu-label:hover {
  background: #000080;
  color: #FFF;
}

.notepad-content {
  flex: 1;
  margin: 2px;
  background: #FFF;
  overflow-y: auto;
  overflow-x: hidden;
}

.notepad-content pre {
  font-family: "Fixedsys Excelsior", "Fixedsys", "Consolas", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.3;
  padding: 2px 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 8;
}

/* Win95-style scrollbar */
.notepad-content::-webkit-scrollbar {
  width: 16px;
}
.notepad-content::-webkit-scrollbar-track {
  background: repeating-conic-gradient(#C0C0C0 0% 25%, #FFF 25% 50%) 0 0 / 2px 2px;
}
.notepad-content::-webkit-scrollbar-thumb {
  background: #C0C0C0;
  border-top: 1px solid #FFF;
  border-left: 1px solid #FFF;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}
.notepad-content::-webkit-scrollbar-button {
  height: 16px;
  background: #C0C0C0;
  border-top: 1px solid #FFF;
  border-left: 1px solid #FFF;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

@supports (scrollbar-color: auto) {
  .notepad-content {
    scrollbar-color: #C0C0C0 #DFDFDF;
    scrollbar-width: auto;
  }
}

/* ============================================================
   2.8  Dialog boxes
   ============================================================ */
.dialog-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 990;
}

.dialog-window {
  background: #C0C0C0;
  min-width: 280px;
  max-width: 400px;
}

.dialog-titlebar {
  height: 18px;
  background: linear-gradient(90deg, #000080, #1084D0);
  display: flex;
  align-items: center;
  padding: 1px 2px;
  color: #FFF;
  font-weight: bold;
  font-size: 11px;
}

.dialog-titlebar span {
  flex: 1;
  padding-left: 2px;
}

.dialog-body {
  display: flex;
  padding: 12px;
  gap: 12px;
}

.dialog-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
}

.exclamation-icon {
  background: url("/os/static/icons/exclamation.svg") no-repeat center / contain;
  image-rendering: pixelated;
}

.dialog-content { flex: 1; }

.dialog-content p {
  margin-bottom: 8px;
  font-size: 11px;
}

.radio-option {
  display: block;
  margin: 6px 0;
  font-size: 11px;
  cursor: pointer;
}

.radio-option input {
  margin-right: 4px;
}

.dialog-buttons {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px 10px;
}

.dialog-btn {
  min-width: 72px;
  height: 23px;
  background: #C0C0C0;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 1px 8px;
}
.dialog-btn:active {
  border-top-color: #808080;
  border-left-color: #808080;
  border-right-color: #FFF;
  border-bottom-color: #FFF;
}

/* ============================================================
   2.9  BSOD
   ============================================================ */
#bsod {
  background: #000080;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bsod-text {
  color: #FFF;
  font-family: "Fixedsys Excelsior", "Fixedsys", "Consolas", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  max-width: 580px;
  white-space: pre-wrap;
}

/* ============================================================
   2.10  Boot / shutdown screens
   ============================================================ */
.boot-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1000;
}

/* Center boot screens same as desktop */
@media (min-width: 661px) and (min-height: 501px) {
  .boot-screen {
    width: 640px; height: 480px;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 660px), (max-height: 500px) {
  .boot-screen {
    width: 100dvw; height: 100dvh;
  }
}

/* POST screen */
#boot-post {
  background: #000;
  padding: 8px;
}

#post-text {
  color: #C0C0C0;
  font-family: "Fixedsys Excelsior", "Fixedsys", "Consolas", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Splash screen */
#boot-splash {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo {
  text-align: center;
}

.splash-svg {
  width: 320px;
  height: 100px;
  margin: 0 auto 8px;
  display: block;
  image-rendering: pixelated;
}

.splash-title {
  font-size: 36px;
  font-weight: bold;
  color: #FFF;
  font-family: "Times New Roman", serif;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.splash-subtitle {
  font-size: 12px;
  color: #C0C0C0;
  margin-bottom: 20px;
}

.splash-progress-track {
  width: 200px;
  height: 18px;
  background: #C0C0C0;
  border: 2px inset #808080;
  margin: 0 auto;
  padding: 2px;
}

.splash-progress-bar {
  height: 100%;
  width: 0;
  background: #000080;
  transition: width 0.06s linear;
}

/* Shutdown screen */
#shutdown-screen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shutdown-text {
  color: #FF8000;
  font-size: 22px;
  font-family: "Times New Roman", serif;
  text-align: center;
}

/* ============================================================
   Context menu
   ============================================================ */
.context-menu {
  position: absolute;
  background: #C0C0C0;
  border-top: 2px solid #FFF;
  border-left: 2px solid #FFF;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  min-width: 160px;
  z-index: 960;
  padding: 2px 0;
  font-size: 11px;
}

.context-menu .menu-item {
  padding: 3px 24px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.context-menu .menu-item:hover {
  background: #000080;
  color: #FFF;
}

.context-menu .menu-item.disabled {
  color: #808080;
  cursor: default;
  text-shadow: 1px 1px 0 #FFF;
}
.context-menu .menu-item.disabled:hover {
  background: transparent;
  color: #808080;
}

.menu-separator {
  height: 1px;
  margin: 2px 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #FFF;
}

.has-submenu::after {
  content: "▸";
  position: absolute;
  right: 8px;
  top: 3px;
}

.submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: -2px;
  background: #C0C0C0;
  border-top: 2px solid #FFF;
  border-left: 2px solid #FFF;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  min-width: 150px;
  padding: 2px 0;
}

.has-submenu:hover > .submenu {
  display: block;
}

/* ============================================================
   Screensaver
   ============================================================ */
#screensaver {
  position: absolute;
  top: 0; left: 0;
  z-index: 980;
}
@media (min-width: 661px) and (min-height: 501px) {
  #screensaver {
    width: 640px; height: 480px;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
  }
}
@media (max-width: 660px), (max-height: 500px) {
  #screensaver {
    width: 100dvw; height: 100dvh;
  }
}
