/* ============================================================
   Windows XP (Luna "Silver" theme) desktop + Webamp
   ============================================================ */

:root {
  --taskbar-h: 30px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: Tahoma, "Segoe UI", "Trebuchet MS", Verdana, sans-serif;
  font-size: 11px;
  color: #000;
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: default;
}

.hidden { display: none !important; }
.svg-sprite { position: absolute; }

/* ============================================================
   Desktop + wallpaper
   ============================================================ */
#desktop {
  position: fixed;
  inset: 0;
  z-index: 0;                       /* traps Webamp's internal z-indexes below the taskbar */
  background-color: #000;           /* requested: black background */
  background-image: url("./wallpaper.jpg");   /* centered, not stretched */
  background-repeat: no-repeat;
  background-position: center center;
  background-size: auto;
}

#webamp-root {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---- Desktop icons ---- */
#desktop-icons {
  position: absolute;
  top: 8px;
  left: 6px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desktop-icon {
  width: 76px;
  padding: 4px 2px 3px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.desktop-icon .di-img,
.desktop-icon .di-img svg,
.desktop-icon .di-img img { width: 32px; height: 32px; display: block; }
.desktop-icon .di-img img { object-fit: contain; }
.desktop-icon .di-img { filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, .55)); }

.desktop-icon .di-label {
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  color: #fff;
  padding: 1px 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .9);
}

.desktop-icon.selected {
  background: rgba(49, 106, 197, .35);
  border: 1px dotted rgba(255, 255, 255, .6);
}
.desktop-icon.selected .di-img { filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, .55)) brightness(.85); }
.desktop-icon.selected .di-label { background: #316ac5; text-shadow: none; }

/* ============================================================
   Taskbar (silver)
   ============================================================ */
#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  z-index: 100;
  display: flex;
  align-items: stretch;
  /* Authentic Luna taskbar tile (extracted from XP, desaturated to Silver) */
  background: url("assets/taskbar-bg.png") no-repeat;
  background-size: 100% 100%;
}

/* ---- Start button (green orb) ---- */
#start-button {
  position: relative;
  height: 100%;
  width: 92px;
  flex-shrink: 0;
  margin-right: 6px;
  padding: 0 22px 2px 8px;
  border: none;
  display: flex;
  align-items: center;
  gap: 3px;
  color: #fff;
  /* Authentic XP Start button sprite: 3 stacked states (normal/hover/pressed) */
  background: url("assets/startbutton.png") no-repeat;
  background-size: 100% 300%;
  background-position: 0 0;
}
#start-button:hover  { background-position: 0 50%; }
#start-button.active,
#start-button:active { background-position: 0 100%; }

#start-button .winflag { flex: 0 0 20px; height: 16px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
#start-button .winflag img { width: 20px; height: 16px; display: block; object-fit: contain; }

#start-button .start-label {
  font-family: "Franklin Gothic Medium", "Arial Narrow", "Trebuchet MS", Tahoma, sans-serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
  margin-bottom: 2px;
  text-shadow: 1px 2px 2px rgb(69, 76, 16), 0 0 3px rgb(69, 76, 16);
}

/* ---- Running-task buttons (silver) ---- */
#task-buttons {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 4px;
  overflow: hidden;
}
.task-btn {
  height: 22px;
  min-width: 140px;
  max-width: 162px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: #1b1b1b;
  text-align: left;
  border: 1px solid #9a9aa7;
  border-radius: 3px;
  background: linear-gradient(to bottom, #f1f1f5 0%, #dddde5 45%, #d0d1db 55%, #dededf 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .75);
  white-space: nowrap;
  overflow: hidden;
}
.task-btn .tb-ico,
.task-btn .tb-ico svg,
.task-btn .tb-ico img { width: 16px; height: 16px; flex: 0 0 16px; }
.task-btn .tb-ico img { object-fit: contain; display: block; }
.task-btn .tb-label { overflow: hidden; text-overflow: ellipsis; }
.task-btn.active {
  font-weight: bold;
  background: linear-gradient(to bottom, #cdced9 0%, #babbc9 50%, #c5c6d2 100%);
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, .2);
}

/* ---- System tray ---- */
#systray {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  flex-shrink: 0;
  margin-left: 4px;
  padding: 0 10px 0 18px;
  /* Authentic Luna notification-area tile, desaturated to Silver */
  background: url("assets/taskbar-tray.png") no-repeat;
  background-size: 100% 100%;
}
#systray .tray-ico,
#systray .tray-ico svg { width: 16px; height: 16px; display: block; opacity: .9; }
#clock { font-size: 11px; color: #1b1b1b; }

