/* ===== Grundlayout & Design-Tokens ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Höhe der Taskleiste (von Snap/Maximieren respektiert) */
  --taskbar-height: 54px;

  /* Theme-Tokens (dunkel = Standard; hell via [data-theme='light']) */
  --bg: #05060f;
  --text: #f2f4ff;
  --text-dim: rgba(242, 244, 255, 0.6);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(15, 17, 31, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --hover: rgba(255, 255, 255, 0.08);
  --hover-strong: rgba(255, 255, 255, 0.14);
  --input-bg: rgba(0, 0, 0, 0.28);

  /* Akzent (per Einstellungen wechselbar — RGB-Varianten für Schatten/Flächen) */
  --accent1: #8b5cf6;
  --accent2: #22d3ee;
  --accent1-rgb: 139, 92, 246;
  --accent2-rgb: 34, 211, 238;
  --accent-grad: linear-gradient(135deg, var(--accent1), var(--accent2));

  /* Wallpaper: Aurora-Nebelfarben + Grundton (per Einstellungen wechselbar) */
  --blob1: #4338ca;
  --blob2: #0e7490;
  --blob3: #a21caf;
  --blob4: #1d4ed8;
  --desktop-bg: #0d1030;
}

/* Helles Theme */
:root[data-theme='light'] {
  --bg: #e9edf6;
  --text: #1b1e2e;
  --text-dim: rgba(27, 30, 46, 0.62);
  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(248, 250, 255, 0.82);
  --border: rgba(25, 30, 60, 0.14);
  --hover: rgba(25, 30, 60, 0.07);
  --hover-strong: rgba(25, 30, 60, 0.13);
  --input-bg: rgba(25, 30, 60, 0.08);
}

[data-theme='light'] #desktop {
  background: radial-gradient(ellipse 120% 90% at 50% 110%, #fdfeff 0%, var(--bg) 60%);
}

[data-theme='light'] .aurora span {
  opacity: 0.35;
}

[data-theme='light'] .desktop-icon .label {
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

[data-theme='light'] #desktop-clock .time {
  text-shadow: 0 4px 24px rgba(255, 255, 255, 0.5);
}

/* Wallpaper-Presets (Klasse auf #desktop) */
#desktop.wp-ocean { --blob1: #0e7490; --blob2: #2563eb; --blob3: #06b6d4; --blob4: #1e40af; --desktop-bg: #071a2e; }
#desktop.wp-sunset { --blob1: #be185d; --blob2: #ea580c; --blob3: #9d174d; --blob4: #f59e0b; --desktop-bg: #2a0f1e; }
#desktop.wp-forest { --blob1: #15803d; --blob2: #365314; --blob3: #0d9488; --blob4: #4d7c0f; --desktop-bg: #0a1f14; }
#desktop.wp-graphite { --blob1: #334155; --blob2: #475569; --blob3: #1e293b; --blob4: #52525b; --desktop-bg: #0b0f17; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  user-select: none;
  background: var(--bg);
}

button {
  font-family: inherit;
}

/* ===== Bootscreen ===== */
#boot-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #05060f;
  z-index: 99999;
  transition: opacity 0.6s ease;
}

.boot-brand {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  box-shadow: 0 0 70px rgba(var(--accent1-rgb), 0.45), 0 0 24px rgba(var(--accent2-rgb), 0.3);
}

#boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  font-size: 52px;
  font-weight: 200;
  letter-spacing: 6px;
  background: linear-gradient(110deg, #6d7cff 20%, #22d3ee 40%, #c084fc 60%, #6d7cff 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: boot-shimmer 2.6s linear infinite;
}

@keyframes boot-shimmer {
  to { background-position: -250% 0; }
}

.boot-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: #b7c3ff;
  border-radius: 50%;
  animation: boot-spin 0.9s linear infinite;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

/* ===== Desktop mit Aurora-Hintergrund ===== */
#desktop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 110%, var(--desktop-bg) 0%, var(--bg) 60%);
  overflow: hidden;
}

.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.55;
  mix-blend-mode: screen;
}

.aurora span:nth-child(1) {
  width: 55vw;
  height: 55vw;
  left: -12vw;
  top: -18vw;
  background: radial-gradient(circle, var(--blob1) 0%, transparent 65%);
  animation: drift1 34s ease-in-out infinite alternate;
}

