/* ================= macOS Tahoe Desktop (nach dem "Software Update") ================= */

#desktop-tahoe {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: none;
  overflow: hidden;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

body.theme-tahoe #desktop-tahoe { display: block; }
body.theme-tahoe #desktop { display: none; }

/* ---------- Menüleiste: transluzent über dem Wallpaper ---------- */
.t-menubar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  background: rgba(30, 40, 70, 0.22);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

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

.t-item {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  cursor: default;
  border-radius: 5px;
}
.t-left .t-item:hover { background: rgba(255,255,255,0.18); }
.t-appname { font-weight: 700; }
#tahoe-clock { font-variant-numeric: tabular-nums; }

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

.t-icon {
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
}
.t-icon img { width: 56px; height: 56px; object-fit: contain; }
.t-icon span {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.65);
  padding: 1px 7px;
  border-radius: 6px;
  line-height: 1.3;
}
.t-icon.selected span { background: #2668d9; text-shadow: none; }
.t-icon.selected img { filter: brightness(0.75); }

/* ---------- Dock: schwebende Glasleiste ---------- */
.t-dock-wrap {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
}

.t-dock {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.30);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 12px 34px rgba(10, 20, 50, 0.35), inset 0 1px 1px rgba(255,255,255,0.5);
}

/* Overrides gegenüber dem Snow-Leopard-Dock (gleiche .dock-icon-Klasse) */
.t-dock .dock-icon {
  width: 50px;
  height: 50px;
}
.t-dock .dock-icon img,
.t-dock .dock-icon svg {
  -webkit-box-reflect: none;
  filter: drop-shadow(0 2px 4px rgba(10,20,50,0.25));
}
.t-dock .dock-icon.running::after {
  bottom: -6px;
  background: rgba(20, 25, 40, 0.75);
  box-shadow: none;
}
.t-dock .dock-icon::before {
  bottom: calc(100% + 16px);
  background: rgba(245,245,247,0.92);
  color: #1d1d1f;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.t-divider {
  width: 1px;
  height: 46px;
  margin: 0 4px;
  align-self: center;
  background: rgba(60, 70, 100, 0.28);
}

/* ---------- Fenster im Tahoe-Look (Overrides) ---------- */
body.theme-tahoe .window {
  border-radius: 11px;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
  box-shadow: 0 22px 68px rgba(10, 15, 35, 0.45), 0 0 0 1px rgba(0,0,0,0.12);
  background: #f5f5f7;
}

body.theme-tahoe .titlebar,
body.theme-tahoe .window:not(.active) .titlebar {
  background: #f5f5f7;
  border-bottom: 1px solid #e0e0e2;
}
body.theme-tahoe .titlebar-title {
  font-weight: 600;
  color: #3a3a3c;
  text-shadow: none;
}

