@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --font-mono: 'DM Mono', monospace;
  --font-mono-alt: 'JetBrains Mono', monospace;
  --font-ui: 'Outfit', sans-serif;
}

html, body {
  overflow: hidden;
  height: auto;
  width: auto;
  position: fixed;
  inset: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #7c3aed 100%);
  color: #f8fafc;
}

#desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.2), transparent 35%),
    linear-gradient(135deg, rgba(255,255,255,0.16), rgba(15, 23, 42, 0.24));
}

#top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 100;
}

.top-left,
.top-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 0.95rem;
}

button.top-pill {
  cursor: pointer;
  transition: transform 120ms ease;
}

button.top-pill:hover {
  transform: translateY(-1px);
}

#desktopApps {
  position: absolute;
  top: 78px;
  left: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  width: 280px;
}

#dock {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  z-index: 110;
}

.dock-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dock-minimized {
  min-width: 110px;
  max-width: 220px;
  overflow-x: auto;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  display: none;
  gap: 10px;
}

.dock-minimized.active {
  display: flex;
}

.app-switcher {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 240px;
  max-width: 320px;
  padding: 18px 22px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.95rem;
  backdrop-filter: blur(18px);
  z-index: 1200;
  display: grid;
  gap: 12px;
}

.app-switcher.hidden {
  display: none;
}

.app-switcher h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

.app-switcher-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 120ms ease;
}

.app-switcher-item.active {
  background: rgba(255, 255, 255, 0.14);
}

.app-switcher-item span {
  font-size: 1.4rem;
}

.app-switcher-item p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.dock-item {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.dock-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.26);
}

.dock-item.active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.3);
}

.app-icon {
  width: 88px;
  padding: 10px 8px;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.app-icon:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
}

.app-icon.selected {
  background: rgba(255, 255, 255, 0.24);
  outline: 1px solid rgba(255, 255, 255, 0.32);
}

.app-icon-emoji {
  font-size: 2rem;
  margin-bottom: 6px;
}

.app-icon p {
  margin: 0;
  font-size: 0.95rem;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 340px;
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  backdrop-filter: blur(18px);
  background: rgba(10, 14, 28, 0.72);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.window.active-window {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.windowheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.15);
  cursor: grab;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  touch-action: none;
}

.window.active-window .windowheader {
  background: rgba(255, 255, 255, 0.18);
}

.window-controls {
  display: flex;
  gap: 7px;
  align-items: center;
}

.closebutton,
.minbutton,
.maxbutton {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  touch-action: manipulation;
}

.closebutton {
  background: #ff6b6b;
}

.minbutton {
  background: #ffd166;
}

.maxbutton {
  background: #06d6a0;
}

.window.maximized {
  position: absolute;
  top: 62px;
  left: 0;
  width: 100%;
  height: calc(100% - 62px);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  z-index: 1000;
  transform: none;
  transition: none;
}

.window.maximized .windowheader {
  background: rgba(255, 255, 255, 0.16);
}

.window-header {
    touch-action: none;
}


.headertext {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.spacer {
  width: 44px;
}

.window-content {
  padding: 20px;
  flex: 1;
}

.welcome-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-mono-alt);
}

.welcome-card h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.welcome-card p {
  margin: 0;
  line-height: 1.7;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.24);
  color: #dbeafe;
  font-size: 0.9rem;
}

.welcome-card a {
  align-self: flex-start;
  margin-top: 6px;
  color: #93c5fd;
  text-decoration: none;
}

.notes-app {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
}