.aurora span:nth-child(2) {
  width: 48vw;
  height: 48vw;
  right: -14vw;
  top: -8vw;
  background: radial-gradient(circle, var(--blob2) 0%, transparent 65%);
  animation: drift2 28s ease-in-out infinite alternate;
}

.aurora span:nth-child(3) {
  width: 46vw;
  height: 46vw;
  left: 18vw;
  bottom: -20vw;
  background: radial-gradient(circle, var(--blob3) 0%, transparent 65%);
  animation: drift3 40s ease-in-out infinite alternate;
}

.aurora span:nth-child(4) {
  width: 34vw;
  height: 34vw;
  right: 8vw;
  bottom: -8vw;
  background: radial-gradient(circle, var(--blob4) 0%, transparent 65%);
  animation: drift1 24s ease-in-out infinite alternate-reverse;
}

@keyframes drift1 {
  to { transform: translate(9vw, 7vh) scale(1.15); }
}

@keyframes drift2 {
  to { transform: translate(-8vw, 9vh) scale(0.9); }
}

@keyframes drift3 {
  to { transform: translate(6vw, -8vh) scale(1.1); }
}

/* ===== Desktop-Uhr ===== */
#desktop-clock {
  position: absolute;
  top: 9vh;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}

#desktop-clock .time {
  font-size: clamp(56px, 9vw, 110px);
  font-weight: 200;
  letter-spacing: 3px;
  line-height: 1.05;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.45);
}

#desktop-clock .date {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ===== Desktop-Icons (frei verschiebbar im Raster) ===== */
#desktop-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.desktop-icon {
  position: absolute;
  width: 92px;
  height: 104px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 12px;
  transition: left 0.18s cubic-bezier(0.22, 1, 0.36, 1), top 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.desktop-icon.dragging {
  transition: none;
  z-index: 99;
  opacity: 0.85;
}

.desktop-icon.dragging .tile {
  transform: scale(1.08);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

/* Gummiband-Auswahl */
#selection-rect {
  position: fixed;
  border: 1px solid rgba(var(--accent1-rgb), 0.8);
  background: rgba(var(--accent1-rgb), 0.15);
  border-radius: 3px;
  z-index: 50;
  pointer-events: none;
}

.desktop-icon .tile {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s;
}

.desktop-icon:hover .tile {
  transform: translateY(-4px) scale(1.06);
  background: var(--hover-strong);
}

.desktop-icon.selected .tile {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(var(--accent2-rgb), 0.35), 0 6px 24px rgba(0, 0, 0, 0.25);
}

.desktop-icon .label {
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ===== Taskleiste ===== */
#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.6);
  border-top: 1px solid var(--border);
  z-index: 10000;
}

#start-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(var(--accent1-rgb), 0.45);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
}

#start-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#start-button:hover,
#start-button.active {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(var(--accent1-rgb), 0.65);
}

.tb-sep {
  width: 1px;
  height: 30px;
  background: var(--hover-strong);
}

#taskbar-apps {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.tb-app {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  background: transparent;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.16s;
}

.tb-app:hover {
  transform: translateY(-3px);
  background: var(--hover);
}

/* Tooltip über dem Icon */
.tb-app::before {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  padding: 5px 12px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.tb-app:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Laufindikator */
.tb-app::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

.tb-app.running::after {
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2);
}

.tb-app.focused-app {
  background: var(--hover);
}

#taskbar-clock {
  padding: 4px 14px;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
  color: var(--text-dim);
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
}

#taskbar-clock:hover {
  background: var(--hover);
}

#taskbar-clock:hover {
  background: var(--hover);
}

#taskbar-clock b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

/* ===== Startmenü (Glas-Panel) ===== */
#start-menu {
  position: fixed;
  left: 10px;
  bottom: calc(var(--taskbar-height) + 10px);
  width: 480px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - var(--taskbar-height) - 30px);
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--glass-strong);
  backdrop-filter: blur(36px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  z-index: 10001;
  transform-origin: bottom left;
  animation: start-pop 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

#start-menu.hidden {
  display: none;
}

@keyframes start-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.95);
  }
}

