/* ==========================================================================
   desktop.css - the classic desktop, its taskbar, and its windows.

   Windows 8 flattened Aero: the glass, the gradients and the rounded window
   corners all went away, leaving square borders and a flat, slightly
   translucent taskbar. That's what this reproduces.
   ========================================================================== */

#desktopscreen { z-index: 30; background: #0d2b3d; }

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 26% 22%, rgba(255, 255, 255, 0.1), transparent 60%),
    radial-gradient(ellipse 70% 60% at 82% 84%, rgba(0, 0, 0, 0.34), transparent 62%),
    linear-gradient(155deg, #17627e 0%, #0e3d54 46%, #08222f 100%);
}

/* A faint Windows flag motif watermarked into the wallpaper. */
.desktop-wallpaper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -58%);
  opacity: 0.07;
  background:
    linear-gradient(#fff, #fff) 0 0 / 160px 160px no-repeat,
    linear-gradient(#fff, #fff) 180px 0 / 160px 160px no-repeat,
    linear-gradient(#fff, #fff) 0 180px / 160px 160px no-repeat,
    linear-gradient(#fff, #fff) 180px 180px / 160px 160px no-repeat;
}

/* --------------------------------------------------------------------------
   DESKTOP ICONS
   -------------------------------------------------------------------------- */
.desktop-icons {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.desktop-icon {
  width: 84px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  transition: background-color 90ms linear;
}
.desktop-icon:hover { background: rgba(255, 255, 255, 0.17); outline: 1px solid rgba(255, 255, 255, 0.3); }
.desktop-icon.is-selected { background: rgba(60, 140, 220, 0.42); outline: 1px solid rgba(140, 200, 255, 0.7); }
.desktop-icon-glyph {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--tile-color, var(--accent));
}
.desktop-icon-glyph svg { width: 23px; height: 23px; }

/* --------------------------------------------------------------------------
   WINDOWS
   -------------------------------------------------------------------------- */
.desktop-windows { position: absolute; inset: 0 0 40px 0; z-index: 2; pointer-events: none; }

.window {
  position: absolute;
  min-width: 340px;
  min-height: 220px;
  background: #f0f0f0;
  color: #1a1a1a;
  border: 1px solid #6d6d6d;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  animation: window-open 180ms var(--ease-out) both;
}
@keyframes window-open {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
.window.is-closing { animation: window-close 140ms var(--ease-in) both; }
@keyframes window-close {
  to { opacity: 0; transform: scale(0.94); }
}
.window.is-minimized { display: none; }
.window.is-maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

/* Snapping and maximising ease into place; free dragging must not, or the
   window would lag behind the pointer. */
.window.is-snapped { transition: left 130ms var(--ease-out), top 130ms var(--ease-out),
                                 width 130ms var(--ease-out), height 130ms var(--ease-out); }

/* Aero Peek - Windows 8 kept this. Windows drop to glass outlines so you can
   read the desktop behind them. */
.desktop-windows.is-peeking .window {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: none;
  transition: background-color 140ms linear, box-shadow 140ms linear;
}
.desktop-windows.is-peeking .window > * { opacity: 0; transition: opacity 140ms linear; }

/* Translucent target shown while dragging toward a snap edge. */
.snap-preview {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: rgba(120, 190, 255, 0.26);
  border: 1px solid rgba(190, 225, 255, 0.85);
  animation: fade-in 110ms linear both;
}

.window-titlebar {
  flex: none;
  height: 30px;
  background: #fff;
  border-bottom: 1px solid #dcdcdc;
  display: flex;
  align-items: center;
  padding-left: 9px;
  gap: 8px;
  cursor: default;
}
.window.is-inactive .window-titlebar { background: #f6f6f6; color: #7a7a7a; }
.window-title { font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-titlebar svg { width: 14px; height: 14px; opacity: 0.7; flex: none; }

.window-controls { display: flex; height: 100%; }
.window-control {
  width: 42px;
  height: 100%;
  display: grid;
  place-items: center;
  color: #333;
  transition: background-color 90ms linear, color 90ms linear;
}
.window-control svg { width: 11px; height: 11px; }
.window-control:hover { background: #e2e2e2; }
.window-control.is-close:hover { background: #e81123; color: #fff; }

.window-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px;
  background: #fff;
  font-size: 13px;
  line-height: 1.55;
  color: #333;
  user-select: text;
}
.window-body h3 { font-size: 17px; font-weight: 600; margin-bottom: 9px; }
.window-body p { margin-bottom: 10px; }
.window-body code {
  font-family: Consolas, 'Cascadia Mono', monospace;
  background: #f2f2f2;
  padding: 1px 5px;
  font-size: 12px;
}

/* Resize grip, bottom-right. */
.window-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 15px;
  height: 15px;
  cursor: nwse-resize;
}

/* File-explorer-ish two pane body. */
.explorer { display: flex; height: 100%; }
.explorer-nav {
  width: 178px;
  flex: none;
  background: #f7f7f7;
  border-right: 1px solid #e2e2e2;
  padding: 10px 0;
}
.explorer-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 14px;
  font-size: 13px;
  text-align: left;
  color: #333;
}
.explorer-nav-item:hover { background: #e5f1fb; }
.explorer-nav-item.is-active { background: #cce8ff; }
.explorer-nav-item svg { width: 15px; height: 15px; opacity: 0.75; }
.explorer-main { flex: 1; padding: 14px 16px; overflow: auto; }
.explorer-files { display: flex; flex-wrap: wrap; gap: 10px; }
.explorer-file {
  width: 92px;
  padding: 9px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-align: center;
  color: #333;
}
.explorer-file:hover { background: #e5f1fb; }
.explorer-file svg { width: 30px; height: 30px; color: #d9a441; }

/* --------------------------------------------------------------------------
   TASKBAR
   -------------------------------------------------------------------------- */
.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  z-index: 5;
  background: rgba(24, 24, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: stretch;
}

.taskbar-start {
  width: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  transition: background-color 110ms linear;
}
.taskbar-start:hover { background: var(--accent); }
.taskbar-start svg { width: 21px; height: 21px; }

.taskbar-items { display: flex; align-items: stretch; flex: 1; min-width: 0; }

.taskbar-item {
  width: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
  transition: background-color 110ms linear;
}
.taskbar-item:hover { background: rgba(255, 255, 255, 0.15); }
.taskbar-item svg { width: 20px; height: 20px; }
/* Running indicator: the underline Windows used to mark open windows. */
.taskbar-item.is-running::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}
.taskbar-item.is-active { background: rgba(255, 255, 255, 0.22); }

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  flex: none;
}
.tray-icons { display: flex; align-items: center; gap: 11px; color: rgba(255, 255, 255, 0.88); }
.tray-icons svg { width: 16px; height: 16px; }

.tray-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 100%;
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  transition: background-color 110ms linear;
}
.tray-clock:hover { background: rgba(255, 255, 255, 0.15); }
.tray-time { font-variant-numeric: tabular-nums; }
.tray-date { font-size: 11px; opacity: 0.85; }

/* The thin "show desktop" sliver at the far right, still there in Windows 8.
   Hovering it triggers Aero Peek; clicking minimises everything. */
.show-desktop {
  width: 10px;
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  transition: background-color 110ms linear;
}
.show-desktop:hover { background: rgba(255, 255, 255, 0.2); }

/* --------------------------------------------------------------------------
   TASKBAR THUMBNAIL
   -------------------------------------------------------------------------- */
.task-thumb {
  position: fixed;
  z-index: 30;
  width: 190px;
  background: rgba(28, 28, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px;
  pointer-events: none;
  animation: fade-in 120ms linear both;
}
.task-thumb-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 12px;
  padding: 2px 2px 6px;
}
.task-thumb-head span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-thumb-body {
  height: 96px;
  background: linear-gradient(150deg, #f4f4f4, #cfcfcf);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   TRAY CALENDAR FLYOUT
   -------------------------------------------------------------------------- */
.tray-calendar {
  position: fixed;
  right: 6px;
  bottom: 46px;
  z-index: 30;
  width: 268px;
  padding: 16px;
  background: rgba(28, 28, 28, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  animation: tray-cal-in 150ms var(--ease-out) both;
}
@keyframes tray-cal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.cal-time {
  font-family: var(--font-light);
  font-weight: 200;
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cal-date { font-size: 13px; opacity: 0.75; margin: 4px 0 14px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-grid span {
  font-size: 12px;
  padding: 5px 0;
  font-variant-numeric: tabular-nums;
}
.cal-dow { opacity: 0.5; font-weight: 600; }
.cal-day { color: rgba(255, 255, 255, 0.86); }
.cal-day.is-today { background: var(--accent); color: #fff; font-weight: 600; }

/* --------------------------------------------------------------------------
   WINDOW BODY EXTRAS - This PC, Recycle Bin, Control Panel
   -------------------------------------------------------------------------- */
.drive { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.drive svg { color: #d9a441; flex: none; }
.drive-info { flex: 1; min-width: 0; }
.drive-name { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.drive-track { height: 12px; background: #e4e4e4; border: 1px solid #cfcfcf; }
.drive-fill { height: 100%; }
.drive-meta { font-size: 12px; color: #6a6a6a; margin-top: 4px; }

.bin-bar { padding-bottom: 12px; border-bottom: 1px solid #e4e4e4; margin-bottom: 14px; }
.bin-button {
  padding: 5px 12px;
  font-size: 12px;
  background: #f0f0f0;
  border: 1px solid #b6b6b6;
  color: #333;
}
.bin-button:hover:not(:disabled) { background: #e5f1fb; border-color: #4a9ae0; }
.bin-button:disabled { opacity: 0.45; cursor: default; }
.bin-empty { color: #6a6a6a; font-style: italic; }

/* Control Panel's own styles live in controlpanel.css. */