.notes-sidebar {
  width: 150px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-item {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 120ms ease;
  font-size: 0.8rem;
  line-height: 1.5;
}

.notes-item:hover {
  background: rgba(255, 255, 255, 0.16);
}

.notes-item strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.notes-panel {
  flex: 1;
  min-width: 240px;
  padding: 10px 4px;
}

.notes-date {
  color: #cbd5e1;
  font-size: 0.8rem;
  margin-top: -6px;
}

.notes-body {
  line-height: 1.8;
  color: #f8fafc;
  font-size: 0.9rem;
}

.notes-body p {
  margin: 0 0 10px;
}

.welcome-card ul {
  margin: 0;
  padding-left: 18px;
}

.welcome-card li {
  margin: 6px 0;
}

.window-header {
    touch-action: none;
}

/* Wallpaper Picker */
.wallpaper-picker { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.wallpaper-picker.hidden { display: none; }
.wallpaper-picker-content { background: rgba(15,23,42,0.95); border: 1px solid rgba(255,255,255,0.18); border-radius: 20px; padding: 24px; min-width: 400px; }
.wallpaper-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0; }
.wallpaper-thumb { aspect-ratio: 16/10; border-radius: 12px; border: 2px solid transparent; cursor: pointer; transition: transform 120ms, border-color 120ms; }
.wallpaper-thumb:hover { transform: scale(1.05); border-color: #818cf8; }
.wallpaper-thumb.active { border-color: #06d6a0; }

/* Settings */
.settings-app { display: flex; height: 100%; }
.settings-nav { width: 160px; padding: 16px; border-right: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 8px; }
.settings-nav-btn { padding: 10px 12px; border-radius: 8px; background: transparent; border: none; color: #e2e8f0; text-align: left; cursor: pointer; font-size: 0.9rem; }
.settings-nav-btn:hover { background: rgba(255,255,255,0.1); }
.settings-nav-btn.active { background: rgba(129,140,248,0.3); }
.settings-panel { flex: 1; padding: 24px; overflow-y: auto; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.setting-row select { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 8px 12px; color: #fff; }

/* Explorer */
.explorer-app { height: 100%; display: flex; flex-direction: column; }
.explorer-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.path-display { flex: 1; font-family: monospace; font-size: 0.85rem; opacity: 0.8; }
.toolbar-btn { padding: 6px 12px; border-radius: 6px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; cursor: pointer; font-size: 1rem; }
.toolbar-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.explorer-grid { flex: 1; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.file-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.06); cursor: pointer; transition: background 120ms; }
.file-item:hover { background: rgba(255,255,255,0.14); }
.file-icon { font-size: 2rem; }
.file-name { font-size: 0.85rem; text-align: center; word-break: break-word; max-width: 100%; }

/* Toasts */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; background: rgba(15,23,42,0.95); border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 10px 30px rgba(0,0,0,0.3); transform: translateX(120%); opacity: 0; transition: all 0.3s ease; min-width: 280px; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-left: 4px solid #06d6a0; }
.toast-error { border-left: 4px solid #ff6b6b; }
.toast-warning { border-left: 4px solid #ffd166; }
.toast-close { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 2px; }

/* Shortcuts Overlay */
.shortcuts-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.shortcuts-modal { background: rgba(15,23,42,0.95); border: 1px solid rgba(255,255,255,0.18); border-radius: 20px; padding: 32px; min-width: 400px; max-width: 90vw; }
.shortcuts-list { display: grid; gap: 12px; margin-top: 16px; }
.shortcut-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.shortcut-row kbd { background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 6px; font-family: monospace; font-size: 0.85rem; }

@media (max-width: 600px) {
  .window {
    min-width: 90vw;
    min-height: 60vh;
  }
  #desktopApps {
    width: auto;
  }
}

/* Background Picker */
.bg-picker-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.bg-thumb { aspect-ratio: 16/10; border-radius: 8px; background-size: cover; background-position: center; cursor: pointer; border: 2px solid transparent; transition: border-color 120ms, transform 120ms; }
.bg-thumb:hover { transform: scale(1.05); border-color: #818cf8; }
.bg-thumb.active { border-color: #06d6a0; }

.setting-row select { background : rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 8px 12px; color: #fff; font-family: var(--font-ui); min-width: 180px;}