.start-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px;
  margin-bottom: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.start-search:focus-within {
  border-color: rgba(var(--accent1-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--accent1-rgb), 0.18);
}

.start-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.start-search input::placeholder {
  color: var(--text-dim);
}

.start-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 4px 4px 10px;
}

.start-section-label.recents-label {
  margin-top: 18px;
}

.start-section-label.hidden {
  display: none;
}

#start-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  overflow-y: auto;
}

.start-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 10px;
  background: transparent;
  border: none;
  border-radius: 14px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.start-app:hover {
  background: var(--hover);
}

.start-app .tile {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.start-app:hover .tile {
  transform: scale(1.1);
}

.start-no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 16px;
}

#start-recents {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.start-recent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.start-recent:hover {
  background: var(--hover-strong);
  transform: translateY(-2px);
}

.start-recent .sub {
  color: var(--text-dim);
  font-size: 11px;
}

/* ===== Kontextmenü ===== */
.context-menu {
  position: fixed;
  min-width: 210px;
  padding: 6px;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  z-index: 20000;
  animation: ctx-pop 0.14s ease;
}

@keyframes ctx-pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

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

.context-menu-item:hover:not(.disabled) {
  background: var(--hover);
}

.context-menu-item.disabled {
  opacity: 0.4;
  cursor: default;
}

.context-menu-item .icon {
  width: 18px;
  font-size: 14px;
  text-align: center;
}

.context-menu-separator {
  height: 1px;
  margin: 5px 8px;
  background: var(--hover-strong);
}

/* ===== Snap: Vorschau & Layout-Flyout ===== */
#snap-preview {
  position: fixed;
  display: none;
  background: rgba(var(--accent1-rgb), 0.16);
  border: 1.5px solid rgba(var(--accent1-rgb), 0.65);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(var(--accent1-rgb), 0.25) inset;
  transition: left 0.13s ease, top 0.13s ease, width 0.13s ease, height 0.13s ease;
  pointer-events: none;
}

.snap-flyout {
  position: absolute;
  top: 38px;
  right: 6px;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  z-index: 50;
}

.snap-flyout.visible {
  display: grid;
}

.snap-layout {
  position: relative;
  width: 96px;
  height: 54px;
}

.snap-zone {
  position: absolute;
  background: var(--hover-strong);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  cursor: pointer;
  transform: scale(0.93);
}

.snap-zone:hover {
  background: var(--accent1);
  border-color: var(--accent1);
  box-shadow: 0 0 12px rgba(var(--accent1-rgb), 0.6);
}

/* ===== Fenster ===== */
.window {
  position: absolute;
  min-width: 280px;
  min-height: 160px;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: window-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(14px);
  }
}

.window.focused {
  border-color: rgba(var(--accent1-rgb), 0.55);
  box-shadow:
    0 0 0 1px rgba(var(--accent1-rgb), 0.25),
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 8px 50px rgba(var(--accent1-rgb), 0.18);
}

.window.minimized {
  display: none;
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 8px 0 16px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
  cursor: grab;
  flex-shrink: 0;
}

.window-titlebar:active {
  cursor: grabbing;
}

.window-titlebar .icon {
  font-size: 16px;
}

.window-titlebar .title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.window-controls button {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hover);
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.window-controls button:hover {
  background: var(--hover-strong);
  color: var(--text);
}

.window-controls .btn-close:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
}

.window-content {
  flex: 1;
  overflow: auto;
  padding: 14px;
  user-select: text;
}

.window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
}

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

/* ===== Dialoge ===== */
.dialog-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 15, 0.5);
  backdrop-filter: blur(6px);
  z-index: 30000;
  animation: launcher-fade 0.18s ease;
}

@keyframes launcher-fade {
  from { opacity: 0; }
}

