/* Geofile — desktop.css
   Full-screen XP desktop: icons, taskbar with green Start button, clock tray,
   start menu. Window chrome itself is owned by XP.css; this file only handles
   positioning of windows on the desktop (absolute placement, drag bounds,
   maximise behaviour). */

/* ── Desktop surface ──────────────────────────────────────────────────── */
.desktop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: transparent;   /* body paints the Bliss wallpaper */
}

/* ── Desktop icons ────────────────────────────────────────────────────── */
.desktop-icons {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: 80px;
  grid-auto-rows: 86px;
  gap: 4px;
  z-index: 1;
}
.desktop-icon {
  appearance: none; -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 4px 2px;
  width: 80px;
  background: transparent;
  border: 1px dotted transparent;
  cursor: default;
  font-family: inherit;
  font-size: 11px;
  color: #ffffff;
  text-align: center;
  user-select: none;
}
.desktop-icon:focus { outline: none; }
.desktop-icon.is-selected { border-color: rgba(255,255,255,0.5); }
.desktop-icon-glyph {
  width: 44px;
  height: 38px;
  display: block;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.35));
}
.desktop-icon-label {
  display: inline-block;
  max-width: 76px;
  padding: 1px 3px;
  color: #ffffff;
  text-shadow:
    0 0 4px rgba(0,0,0,0.7),
    1px 1px 0 rgba(0,0,0,0.5);
  font-size: 11px;
  line-height: 1.2;
  word-break: break-word;
}
.desktop-icon.is-selected .desktop-icon-label {
  background: #316AC5;
  text-shadow: none;
}
.desktop-icon.is-selected .desktop-icon-glyph {
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4)) brightness(0.85);
}

/* ── Window positioning (XP.css owns the chrome) ───────────────────────── */
/* Every managed window flexes column so its body takes the leftover height
   between title-bar and status-bar — otherwise a window with explicit
   height ends in dead space below the body. */
.app-window {
  z-index: 10;
  display: flex;
  flex-direction: column;
}

/* Resize handle in the bottom-right corner of every managed window. The XP
   grip used three diagonal dashes — we render that with two stacked
   linear-gradients so it stays crisp at any DPI. */
.window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 5;
  background:
    linear-gradient(135deg, transparent 50%, #6F7A85 50%, #6F7A85 60%, transparent 60%, transparent 75%, #6F7A85 75%, #6F7A85 85%, transparent 85%);
  opacity: 0.6;
  pointer-events: auto;
}
.window-resize-handle:hover { opacity: 1; }

/* Snap preview rectangle — translucent blue rectangle that follows the
   cursor's snap zone during drag. Hidden by default; JS toggles display +
   sets left/top/width/height. */
.snap-preview {
  position: fixed;
  display: none;
  background: rgba(49, 106, 197, 0.20);
  border: 2px solid rgba(49, 106, 197, 0.65);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.4) inset;
  pointer-events: none;
  z-index: 100;
  transition: left 80ms, top 80ms, width 80ms, height 80ms;
}
.app-window.is-focused { z-index: 20; }
.app-window.is-minimised { display: none !important; }
.app-window.is-maximised {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 30px) !important;
}

/* The Explorer pane carries .app-window for the manager plus its own size +
   placement so it lands sensibly on first open. */
.explorer-pane {
  width: min(840px, 92vw);
  height: min(560px, calc(100vh - 110px));
  top: 36px;
  left: max(120px, calc(50vw - 420px));
  display: flex;
  flex-direction: column;
}

/* ── Taskbar ──────────────────────────────────────────────────────────── */
.taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background:
    linear-gradient(180deg,
      #1f3597 0%,
      #1d62db 4%,
      #2C82E5 8%,
      #245EDB 50%,
      #1F4FB8 92%,
      #163E96 100%);
  border-top: 1px solid #0A2670;
  box-shadow: inset 0 1px 0 #3E89F4;
  z-index: 30;
  user-select: none;
  font-family: 'Trebuchet MS', 'Tahoma', sans-serif;
}

