/* Eigenständiges Desktop-Portfolio-UI — Platzhalter-Stil, wird später final gestaltet. */

:root {
  --font-main: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --color-wallpaper-1: #f6f3ee;
  --color-wallpaper-2: #ece7dd;
  --color-menubar: rgba(255, 255, 255, 0.85);
  --color-window: #faf8f5;
  --color-window-border: rgba(0, 0, 0, 0.08);
  --color-text: #1f1e24;
  --color-text-muted: #6b6874;
  --color-accent: #d1603d;
  --color-accent-soft: #d1603d22;
  --color-sidebar: #f0eeea;

  --radius-window: 12px;
  --radius-icon: 14px;
  --shadow-window: 0 20px 50px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  overflow: hidden;
  user-select: none;
}

#desktop {
  position: relative;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 20% 15%, var(--color-wallpaper-2), transparent 55%),
    linear-gradient(160deg, var(--color-wallpaper-1), var(--color-wallpaper-2));
  overflow: hidden;
}

/* ---------- Menüleiste ---------- */
#menubar {
  height: 30px;
  background: var(--color-menubar);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 13px;
  position: relative;
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.menubar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  height: 13px;
  width: auto;
  display: block;
}

.brand-name {
  font-weight: 600;
}

.menu-items {
  display: flex;
  gap: 16px;
  color: var(--color-text-muted);
}

.menubar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Desktop-Icons ---------- */
#icon-layer {
  position: absolute;
  inset: 30px 0 76px 0;
}

.icon-grid {
  position: relative;
  height: 100%;
}

.desktop-icon {
  background: transparent;
  border: none;
  width: 84px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: default;
}

.selection-box {
  position: fixed;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: 50;
}

.selection-box.hidden {
  display: none;
}

.desktop-icon.selected {
  background: rgba(255, 255, 255, 0.55);
}

.icon-glyph {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Dokument-Vorschau (z.B. CV) — echtes Seitenverhältnis statt Quadrat */
.icon-thumb {
  height: 46px;
  width: auto;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.6);
  object-fit: cover;
  background: #fff;
}

/* Live-Textvorschau (Über mich, Kontakt) — echter Inhalt in Miniatur, wie ein Dokument-Thumbnail */
.icon-doc {
  display: block;
  width: 36px;
  height: 46px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.6);
  overflow: hidden;
  padding: 3px;
}

.icon-doc-text {
  display: block;
  font-size: 3.1px;
  line-height: 1.4;
  color: #2a2a2a;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-main);
}

.icon-doc--dock {
  width: 22px;
  height: 28px;
  padding: 2px;
}

.icon-doc--dock .icon-doc-text {
  font-size: 1.9px;
}

/* Eigene, hochgeladene Icon-Grafiken (Ordner im Desktop) */
.icon-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.icon-img--dock {
  width: 28px;
  height: 28px;
  filter: none;
}

.icon-label {
  color: var(--color-text);
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  line-height: 1.2;
}

/* ---------- Fenster ---------- */
.window {
  position: absolute;
  background: var(--color-window);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  border: 1px solid var(--color-window-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 320px;
  min-height: 220px;
}

.window.minimized {
  display: none;
}

.window.maximized {
  left: 12px !important;
  top: 40px !important;
  width: calc(100vw - 24px) !important;
  height: calc(100vh - 130px) !important;
}

.win-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 5;
  background: linear-gradient(
    135deg,
    transparent 0 40%,
    rgba(0, 0, 0, 0.18) 40% 46%,
    transparent 46% 58%,
    rgba(0, 0, 0, 0.18) 58% 64%,
    transparent 64% 100%
  );
}

.window.maximized .win-resize-handle {
  display: none;
}

.win-titlebar {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: linear-gradient(#fdfcfb, #f2f0ec);
  border-bottom: 1px solid var(--color-window-border);
  cursor: grab;
  flex-shrink: 0;
}

.win-title {
  order: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.win-controls {
  order: 2;
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.win-btn {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-btn:hover {
  background: var(--color-accent);
  color: #fff;
}

.win-close::after { content: "\2715"; }
.win-min::after { content: "\2013"; }
.win-max::after { content: "\29C9"; }

.win-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.win-body--plain .win-content {
  padding: 20px;
  overflow: auto;
}

.win-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-window-border);
  flex-shrink: 0;
}

.win-view-toggle {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  padding: 2px;
}

.view-btn {
  border: none;
  background: transparent;
  width: 26px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
}

.view-btn.active {
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.win-search {
  margin-left: auto;
  border: 1px solid var(--color-window-border);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  width: 140px;
  font-family: var(--font-main);
}

.win-sidebar {
  width: 150px;
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-window-border);
  padding: 12px 8px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 4px 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-text);
}

.sidebar-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-item.active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

.sidebar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.win-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

/* Icon-Ansicht */
.win-content.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 96px);
  gap: 14px;
  align-content: start;
}

.project-tile {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-main);
}

.project-tile:hover,
.project-tile.selected {
  background: var(--color-accent-soft);
}

