/* ============================================================
   Windows-10-Desktop: Wallpaper, Icons, Taskleiste, Startmenue,
   Fensterrahmen. Alles rein lokal, keine externen Ressourcen.
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1a2b;
  font-family: "Segoe UI", "Segoe UI Variable", Tahoma, Arial, sans-serif;
  font-size: 12px;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

#desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
}

/* ---------- Wallpaper (Win10-Hero, per CSS gezeichnet) ---------- */

#wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 55%, rgba(64,152,214,.45) 0%, rgba(19,58,96,.25) 45%, rgba(0,0,0,0) 70%),
    radial-gradient(60% 45% at 50% 52%, rgba(120,200,255,.30) 0%, rgba(0,0,0,0) 75%),
    linear-gradient(160deg, #06121f 0%, #0a2138 40%, #081a2c 70%, #04101c 100%);
  overflow: hidden;
}

/* Die stilisierten "Fenster"-Formen des Win10-Heros */
#wallpaper::before,
#wallpaper::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: 46vw;
  height: 34vw;
  transform-origin: center;
  background:
    linear-gradient(115deg, rgba(150,215,255,.20), rgba(40,120,190,.06) 55%, rgba(0,0,0,0) 80%);
  filter: blur(.5px);
  border-radius: 2px;
}

#wallpaper::before {
  transform: translate(-52%, -50%) perspective(900px) rotateX(52deg) rotateZ(-26deg) skewX(-8deg);
  box-shadow: 0 0 120px 40px rgba(80,170,235,.18);
}

#wallpaper::after {
  width: 30vw;
  height: 22vw;
  transform: translate(-34%, -62%) perspective(900px) rotateX(48deg) rotateZ(-26deg) skewX(-8deg);
  background: linear-gradient(115deg, rgba(190,235,255,.24), rgba(60,140,200,.04) 60%, rgba(0,0,0,0) 85%);
}

/* ---------- Desktop-Icons ---------- */

#desktop-icons {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 92px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
}

.desk-icon {
  width: 86px;
  padding: 6px 2px 4px;
  text-align: center;
  cursor: default;
  border: 1px solid transparent;
  border-radius: 1px;
}

.desk-icon:hover { background: rgba(120,180,240,.22); border-color: rgba(140,195,245,.45); }
.desk-icon.selected,
.desk-icon:focus { background: rgba(90,160,230,.38); border-color: rgba(150,200,245,.7); outline: none; }

.desk-icon-img { height: 34px; display: flex; align-items: flex-end; justify-content: center; }
.desk-icon-img img { width: 32px; height: 32px; image-rendering: auto; }

.desk-icon-label {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 3px rgba(0,0,0,.7);
  word-break: break-word;
}

/* ---------- Fenster ---------- */

#windows { position: absolute; inset: 0 0 40px 0; z-index: 10; pointer-events: none; }

.window {
  position: absolute;
  pointer-events: auto;
  background: #f0f0f0;
  border: 1px solid #d3d3d3;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 14px 40px rgba(0,0,0,.45), 0 3px 10px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  min-width: 220px;
  min-height: 90px;
}