/* The iconic green "start" button. */
.taskbar-start {
  appearance: none; -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 22px 2px 8px;
  background: linear-gradient(180deg, #43A046 0%, #3A993D 14%, #3A993D 50%, #2E7A30 80%, #245F26 100%);
  border: none;
  border-radius: 4px 16px 16px 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  font-style: italic;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  cursor: default;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.20),
    1px 0 0 rgba(0,0,0,0.20);
}
.taskbar-start:hover {
  background: linear-gradient(180deg, #4FB552 0%, #4CAA4F 14%, #4CAA4F 50%, #357935 80%, #2A6A2C 100%);
}
.taskbar-start.is-open,
.taskbar-start:active {
  background: linear-gradient(180deg, #245F26 0%, #2E7A30 20%, #3A993D 80%, #43A046 100%);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.30),
    inset 0 -1px 0 rgba(255,255,255,0.15),
    1px 0 0 rgba(0,0,0,0.20);
}
.taskbar-start-logo {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.3));
}

/* Tasks area. */
.taskbar-tasks {
  display: flex;
  flex: 1;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  padding: 0 4px;
  align-items: center;
  height: 100%;
}
.taskbar-task {
  appearance: none; -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 180px;
  height: 22px;
  padding: 0 8px;
  background: linear-gradient(180deg, #4D8FE6 0%, #3478DC 50%, #1F5DB8 100%);
  border: 1px solid #0E3F8E;
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.10);
  font-family: inherit;
  font-size: 11px;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
  cursor: default;
}
.taskbar-task:hover {
  background: linear-gradient(180deg, #5FA0F0 0%, #4286E6 50%, #2966C5 100%);
}
.taskbar-task.is-active {
  background: linear-gradient(180deg, #1A4FAA 0%, #2462C2 50%, #2D75D8 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.35);
  border-color: #0E3F8E;
}
.taskbar-task-glyph {
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.2));
}
.taskbar-task-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 400;
}

