/* XP "Luna" approximation — period-correct enough to make you smile.
   Pairs with /app/files. */

body.xp {
  background: #5179c8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%235179c8'/%3E%3C/svg%3E");
  font: 11px/1.4 Tahoma, "MS Sans Serif", Geneva, sans-serif;
  color: #000;
}

body.xp nav { display: none; }
body.xp main { max-width: none; margin: 0; padding: 0; }

/* The "desktop wallpaper" container */
.xp-desktop {
  min-height: 100vh;
  padding: 28px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Main explorer window */
.xp-window {
  width: 100%;
  max-width: 980px;
  background: #ece9d8;
  border: 1px solid #0a246a;
  border-radius: 6px 6px 0 0;
  box-shadow:
    inset 0 0 0 1px #fff,
    0 8px 24px rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Title bar */
.xp-title {
  height: 28px;
  background: linear-gradient(
    180deg,
    #0997ff 0%,
    #0053ee 8%,
    #0050ee 40%,
    #06f 88%,
    #0050ee 93%,
    #06c 100%
  );
  color: white;
  display: flex;
  align-items: center;
  padding: 0 4px 0 6px;
  font-weight: bold;
  font-size: 11px;
  text-shadow: 1px 1px #00000060;
  border-radius: 5px 5px 0 0;
  user-select: none;
}
.xp-title .icon { margin-right: 6px; font-size: 14px; }
.xp-title .controls { margin-left: auto; display: flex; gap: 2px; }
.xp-title .ctl {
  width: 22px; height: 22px;
  background: linear-gradient(180deg, #f5a96b, #f08236);
  border: 1px solid #913b00;
  border-radius: 3px;
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  font-size: 13px;
  text-shadow: none;
  cursor: pointer;
}
.xp-title .ctl.close { background: linear-gradient(180deg, #ff5d4d, #c41a00); border-color: #5e0c00; }
.xp-title .ctl:hover { filter: brightness(1.1); }

/* Menu bar */
.xp-menu {
  background: #ece9d8;
  border-bottom: 1px solid #aca899;
  display: flex;
  padding: 2px 4px;
  gap: 0;
  font-size: 11px;
}
.xp-menu .item { padding: 2px 8px; cursor: default; }
.xp-menu .item u { text-decoration: underline; }
.xp-menu .item:hover { background: #316ac5; color: white; }

/* Toolbar */
.xp-toolbar {
  background: linear-gradient(180deg, #fdfcf6, #ece9d8);
  border-bottom: 1px solid #aca899;
  padding: 4px 8px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.xp-toolbar button {
  background: linear-gradient(180deg, #fff, #d6d2bc);
  border: 1px solid #aca899;
  border-radius: 3px;
  padding: 4px 10px;
  font: 11px Tahoma, sans-serif;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.xp-toolbar button:hover { background: linear-gradient(180deg, #faf6d5, #f4e8a6); border-color: #b09a3d; }
.xp-toolbar button:disabled { color: #999; cursor: not-allowed; }
.xp-toolbar .sep {
  width: 1px; height: 18px; background: #aca899; margin: 0 4px;
}

/* Address bar */
.xp-address {
  background: white;
  border-top: 1px solid #aca899;
  border-bottom: 1px solid #aca899;
  padding: 5px 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.xp-address label { font-size: 11px; }
.xp-address input {
  flex: 1;
  border: 1px solid #7f9db9;
  padding: 3px 6px;
  font: 11px Tahoma, sans-serif;
  background: white;
}
.xp-address button {
  background: linear-gradient(180deg, #fff, #d6d2bc);
  border: 1px solid #aca899;
  padding: 3px 12px;
  font: 11px Tahoma, sans-serif;
  cursor: pointer;
}

/* Body: sidebar + content */
.xp-body {
  display: flex;
  min-height: 480px;
}
.xp-sidebar {
  width: 200px;
  background: linear-gradient(180deg, #7da1de, #4f76b3 60%, #3e60a3);
  color: white;
  padding: 12px 10px;
  font-size: 11px;
  flex-shrink: 0;
  border-right: 1px solid #0a246a;
}
.xp-sidebar h4 {
  margin: 0 0 6px;
  font-weight: bold;
  text-shadow: 1px 1px #00000040;
  font-size: 12px;
  padding: 4px 6px;
  background: linear-gradient(180deg, #ffcb73, #f59c12);
  color: #422a00;
  text-shadow: 1px 1px #ffffff60;
  border-radius: 3px;
}
.xp-sidebar a {
  display: block;
  color: white;
  padding: 2px 6px;
  text-decoration: none;
  font-size: 11px;
}
.xp-sidebar a:hover { text-decoration: underline; }
.xp-sidebar .group { margin: 0 0 12px; }

/* Content area */
.xp-content {
  flex: 1;
  background: white;
  padding: 10px;
  overflow-y: auto;
  max-height: 70vh;
}

/* Icon grid view */
.xp-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 4px;
  user-select: none;
}
.xp-icons .item {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
}
.xp-icons .item:hover { background: #dceffc; outline: 1px dotted #316ac5; }
.xp-icons .item.selected { background: #b6d7ff; outline: 1px dotted #316ac5; }
.xp-icons .icon {
  font-size: 40px;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.xp-icons .label {
  font-size: 11px;
  margin-top: 4px;
  word-break: break-all;
  line-height: 1.2;
  max-width: 90px;
}

/* Status bar */
.xp-status {
  background: #ece9d8;
  border-top: 1px solid #fff;
  box-shadow: inset 0 1px #aca899;
  padding: 3px 8px;
  font-size: 11px;
  display: flex;
  gap: 14px;
  color: #333;
}

/* Empty / loading state */
.xp-content .empty { color: #666; padding: 32px; text-align: center; }
.xp-content .loading { color: #444; padding: 24px; text-align: center; }

/* Modal (Open/Properties dialog) */
.xp-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
}
.xp-modal-backdrop.show { display: flex; }
.xp-modal {
  background: #ece9d8;
  border: 1px solid #0a246a;
  border-radius: 6px 6px 0 0;
  width: 440px;
  max-width: 90vw;
}
.xp-modal .title {
  background: linear-gradient(180deg, #0997ff 0%, #0053ee 8%, #06f 100%);
  color: white;
  padding: 4px 8px;
  font-weight: bold;
  border-radius: 5px 5px 0 0;
}
.xp-modal .body { padding: 16px; }
.xp-modal .actions { padding: 8px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #aca899; }
.xp-modal button {
  background: linear-gradient(180deg, #fff, #d6d2bc);
  border: 1px solid #aca899;
  padding: 4px 18px;
  font: 11px Tahoma, sans-serif;
  cursor: pointer;
  min-width: 75px;
}
.xp-modal kbd, .xp-modal code {
  background: white;
  border: 1px solid #aca899;
  padding: 2px 6px;
  font: 11px Consolas, monospace;
}