.dialog {
  width: min(400px, 90vw);
  padding: 22px;
  background: var(--glass-strong);
  backdrop-filter: blur(36px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: ctx-pop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.dialog-message {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
  word-break: break-word;
}

.dialog-input {
  width: 100%;
  height: 38px;
  margin-top: 12px;
  padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.dialog-input:focus {
  border-color: rgba(var(--accent1-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--accent1-rgb), 0.18);
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.dialog-buttons button {
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s, background 0.13s;
}

.dialog-cancel {
  background: var(--glass);
  border: 1px solid var(--border) !important;
  color: var(--text);
}

.dialog-cancel:hover {
  background: var(--hover-strong);
}

.dialog-ok {
  background: var(--accent-grad);
  color: #fff;
}

.dialog-ok:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--accent1-rgb), 0.45);
}

.dialog-ok.danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.dialog-ok.danger:hover {
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.45);
}

/* ===== Kalender-Flyout ===== */
#calendar-popup {
  position: fixed;
  right: 10px;
  bottom: calc(var(--taskbar-height) + 10px);
  width: 300px;
  padding: 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(36px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  z-index: 10001;
  transform-origin: bottom right;
  animation: start-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

#calendar-popup.hidden {
  display: none;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title {
  font-size: 14px;
  font-weight: 600;
}

.cal-header button {
  width: 30px;
  height: 30px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.13s;
}

.cal-header button:hover {
  background: var(--hover-strong);
}

.cal-weekdays,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-weekdays div {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 4px 0 8px;
}

.cal-day {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  border-radius: 50%;
  cursor: default;
  transition: background 0.12s;
}

.cal-day:hover {
  background: var(--hover);
}

.cal-day.other-month {
  color: rgba(242, 244, 255, 0.28);
}

.cal-day.today {
  background: var(--accent-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(var(--accent1-rgb), 0.5);
}

/* ===== Login-Screen ===== */
#login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 60% at 30% 20%, rgba(67, 56, 202, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 75% 75%, rgba(162, 28, 175, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 110%, var(--desktop-bg) 0%, var(--bg) 60%);
  z-index: 50000;
}

#login-screen.hidden {
  display: none;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(360px, 90vw);
  padding: 40px 34px 34px;
  background: var(--glass-strong);
  backdrop-filter: blur(36px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  animation: launcher-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes launcher-pop {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
}

.login-logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(var(--accent1-rgb), 0.45);
}

.login-card h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.login-card form input {
  height: 42px;
  padding: 0 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.login-card form input:focus {
  border-color: rgba(var(--accent1-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--accent1-rgb), 0.18);
}

.login-error {
  font-size: 12.5px;
  color: #fb7185;
  text-align: center;
}

.login-error.hidden {
  display: none;
}

.login-card form button {
  height: 42px;
  margin-top: 4px;
  background: var(--accent-grad);
  border: none;
  border-radius: 11px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.login-card form button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--accent1-rgb), 0.5);
}

.login-card form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ===== Startmenü-Fußzeile (Nutzer + Abmelden) ===== */
.start-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.start-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.start-user .avatar {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-grad);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

#logout-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}

#logout-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

/* Ladezustand, während ein App-Modul geladen wird */
.app-loading::after {
  content: 'Wird geladen …';
  display: block;
  padding: 20px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

/* ===== Scrollbalken (systemweit, passend zum Glas-Design) ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--hover-strong);
  border-radius: 5px;
  /* schmaler Rand, damit der Balken "schwebt" */
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent1-rgb), 0.55);
  background-clip: padding-box;
  border: 2px solid transparent;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox (kennt ::-webkit-scrollbar nicht) */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--hover-strong) transparent;
  }
}

/* Sekundär-Button + Formular-Umschaltung im Login */
#login-screen form.hidden {
  display: none;
}

.login-secondary {
  height: 40px;
  background: var(--glass) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  font-weight: 500 !important;
}

.login-secondary:hover {
  background: var(--hover-strong) !important;
  box-shadow: none !important;
}

/* Zurück-Link im Login-Formular */
.login-back {
  height: auto !important;
  padding: 4px !important;
  background: transparent !important;
  border: none !important;
  color: var(--text-dim) !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
}

.login-back:hover {
  color: var(--text) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Taskleisten-Icons anordnen (Halten + Ziehen) */
.tb-app.tb-dragging {
  transition: none;
  z-index: 20;
  background: var(--hover-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  cursor: grabbing;
}

/* Während des Sortierens keine Hover-Effekte auf den anderen Icons */
#taskbar-apps.reordering .tb-app:not(.tb-dragging):hover {
  transform: none;
  background: transparent;
}