/* ============================================================
   Start menu (silver)
   ============================================================ */
#start-menu {
  position: fixed;
  left: 0;
  bottom: var(--taskbar-h);
  z-index: 110;
  width: 386px;
  background: #fff;
  border: 1px solid #6f6f7e;
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  overflow: hidden;
  box-shadow: 3px -3px 14px rgba(0, 0, 0, .45);
}

/* Header */
.sm-header {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 56px;
  padding: 0 11px;
  color: #fff;
  background: linear-gradient(to bottom, #b6b9c5 0%, #9c9fae 45%, #8a8d9d 55%, #74778a 100%);
  border-bottom: 2px solid #6a6d80;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.sm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 1px 3px rgba(0, 0, 0, .45);
}
.sm-avatar svg { width: 40px; height: 40px; display: block; }
.sm-username {
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .5);
}

/* Body */
.sm-body { display: flex; }
.sm-left {
  width: 196px;
  min-height: 252px;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 6px 0 0;
}
.sm-right {
  width: 190px;
  min-height: 252px;
  padding: 8px 0 0;
  background: linear-gradient(to bottom, #eaebf0 0%, #dbdce3 100%);
  border-left: 1px solid #b8bbca;
  box-shadow: inset 1px 0 0 #fff;
}

.sm-list { list-style: none; margin: 0; padding: 0; }

/* Pinned program item (left) */
.sm-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  border: none;
  background: transparent;
  text-align: left;
}
.sm-ico, .sm-ico svg, .sm-ico img { width: 30px; height: 30px; flex: 0 0 30px; display: block; }
.sm-ico img { object-fit: contain; }
.sm-ico--sm, .sm-ico--sm svg, .sm-ico--sm img { width: 18px; height: 18px; flex-basis: 18px; }
.sm-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sm-title { color: #0b0b0b; font-weight: bold; }
.sm-sub { color: #5b5b5b; font-size: 10.5px; }
.sm-item:hover {
  background: linear-gradient(to bottom, #3b81e5, #2a60c6);
  border-radius: 2px;
}
.sm-item:hover .sm-title,
.sm-item:hover .sm-sub { color: #fff; }

.sm-left-spacer { flex: 1 1 auto; min-height: 12px; }

.sm-divider {
  border-top: 1px solid #c6cad8;
  margin: 4px 10px 0;
  box-shadow: 0 1px 0 #fff;
}

/* All Programs */
.sm-allprograms-wrap { position: relative; }
.sm-allprograms {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: none;
  background: transparent;
  color: #0b0b0b;
  font-weight: bold;
  text-align: left;
}
.sm-allprograms .sm-ap-arrow { margin-left: auto; color: #1f7a1f; }
.sm-allprograms:hover {
  background: linear-gradient(to bottom, #3b81e5, #2a60c6);
  color: #fff;
  border-radius: 2px;
}
.sm-allprograms:hover .sm-ap-arrow { color: #fff; }

.sm-flyout {
  position: absolute;
  left: 100%;
  bottom: 0;
  margin-left: -2px;
  min-width: 156px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 3px;
  background: #fff;
  border: 1px solid #6f6f7e;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, .35);
  z-index: 5;
}
.sm-flyout--down { top: 0; bottom: auto; }   /* submenu opens downward from a top item */
.sm-skins-empty { padding: 6px 10px; color: #777; font-style: italic; }
.sm-item--flyout { gap: 7px; padding: 5px 8px; }

/* Right-column places */
.sm-place {
  width: 100%;
  padding: 4px 12px;
  border: none;
  background: transparent;
  text-align: left;
  color: #0c2a6e;
  font-weight: bold;
}
.sm-place:hover {
  background: linear-gradient(to bottom, #3b81e5, #2a60c6);
  color: #fff;
  border-radius: 2px;
}
.sm-place-divider {
  border-top: 1px solid #bcbfcd;
  margin: 5px 12px;
  box-shadow: 0 1px 0 #fff;
}

/* Footer */
.sm-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 7px 14px;
  background: linear-gradient(to bottom, #b6b9c5 0%, #9c9fae 45%, #8a8d9d 55%, #777a8c 100%);
  border-top: 2px solid #6a6d80;
}
.sm-foot-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 6px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .45);
}
.sm-foot-btn:hover {
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}
.sm-foot-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #eef0f4, #cfd3dd);
  border: 1px solid #fff;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.sm-foot-ico svg { width: 16px; height: 16px; display: block; }

/* ============================================================
   Shutdown overlay
   ============================================================ */
#shutdown {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(to bottom, #5a7fc0 0%, #3a5f9f 45%, #274a86 100%);
}
.shutdown-inner { text-align: center; }
.shutdown-logo svg { width: 92px; height: 92px; }
.shutdown-text {
  font-family: "Franklin Gothic Medium", "Trebuchet MS", sans-serif;
  font-size: 50px;
  font-weight: bold;
  line-height: 1;
}
.shutdown-text span {
  color: #f7a01d;
  font-style: italic;
  margin-left: 5px;
}
.shutdown-status { margin-top: 28px; font-size: 14px; }
.dots::after { content: ""; animation: dots 1.4s steps(1, end) infinite; }
@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

#shutdown.off { background: #000; cursor: pointer; }
#shutdown.off .shutdown-inner { display: none; }
#shutdown.off::after {
  content: "It’s now safe to close this tab.  (Click anywhere to restart.)";
  color: #d0d0d0;
  font-size: 13px;
}

/* ============================================================
   XP application window (hosts BoxedWine / mIRC) — Silver theme
   ============================================================ */
.xp-window {
  position: absolute;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: #ece9d8;
  border: 3px solid #6f7585;
  border-top: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 3px 3px 20px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.xp-titlebar {
  height: 27px;
  flex: 0 0 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 0 6px;
  color: #fff;
  cursor: default;
  user-select: none;
  background: linear-gradient(to bottom,
      #c0c4d0 0%, #a1a6b6 9%, #898fa1 46%, #7e8497 52%, #9095a7 92%, #777d91 100%);
}
.xp-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .5);
  overflow: hidden; white-space: nowrap;
}
.xp-title-ico { width: 16px; height: 16px; flex: 0 0 16px; }
.xp-title-btns { display: flex; gap: 2px; flex: 0 0 auto; }
.xp-titlebar button {
  width: 22px; height: 21px;
  border: 1px solid #eef0f6;
  border-radius: 3px;
  color: #1e2233;
  font-size: 12px; font-weight: bold; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to bottom, #cdd0db 0%, #aab0c0 50%, #9aa0b2 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.xp-titlebar .xp-close {
  color: #fff;
  background: linear-gradient(to bottom, #e98b7a 0%, #d2543f 50%, #c0392a 100%);
  border-color: #f4c4ba;
  padding-bottom: 1px;
}
.xp-titlebar button:hover { filter: brightness(1.08); }
.xp-titlebar button:active { filter: brightness(.92); }
.xp-window-body {
  flex: 1 1 auto;
  position: relative;
  background: #000;
  border-top: 1px solid #4b5161;
}
.xp-window-body iframe {
  width: 100%; height: 100%;
  border: 0; display: block; background: #000;
}