/* Flache, moderne Ampeln */
body.theme-tahoe .tl { box-shadow: none; border: none; width: 12px; height: 12px; }
body.theme-tahoe .tl::after { display: none; }
body.theme-tahoe .tl-close { background: #ff5f57; }
body.theme-tahoe .tl-min   { background: #febc2e; }
body.theme-tahoe .tl-zoom  { background: #28c840; }
body.theme-tahoe .window:not(.active) .tl { background: #d5d5d7; }

body.theme-tahoe .finder-sidebar {
  background: #eef0f4;
  border-right: 1px solid #e0e0e2;
}

/* Moderne Seitenleisten-Symbole (SF-Symbol-Stil) statt der Snow-Leopard-Icons */
body.theme-tahoe .sb-icon[src*="SidebarInternalDisk"]   { content: url("../assets/tahoe/sb/disk.svg"); }
body.theme-tahoe .sb-icon[src*="SidebariMac"]           { content: url("../assets/tahoe/sb/imac.svg"); }
body.theme-tahoe .sb-icon[src*="SidebarDesktopFolder"]  { content: url("../assets/tahoe/sb/desktop.svg"); }
body.theme-tahoe .sb-icon[src*="SidebarHomeFolder"]     { content: url("../assets/tahoe/sb/home.svg"); }
body.theme-tahoe .sb-icon[src*="SidebarGenericFolder"]  { content: url("../assets/tahoe/sb/folder.svg"); }
body.theme-tahoe .sb-icon[src*="SidebarDocumentsFolder"]{ content: url("../assets/tahoe/sb/documents.svg"); }
body.theme-tahoe .sb-icon[src*="SidebarSmartFolder"]    { content: url("../assets/tahoe/sb/clock.svg"); }
body.theme-tahoe .sidebar-item .sb-icon { width: 16px; height: 16px; }
/* Ausgewählter Eintrag: weißes Symbol auf Blau */
body.theme-tahoe .sidebar-item.selected .sb-icon { filter: brightness(0) invert(1); }

/* Ordner im Fensterinhalt: moderner blauer macOS-Ordner */
body.theme-tahoe .project-folder { content: url("../assets/icons/FolderMacOS.png"); }

/* Sidebar-Schrift moderner */
body.theme-tahoe .sidebar-group { color: #86868b; }
body.theme-tahoe .sidebar-item { padding: 4px 10px; }
body.theme-tahoe .sidebar-item.selected {
  background: #2668d9;
  border-radius: 6px;
  margin: 0 5px;
  padding-left: 5px;
}
body.theme-tahoe .finder-content { border-top: 1px solid #e0e0e2; }
body.theme-tahoe .finder-statusbar,
body.theme-tahoe .mail-footer {
  background: #f5f5f7;
  border-top: 1px solid #e0e0e2;
}

body.theme-tahoe .aqua-button {
  border-radius: 7px;
  border: 1px solid #d5d5d7;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  padding: 5px 14px;
}
body.theme-tahoe .aqua-primary {
  background: #0a70f5;
  border-color: #0a70f5;
  color: #fff;
}

body.theme-tahoe .nav-btn,
body.theme-tahoe .view-btn {
  border-radius: 6px;
  border: 1px solid #d5d5d7;
  background: #fff;
}
body.theme-tahoe .view-btn.active { background: #d9d9de; color: #333; }
body.theme-tahoe .search-field { box-shadow: none; border-color: #d5d5d7; }

/* ---------- Software-Update-Dialog (Snow-Leopard-Stil) ---------- */
.update-body {
  display: flex;
  gap: 16px;
  padding: 18px 18px 10px;
  background: #ececec;
}
.update-icon { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.update-text strong { font-size: 13px; color: #222; display: block; margin-bottom: 6px; }
.update-text p { font-size: 11.5px; color: #444; line-height: 1.5; }

.update-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 18px 16px;
  background: #ececec;
}

/* ---------- Boot-Overlay ---------- */
#boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.7s;
}
#boot-overlay.active { display: flex; }
#boot-overlay.fade { opacity: 0; pointer-events: none; }

.boot-inner {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 42px;
}
#boot-overlay.booting .boot-inner { display: flex; }

.boot-apple { width: 84px; height: 84px; color: #fff; }

.boot-bar {
  width: 190px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.22);
  overflow: hidden;
}
.boot-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: #fff;
}
#boot-overlay.booting .boot-bar span {
  animation: bootfill 3.4s ease-in-out forwards;
}
@keyframes bootfill { to { width: 100%; } }

/* ---------- Menüleisten-Dropdowns (Tahoe-Look) ---------- */
.t-item.has-menu { position: relative; }
.t-item.open { background: rgba(255, 255, 255, 0.25); }
.t-item.open .dropdown { display: block; }

.t-menubar .dropdown {
  top: calc(100% + 4px);
  border: none;
  border-radius: 10px;
  padding: 5px;
  background: rgba(248, 248, 250, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 14px 40px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(0,0,0,0.15);
  text-shadow: none;
}
.t-menubar .dd-item {
  border-radius: 6px;
  padding: 4px 12px;
  color: #1d1d1f;
}
.t-menubar .dd-item:hover { background: #2668d9; color: #fff; }

/* Eingebettet (index.html?embed=1, MacBook auf preview/macbook-3d.html): der
   Zurück-Pfeil im Dock führt hier zurück zum MacBook (js/tahoe.js). Der
   Snow-Leopard-Pfeil bleibt aus, in der Einbettung startet man in Tahoe. */
body.os-embed #back-to-landing { display: none !important; }

/* Mitteilung oben rechts (einmal pro Sitzung beim Betreten des Vollbilds) */
#os-note {
  position: fixed;
  top: 44px;
  right: 14px;
  z-index: 100000;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 340px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  font: 13px/1.35 -apple-system, "SF Pro Text", Inter, sans-serif;
  color: #1c1c1e;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  pointer-events: none;
}
#os-note.show { transform: translateX(0); opacity: 1; }
#os-note .os-note-icon {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Trovical", Georgia, serif;
  font-size: 22px;
}
#os-note .os-note-text b { display: block; font-weight: 600; margin-bottom: 1px; }
#os-note .os-note-text span { color: #3a3a3c; }

/* Sprechblasen beim ersten Betreten (js/tahoe.js): weiß, mit sauberer
   Pfeilspitze aus einem CSS-Dreieck. .os-tip-right zeigt nach rechts auf das
   Desktop-Icon „2008 Version", .os-tip-down nach unten auf den Dock-Pfeil. */
.os-tip {
  position: absolute;
  z-index: 30;
  padding: 10px 15px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  font: 500 13px/1.3 -apple-system, "SF Pro Text", Inter, sans-serif;
  color: #1c1c1e;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.os-tip::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}
.os-tip-right { transform: translate(10px, -50%); }
.os-tip-right::after {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: #fff;
  border-right: 0;
}
.os-tip-right.show { transform: translate(0, -50%); }
.os-tip-down { transform: translate(-50%, 10px); }
.os-tip-down::after {
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: #fff;
  border-bottom: 0;
}
.os-tip-down.show { transform: translate(-50%, 0); }
.os-tip.show { opacity: 1; pointer-events: auto; }