.tile-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.tile-thumb-img {
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.tile-name {
  font-size: 12px;
  text-align: center;
  color: var(--color-text);
}

/* Listen-Ansicht */
.win-content.view-list {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.list-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 7px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  cursor: pointer;
  font-family: var(--font-main);
  color: var(--color-text);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.list-header {
  color: var(--color-text-muted);
  font-weight: 600;
  cursor: default;
  border-bottom: 1px solid var(--color-window-border);
}

.list-row:not(.list-header):hover,
.list-row.selected {
  background: var(--color-accent-soft);
}

/* Text-/Kontakt-/Leer-Fenster */
.text-doc {
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

.contact-card h3 {
  margin: 0;
  font-size: 15px;
}

.contact-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 13px;
  margin-top: 12px;
}

.contact-card dt {
  color: var(--color-text-muted);
}

.contact-card a {
  color: var(--color-accent);
}

.cv-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.cv-preview-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.cv-open-link {
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.cv-open-link:hover {
  text-decoration: underline;
}

/* ---------- Dock ---------- */
#dock {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 900;
}

.dock-inner {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 8px 12px;
}

.dock-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-icon:hover {
  transform: translateY(-6px) scale(1.05);
}

.dock-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(30, 28, 26, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dock-icon:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Bild-Viewer (Filmstrip) ---------- */
.quicklook-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 16, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.quicklook-overlay.visible {
  opacity: 1;
}

.quicklook-overlay.hidden {
  display: none;
}

.quicklook-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 90vw;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease;
}

.quicklook-title {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.quicklook-frame {
  position: relative;
  background: #fff;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.quicklook-image {
  width: min(80vw, 900px);
  height: min(74vh, 650px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.22);
  transition: opacity 0.15s ease;
  overflow: hidden;
}

.quicklook-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 5;
  background: linear-gradient(
    135deg,
    transparent 0 40%,
    rgba(0, 0, 0, 0.18) 40% 46%,
    transparent 46% 58%,
    rgba(0, 0, 0, 0.18) 58% 64%,
    transparent 64% 100%
  );
}

.quicklook-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.quicklook-filmstrip {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px;
  border-radius: 12px;
  max-width: 90vw;
  overflow-x: auto;
}

.filmstrip-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
  overflow: hidden;
  padding: 0;
}

.filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.filmstrip-thumb:hover {
  opacity: 0.9;
}

.filmstrip-thumb.active {
  border-color: #fff;
  opacity: 1;
}

.quicklook-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  z-index: 1;
}

/* ---------- Willkommens-Hinweis ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.welcome-overlay.visible {
  opacity: 1;
}

.welcome-overlay.hidden {
  display: none;
}

.welcome-card {
  width: min(400px, 88vw);
  background: var(--color-window);
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  padding: 28px 26px 24px;
  text-align: center;
}

.welcome-card h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.welcome-card p {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.welcome-ok {
  border: none;
  background: #5ba9e0;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-main);
}

.welcome-ok:hover {
  filter: brightness(1.08);
}

/* ---------- Mobile Ansicht ---------- */
.mobile-view {
  display: none;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: var(--color-menubar);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.mobile-brand-mark {
  height: 16px;
  width: auto;
}

.mobile-brand-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

.mobile-list {
  padding: 12px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-main);
}

.mobile-row-icon-wrap {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-row-icon-wrap .icon-img,
.mobile-row-icon-wrap .icon-doc,
.mobile-row-icon-wrap .icon-thumb {
  width: 100%;
  height: 100%;
}

.mobile-row-label {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text);
}

.mobile-row-chevron {
  color: var(--color-text-muted);
  font-size: 16px;
  transition: transform 0.15s ease;
}

.mobile-row.expanded .mobile-row-chevron {
  transform: rotate(90deg);
}

.mobile-projects {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 2px 4px 6px 18px;
}

.mobile-projects.open {
  display: flex;
}

.mobile-project-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-main);
}

.mobile-project-thumb {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}

.mobile-project-name {
  font-size: 13.5px;
  color: var(--color-text);
}

.mobile-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: var(--color-window);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.mobile-sheet-overlay.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-sheet-overlay.hidden {
  display: none;
}

.mobile-sheet {
  position: relative;
  height: 100%;
  padding: 64px 22px 30px;
  overflow-y: auto;
}

.mobile-sheet h2 {
  margin: 0 0 18px;
  font-size: 18px;
}

.mobile-sheet-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  font-size: 14px;
  cursor: pointer;
}

.legal-links {
  position: fixed;
  left: 14px;
  bottom: 10px;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legal-link {
  background: none;
  border: none;
  padding: 3px 4px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  font-family: var(--font-main);
}

.legal-link:hover {
  color: rgba(0, 0, 0, 0.7);
  text-decoration: underline;
}

.legal-sep {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  #desktop {
    display: none;
  }

  .mobile-view {
    display: block;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--color-wallpaper-1), var(--color-wallpaper-2));
  }

  .quicklook-image {
    width: min(92vw, 900px);
    height: min(58vh, 650px);
  }

  .quicklook-resize-handle {
    display: none;
  }

  .legal-link {
    font-size: 12px;
    padding: 5px 4px;
  }
}
