/* ================= Snow Leopard Desktop ================= */
#desktop {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Helvetica Neue", Helvetica, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.wallpaper {
  position: absolute;
  inset: 0;
}
.wallpaper img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

/* Auswahlrechteck beim Ziehen auf dem Hintergrund (js/desktop.js, beide Desktops) */
.sel-rect {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.70);
}

/* ================= Menüleiste ================= */
.menubar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  background: linear-gradient(#fbfbfb, #e6e6e6 50%, #d0d0d0);
  border-bottom: 1px solid #888;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  font-size: 12.5px;
  color: #222;
}

.menubar-left, .menubar-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.menu-item {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 9px;
  cursor: default;
}
.menu-item:hover { background: linear-gradient(#4a90e8, #2a6fd0); color: #fff; border-radius: 0; }
.apple-menu { padding: 0 11px; }
.app-name { font-weight: 700; }

#menubar-clock { font-size: 12px; }

/* ================= Desktop-Icons ================= */
.desktop-icons {
  position: absolute;
  top: 34px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.desktop-icon {
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: default;
}

.desktop-icon .icon-img {
  width: 58px;
  height: 58px;
  padding: 3px;
  border-radius: 6px;
}
.desktop-icon .icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.desktop-icon .icon-label {
  font-size: 11.5px;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  padding: 1px 7px;
  border-radius: 8px;
  line-height: 1.3;
}

.desktop-icon.selected .icon-img { background: rgba(0,0,0,0.25); }
.desktop-icon.selected .icon-label { background: #1d64d0; text-shadow: none; }

/* ================= Fenster ================= */
.window {
  position: absolute;
  z-index: 100;
  display: none;
  flex-direction: column;
  border-radius: 6px;
  background: #e8e8e8;
  box-shadow: 0 10px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.35);
  overflow: hidden;
}
.window.open { display: flex; }
.window.active { box-shadow: 0 18px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(0,0,0,0.4); }

/* Titelleiste */
.titlebar {
  position: relative;
  flex-shrink: 0;
  height: 22px;
  background: linear-gradient(#e8e8e8, #cecece 55%, #bcbcbc);
  border-bottom: 1px solid #8e8e8e;
  cursor: default;
}
.titlebar-tall { height: auto; }

.window:not(.active) .titlebar { background: linear-gradient(#f4f4f4, #e6e6e6); }

.titlebar-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 400;
  color: #333;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  pointer-events: none;
}
.window:not(.active) .titlebar-title { color: #999; }

/* Ampel-Knöpfe */
.traffic-lights {
  position: absolute;
  top: 4px;
  left: 8px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.tl {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  cursor: default;
  position: relative;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6), 0 1px 1px rgba(0,0,0,0.3);
}
.tl::after {
  content: "";
  position: absolute;
  top: 1.5px; left: 2.5px;
  width: 8px; height: 4px;
  border-radius: 50%;
  background: linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.1));
}
.tl-close { background: radial-gradient(circle at 35% 30%, #ff8a80, #ec6a5e 60%, #d0483c); border: 0.5px solid #c14136; }
.tl-min   { background: radial-gradient(circle at 35% 30%, #ffe08a, #f5bf4f 60%, #d89c2a); border: 0.5px solid #c08e26; }
.tl-zoom  { background: radial-gradient(circle at 35% 30%, #a5e88a, #61c455 60%, #3e9c32); border: 0.5px solid #38872d; }

.window:not(.active) .tl { background: radial-gradient(circle at 35% 30%, #e8e8e8, #c8c8c8); border-color: #aaa; }

/* Finder-Toolbar */
.finder-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 7px;
  margin-top: 22px;
}

.nav-buttons { display: flex; }
.nav-btn {
  width: 30px;
  height: 21px;
  border: 1px solid #999;
  background: linear-gradient(#fdfdfd, #d8d8d8);
  font-size: 10px;
  color: #555;
  cursor: default;
}
.nav-btn:first-child { border-radius: 4px 0 0 4px; border-right: none; }
.nav-btn:last-child { border-radius: 0 4px 4px 0; }
.nav-btn:active { background: linear-gradient(#c8c8c8, #b0b0b0); }

.view-buttons { display: flex; }
.view-btn {
  width: 26px;
  height: 21px;
  border: 1px solid #999;
  border-right: none;
  background: linear-gradient(#fdfdfd, #d8d8d8);
  font-size: 11px;
  color: #444;
  cursor: default;
}
.view-btn:first-child { border-radius: 4px 0 0 4px; }
.view-btn:last-child { border-radius: 0 4px 4px 0; border-right: 1px solid #999; }
.view-btn.active { background: linear-gradient(#9a9a9a, #b8b8b8); color: #fff; }

.toolbar-spacer { flex: 1; }
.toolbar-label { font-size: 11.5px; color: #555; }

.search-field {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 140px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #a0a0a0;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.search-field input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 11px;
  background: transparent;
}

/* Finder-Inhalt */
.window-finder { height: 420px; }

.finder-content {
  flex: 1;
  display: flex;
  min-height: 0;
  border-top: 1px solid #8e8e8e;
}

.finder-sidebar {
  width: 150px;
  flex-shrink: 0;
  background: #dde3ea;
  border-right: 1px solid #b5b5b5;
  padding: 8px 0;
  overflow-y: auto;
  font-size: 11.5px;
}

.sidebar-group {
  padding: 8px 10px 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #6e7a8a;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  color: #222;
  cursor: default;
}
.sidebar-item .sb-icon { width: 16px; height: 16px; object-fit: contain; }
.sidebar-item.selected {
  background: linear-gradient(#7ba0d0, #5a82b8);
  color: #fff;
  font-weight: 600;
}

.finder-main {
  flex: 1;
  background: #fff;
  overflow-y: auto;
  padding: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 18px 10px;
}

.project-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: default;
}
.project-item:hover { background: #eef3fa; }
.project-folder { width: 56px; height: 56px; }
.project-name { font-size: 12px; font-weight: 600; color: #222; }
.project-desc { font-size: 10.5px; color: #888; line-height: 1.35; }

.finder-statusbar {
  flex-shrink: 0;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  color: #666;
  background: linear-gradient(#f0f0f0, #d8d8d8);
  border-top: 1px solid #a8a8a8;
}

/* ================= Über-mich-Fenster ================= */
.window-about .window-body {
  background: linear-gradient(#f2f2f2, #e4e4e4);
}

.about-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 24px 16px;
  text-align: center;
}

.about-avatar {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6a5acd, #b44fd0);
  box-shadow: 0 3px 8px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.5);
}

.about-name {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  text-shadow: 0 1px 0 #fff;
}

.about-version { font-size: 11.5px; color: #777; margin-top: -6px; }

.about-specs {
  width: 100%;
  margin: 6px 0;
  font-size: 11.5px;
  color: #333;
}
.spec-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 2.5px 0;
}
.spec-label { font-weight: 700; }

.about-footer {
  font-size: 9.5px;
  color: #999;
  line-height: 1.5;
  margin-top: 4px;
}

.hd-body {
  padding: 26px 20px;
  text-align: center;
  font-size: 12.5px;
  color: #444;
  line-height: 1.6;
  background: #fff;
}

/* Aqua-Buttons */
.aqua-button {
  padding: 4px 16px;
  border-radius: 999px;
  border: 1px solid #9a9a9a;
  background: linear-gradient(#ffffff, #e0e0e0 50%, #cfcfcf);
  font-family: inherit;
  font-size: 11.5px;
  color: #222;
  cursor: default;
  box-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
.aqua-button:active { background: linear-gradient(#c5d8f0, #9dbfe8); }
.aqua-primary {
  background: linear-gradient(#cfe2f8, #8db8ea 50%, #6da3e2);
  border-color: #5a8ec8;
}

/* ================= Vorschau (Lebenslauf) ================= */
.window-preview { height: 520px; }

.preview-content {
  flex: 1;
  overflow-y: auto;
  background: #7c7c7c;
  border-top: 1px solid #666;
  padding: 18px;
  display: flex;
  justify-content: center;
}

.cv-page {
  background: #fff;
  width: 100%;
  max-width: 460px;
  min-height: 620px;
  height: max-content;
  padding: 36px 40px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.5);
  font-family: "Helvetica Neue", Helvetica, sans-serif;
  color: #222;
}

.cv-header h1 { font-size: 21px; margin-bottom: 4px; }
.cv-header p { font-size: 11px; color: #777; }

.cv-page section { margin-top: 22px; }
.cv-page h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a6fa5;
  border-bottom: 1px solid #dcdcdc;
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.cv-entry { margin-bottom: 12px; }
.cv-entry-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 2px;
}
.cv-entry-head span { color: #999; font-size: 11px; }
.cv-entry p { font-size: 11.5px; color: #555; line-height: 1.5; }
.cv-skills { font-size: 11.5px; color: #555; }

/* ================= Mail-Fenster ================= */
.window-mail { height: 380px; }

.mail-fields {
  flex-shrink: 0;
  background: #f4f4f4;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #b5b5b5;
  padding: 6px 12px;
}

.mail-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #e2e2e2;
}
.mail-field:last-child { border-bottom: none; }
.mail-field span { font-size: 11.5px; color: #888; width: 48px; text-align: right; }
.mail-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: #222;
}

.mail-body {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 12px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: #222;
  background: #fff;
}

.mail-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  background: linear-gradient(#f0f0f0, #d8d8d8);
  border-top: 1px solid #b0b0b0;
}

/* ================= Dock ================= */
.dock-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  justify-content: center;
}

.dock-shelf {
  position: absolute;
  bottom: 0;
  left: -30px;
  right: -30px;
  height: 56px;
  background: linear-gradient(rgba(255,255,255,0.35), rgba(255,255,255,0.12) 40%, rgba(200,200,220,0.25));
  border-top: 1px solid rgba(255,255,255,0.55);
  clip-path: polygon(2.5% 0, 97.5% 0, 100% 100%, 0 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dock {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 12px 8px;
  height: 76px;
}

.dock-icon {
  position: relative;
  width: 48px;
  height: 48px;
  transform-origin: bottom center;
  transition: transform 0.08s linear;
  cursor: default;
}
.dock-icon svg,
.dock-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35));
  -webkit-box-reflect: below 2px linear-gradient(transparent 55%, rgba(255,255,255,0.25));
}

/* Hüpfen für Apps ohne Fenster */
@keyframes dock-bounce {
  0%, 100% { transform: translateY(0); }
  30%      { transform: translateY(-26px); }
  55%      { transform: translateY(0); }
  75%      { transform: translateY(-12px); }
}
.dock-icon.bouncing img,
.dock-icon.bouncing svg {
  animation: dock-bounce 0.7s ease-out 2;
}

/* Punkt-Indikator für offene Fenster */
.dock-icon.running::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #dff3ff, #62b0f0);
  box-shadow: 0 0 3px rgba(120,190,255,0.9);
}

/* Tooltip-Label */
.dock-icon::before {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 5px;
  background: rgba(30,30,30,0.85);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.dock-icon:hover::before { opacity: 1; }

.dock-divider {
  width: 1px;
  height: 52px;
  margin: 0 6px;
  align-self: flex-end;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.35), rgba(0,0,0,0));
}

/* ================= Fenster-Resize-Griff ================= */
.win-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 10;
  background:
    linear-gradient(135deg, transparent 0 6px, #9a9a9a 6px 7px, transparent 7px 9px, #9a9a9a 9px 10px, transparent 10px 12px, #9a9a9a 12px 13px, transparent 13px);
}
body.theme-tahoe .win-resize { background: none; } /* Tahoe: unsichtbar, aber greifbar */