.window.inactive { box-shadow: 0 8px 26px rgba(0,0,0,.32); border-color: #dcdcdc; }
.window.minimized { display: none; }

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

.titlebar {
  height: 30px;
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  cursor: default;
  padding-left: 8px;
}

.window.inactive .titlebar { background: #fff; }

.titlebar-icon { width: 16px; height: 16px; margin-right: 7px; flex: 0 0 16px; }
.titlebar-icon img { width: 16px; height: 16px; }

.titlebar-text {
  flex: 1 1 auto;
  font-size: 12px;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.window.inactive .titlebar-text { color: #6d6d6d; }

.titlebar-buttons { display: flex; flex: 0 0 auto; height: 30px; }

.tb-btn {
  width: 46px;
  height: 30px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
}

.tb-btn svg { pointer-events: none; }
.tb-btn:hover { background: #e5e5e5; }
.tb-btn.close:hover { background: #e81123; }
.tb-btn.close:hover svg path { stroke: #fff; }
.tb-btn:disabled { opacity: .35; }
.tb-btn:disabled:hover { background: transparent; }

.window-body {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

.window .resize-grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  z-index: 50;
}

/* modaler Schleier fuer Dialoge */
.modal-veil {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: transparent;
  pointer-events: auto;
}

/* ---------- Taskleiste ---------- */

#taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background: rgba(12, 12, 12, .92);
  display: flex;
  align-items: stretch;
  z-index: 900;
  box-shadow: 0 -1px 0 rgba(255,255,255,.06);
}

#startbutton {
  width: 48px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
}
#startbutton:hover { background: rgba(255,255,255,.1); }
#startbutton.open { background: rgba(255,255,255,.18); }

#searchbox {
  width: 290px;
  margin: 4px 0;
  background: #fff;
  color: #4b4b4b;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12px;
  cursor: text;
}
#searchbox svg circle, #searchbox svg path { stroke: #4b4b4b; }

#tasklist { flex: 1 1 auto; display: flex; align-items: stretch; overflow: hidden; padding-left: 4px; }

.task-btn {
  width: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
  position: relative;
}
.task-btn img, .task-btn svg { width: 20px; height: 20px; }
.task-btn:hover { background: rgba(255,255,255,.1); }
.task-btn.open { border-bottom-color: #6fb5e8; background: rgba(255,255,255,.06); }
.task-btn.active { border-bottom-color: #76c0ef; background: rgba(255,255,255,.16); }

#tray { display: flex; align-items: stretch; flex: 0 0 auto; }

.tray-icon {
  width: 26px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
}
.tray-icon:hover { background: rgba(255,255,255,.1); }

#clock {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 11.5px;
  line-height: 1.35;
  color: #fff;
  cursor: default;
}
#clock:hover { background: rgba(255,255,255,.1); }

#showdesktop {
  width: 8px;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.2);
  background: transparent;
  cursor: default;
  padding: 0;
}
#showdesktop:hover { background: rgba(255,255,255,.25); }

/* ---------- Startmenue ---------- */

#startmenu {
  position: absolute;
  left: 0;
  bottom: 40px;
  width: 560px;
  height: 620px;
  max-height: calc(100% - 48px);
  background: rgba(28, 28, 28, .96);
  display: flex;
  z-index: 899;
  box-shadow: 0 -2px 20px rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.08);
  border-bottom: 0;
  border-left: 0;
}
#startmenu[hidden] { display: none; }

.sm-left { width: 250px; display: flex; }

.sm-iconbar {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
}
.sm-spacer { flex: 1 1 auto; }
.sm-icon {
  width: 40px; height: 40px;
  border: 0; background: transparent; cursor: default;
  display: flex; align-items: center; justify-content: center;
}
.sm-icon:hover { background: rgba(255,255,255,.12); }

.sm-applist { flex: 1 1 auto; overflow-y: auto; padding: 8px 0 12px; }
.sm-applist::-webkit-scrollbar { width: 8px; }
.sm-applist::-webkit-scrollbar-thumb { background: #6b6b6b; }

.sm-section { padding: 10px 12px 4px; font-size: 12px; color: #cfcfcf; }

.sm-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: default;
}
.sm-item:hover { background: rgba(255,255,255,.12); }
.sm-item img, .sm-item svg { width: 20px; height: 20px; flex: 0 0 20px; }

.sm-right { flex: 1 1 auto; padding: 16px 14px; overflow-y: auto; }
.sm-group-title { font-size: 12px; color: #e6e6e6; margin: 4px 0 10px 4px; }
.sm-tiles { display: flex; flex-wrap: wrap; gap: 4px; }

.sm-tile {
  width: 96px; height: 96px;
  border: 0;
  background: #1f6fa8;
  color: #fff;
  font: inherit;
  font-size: 11.5px;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px;
  text-align: left;
}
.sm-tile.tile-wide { width: 196px; }
.sm-tile:hover { outline: 2px solid rgba(255,255,255,.5); outline-offset: -2px; }
.sm-tile img, .sm-tile svg { width: 30px; height: 30px; }
.sm-tile span { line-height: 1.25; }

/* ---------- Kontextmenue Desktop ---------- */

.desk-context {
  position: absolute;
  z-index: 940;
  background: #f2f2f2;
  border: 1px solid #cfcfcf;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  padding: 2px 0;
  min-width: 200px;
  color: #000;
  font-size: 12px;
}
.desk-context button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  padding: 6px 26px;
  cursor: default;
}
.desk-context button:hover { background: #cde3f7; }
.desk-context hr { border: 0; border-top: 1px solid #dcdcdc; margin: 3px 0; }
