/* 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 {
  font-size: 36px;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4));
}
.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) ───────────────────────── */
.app-window {
  z-index: 10;
}
.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 ───────────────────────────────────────────────────────── */
.start-menu {
  position: absolute;
  left: 0;
  bottom: 30px;
  width: 280px;
  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; }
.start-menu-rail {
  height: 56px;
  background: linear-gradient(180deg, #1565E5 0%, #2D8DEC 14%, #2675DC 60%, #1851B5 100%);
  border-bottom: 1px solid #0A3D9C;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.start-menu-rail-text {
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.start-menu-rail-text em {
  color: rgba(255,255,255,0.7);
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
}
.start-menu-items {
  flex: 1;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #ffffff;
}
.start-menu-item {
  appearance: none; -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 3px;
  text-align: left;
  font: inherit;
  color: #000;
  cursor: default;
}
.start-menu-item:hover {
  background: #316AC5;
  color: #fff;
}
.start-menu-item-glyph {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.start-menu-sep {
  height: 1px;
  background: #C7C3B8;
  margin: 4px 8px;
}
.start-menu-item[data-action="shutdown"] {
  margin-top: 2px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: linear-gradient(180deg, #ECE9D8 0%, #DCD9C8 100%);
  border-top: 1px solid #C7C3B8;
  border-radius: 0;
}
.start-menu-item[data-action="shutdown"]:hover {
  background: linear-gradient(180deg, #316AC5 0%, #1E4F9E 100%);
  color: #ffffff;
}

/* ── 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; }
}