/* Tray (clock area). */
.taskbar-tray {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 12px;
  margin-left: auto;
  background: linear-gradient(180deg, #1846B0 0%, #1E54CC 8%, #1E54CC 50%, #14409A 100%);
  border-left: 1px solid #0F3585;
  box-shadow: 1px 0 0 #3E89F4 inset;
  font-family: inherit;
  font-size: 11px;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.taskbar-clock { font-variant-numeric: tabular-nums; }

/* ── Start menu (XP two-column layout) ────────────────────────────────── */
.start-menu {
  position: absolute;
  left: 0;
  bottom: 30px;
  width: 400px;
  display: none;
  background: #ffffff;
  border: 1px solid #07237F;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 40;
  font-family: inherit;
  font-size: 11px;
  overflow: hidden;
}
.start-menu.is-open { display: flex; flex-direction: column; }

/* Top blue header with avatar + username. */
.start-menu-header {
  height: 58px;
  background: linear-gradient(180deg, #1565E5 0%, #2D8DEC 14%, #2675DC 60%, #1851B5 100%);
  border-bottom: 2px solid #FFA72D;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.start-menu-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(180deg, #FFFFFF 0%, #C7DCEF 100%);
  border: 2px solid #FFFFFF;
  border-radius: 3px;
  color: #000;
  text-shadow: none;
}
.start-menu-user { font-size: 14px; font-weight: 700; }

/* Two-column body. Left = pinned apps on white, right = system folders on
   beige inset (real XP did this). */
.start-menu-body {
  display: flex;
  background: #FFFFFF;
}
.start-menu-col {
  flex: 1;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
}
.start-menu-col-right {
  background: #D3E5FA;
  border-left: 1px solid #B3CBE4;
}
.start-menu-item {
  appearance: none; -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: transparent;
  border: none;
  text-align: left;
  font: inherit;
  font-size: 11px;
  color: #000;
  cursor: default;
}
.start-menu-item:hover:not([disabled]) {
  background: #316AC5;
  color: #fff;
}
.start-menu-item[disabled] {
  color: #777;
  cursor: default;
}
.start-menu-item-glyph {
  width: 26px;
  height: 22px;
  flex-shrink: 0;
}
.start-menu-item-glyph-emoji {
  width: 26px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.start-menu-sep {
  height: 1px;
  background: #B3CBE4;
  margin: 4px 8px;
}
.start-menu-col-left .start-menu-sep { background: #C7C3B8; }

.start-menu-all {
  margin-top: auto;
  padding: 8px 10px 6px;
  border-top: 1px solid #C7C3B8;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: #000;
}
.start-menu-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: linear-gradient(180deg, #3A993D 0%, #2E7A30 100%);
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
}

/* Footer strip with Log Off + Turn Off Computer. */
.start-menu-footer {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 6px 14px;
  background: linear-gradient(180deg, #2675DC 0%, #1851B5 100%);
  border-top: 1px solid #07237F;
}
.start-menu-footer-btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 4px;
  font-family: inherit;
  font-size: 11px;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  cursor: default;
}
.start-menu-footer-btn:hover { text-decoration: underline; }
.start-menu-footer-glyph {
  width: 18px;
  height: 18px;
  background: linear-gradient(180deg, #FFD23D 0%, #C99300 100%);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .desktop-icons { grid-template-columns: 72px; grid-auto-rows: 78px; gap: 2px; }
  .desktop-icon, .desktop-icon-label { width: 72px; max-width: 72px; }
  .explorer-pane {
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 100px) !important;
    top: 8px !important;
    left: 8px !important;
  }
  .app-window { width: calc(100vw - 24px) !important; left: 12px !important; }
}

/* ── XP-style scrollbars (always visible, chunky, beveled) ──────────────
   On macOS the default scrollbar auto-hides, which makes the explorer
   content look like it doesn't scroll. These rules force a permanently-
   visible scrollbar with XP's grey-bevel look. WebKit (Chrome/Safari)
   honours ::-webkit-scrollbar; Firefox falls back to scrollbar-color. */
.ex-content-scroll::-webkit-scrollbar,
.ex-sidebar::-webkit-scrollbar,
.window-body::-webkit-scrollbar,
.ww-body::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}
.ex-content-scroll::-webkit-scrollbar-track,
.ex-sidebar::-webkit-scrollbar-track,
.window-body::-webkit-scrollbar-track,
.ww-body::-webkit-scrollbar-track {
  background:
    repeating-conic-gradient(#E8E8E0 0% 25%, #DFDFD7 0% 50%) 50% / 4px 4px;
}
.ex-content-scroll::-webkit-scrollbar-thumb,
.ex-sidebar::-webkit-scrollbar-thumb,
.window-body::-webkit-scrollbar-thumb,
.ww-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #FAFAFA 0%, #ECECE0 50%, #C9C7BA 100%);
  border: 1px solid #707070;
  border-radius: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -1px 0 rgba(0,0,0,0.10);
}
.ex-content-scroll::-webkit-scrollbar-thumb:hover,
.ex-sidebar::-webkit-scrollbar-thumb:hover,
.window-body::-webkit-scrollbar-thumb:hover,
.ww-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #FFFFFF 0%, #F0F0E5 50%, #D5D3C5 100%);
}
.ex-content-scroll::-webkit-scrollbar-button,
.ex-sidebar::-webkit-scrollbar-button,
.window-body::-webkit-scrollbar-button,
.ww-body::-webkit-scrollbar-button {
  background: linear-gradient(180deg, #FAFAFA 0%, #ECECE0 50%, #C9C7BA 100%);
  border: 1px solid #707070;
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-position: center;
}
.ex-content-scroll::-webkit-scrollbar-button:vertical:decrement,
.ex-sidebar::-webkit-scrollbar-button:vertical:decrement,
.window-body::-webkit-scrollbar-button:vertical:decrement,
.ww-body::-webkit-scrollbar-button:vertical:decrement {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path d='M 1 5 L 4 2 L 7 5 Z' fill='%23000'/></svg>"),
    linear-gradient(180deg, #FAFAFA 0%, #ECECE0 50%, #C9C7BA 100%);
}
.ex-content-scroll::-webkit-scrollbar-button:vertical:increment,
.ex-sidebar::-webkit-scrollbar-button:vertical:increment,
.window-body::-webkit-scrollbar-button:vertical:increment,
.ww-body::-webkit-scrollbar-button:vertical:increment {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path d='M 1 3 L 7 3 L 4 6 Z' fill='%23000'/></svg>"),
    linear-gradient(180deg, #FAFAFA 0%, #ECECE0 50%, #C9C7BA 100%);
}
.ex-content-scroll::-webkit-scrollbar-corner,
.ex-sidebar::-webkit-scrollbar-corner,
.window-body::-webkit-scrollbar-corner,
.ww-body::-webkit-scrollbar-corner {
  background: #DFDFD7;
}
.ex-content-scroll, .ex-sidebar, .window-body, .ww-body {
  scrollbar-color: #C9C7BA #DFDFD7;
}
