/* ============================================================
   sabreOS shell — taskbar, bigger desktop icons, scattered folders
   ============================================================ */

/* ---- Desktop icons: a little bigger ---- */
.desktop-icon,
.desktop-icon:link,
.desktop-icon:visited,
.desktop-icon:active {
  width: 84px;
  font-size: 13px;
}
.desktop-icon img {
  width: 44px;
  height: 44px;
}

/* ---- Scattered folders ---- */
.desktop-folders {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.desktop-folders .desktop-folder {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  text-align: center;
  line-height: 1.25;
}
.desktop-folders:not(.placed) .desktop-folder { visibility: hidden; }
.desktop-folders .desktop-folder,
.desktop-folders .desktop-folder:link,
.desktop-folders .desktop-folder:visited {
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000, 0 0 8px rgba(0,0,0,0.9);
}
.desktop-folders .desktop-folder img { width: 48px; height: 48px; margin-bottom: 2px; image-rendering: pixelated; pointer-events: none; }
.desktop-folder.selected { color: #fff; }
.desktop-folder.selected img { filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8)) brightness(0.75) sepia(1) hue-rotate(205deg) saturate(3); }
.desktop-folder.dragging { opacity: 0.75; cursor: grabbing; z-index: 5; }

/* ---- Taskbar ---- */
#taskbar {
  height: 30px;
  padding: 2px 3px;
  gap: 3px;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  box-shadow: inset 0 1px #fff;
  z-index: 99980;
  font-family: "w95f", Tahoma, Arial, sans-serif;
  text-shadow: none;
}
#start-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px 0 5px;
  border: none;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 1px;
  color: #000;
}
#start-btn img { width: 18px; height: 18px; image-rendering: pixelated; }
#start-btn.active {
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff, inset 2px 2px #808080, inset -2px -2px #dfdfdf;
}
#start-btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.tb-divider {
  width: 2px;
  height: 22px;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  margin: 0 1px;
}
#taskbar-windows {
  margin-left: 0;
  gap: 3px;
  overflow: hidden;
  align-items: center;
}
.taskbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 1 164px;
  min-width: 36px;
  max-width: 164px;
  height: 24px;
  padding: 0 6px;
  border: none;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-align: left;
}
.taskbar-btn[hidden] { display: none; }
.taskbar-btn img { width: 16px; height: 16px; flex: 0 0 16px; image-rendering: pixelated; }
.taskbar-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskbar-btn:hover { background: #c0c0c0; }
.taskbar-btn:active { transform: none; }
.taskbar-btn.active {
  font-weight: bold;
  background-color: #dcdcdc;
  background-image: repeating-conic-gradient(#fff 0 25%, #c0c0c0 0 50%);
  background-size: 2px 2px;
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff, inset 2px 2px #808080, inset -2px -2px #dfdfdf;
}
#taskbar-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px 0 6px;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
  font-size: 12px;
  color: #000;
}
#taskbar-tray img { width: 16px; height: 16px; image-rendering: pixelated; }
#taskbar-clock {
  padding: 0;
  border: none;
  box-shadow: none;
  background: none;
  font-size: 12px;
}

/* Start menu sits on the taskbar */
#start-menu { bottom: 28px; z-index: 99981; }
#start-menu .sm-ico { image-rendering: pixelated; filter: none; opacity: 1; }

/* While dragging a window, iframes shouldn't swallow the pointer */
body.dragging-window { user-select: none; -webkit-user-select: none; }
body.dragging-window iframe { pointer-events: none; }

/* ---- Phones: folders live on the home screen ---- */
@media (max-width: 700px) {
  .desktop-folders { z-index: 50; }
  .desktop-folders .desktop-folder {
    width: 88px;
    font-size: 13px;
  }
  .desktop-folders .desktop-folder img { width: 48px; height: 48px; }
}

/* ---- Link apps: one icon per link, top-center (index.html .desktop-links) ---- */
.desktop-links {
  position: fixed;
  top: 84px;                     /* just under the sabre logo */
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 4px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
.desktop-links .desktop-link,
.desktop-links .desktop-link:link,
.desktop-links .desktop-link:visited {
  position: relative;
  pointer-events: auto;
  width: 84px;
  text-align: center;
  line-height: 1.25;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 2px #000, 0 0 3px #000, 0 0 8px rgba(0,0,0,0.9);
  -webkit-touch-callout: none;
}
.desktop-links .dl-ico { position: relative; display: block; width: 44px; height: 44px; margin: 0 auto 3px; }
.desktop-links .dl-ico img { width: 44px; height: 44px; margin: 0; display: block; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }
/* the little Windows shortcut arrow */
.desktop-links .dl-ico::after {
  content: "";
  position: absolute; left: -2px; bottom: -2px; width: 13px; height: 13px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13' shape-rendering='crispEdges'%3E%3Crect x='.5' y='.5' width='12' height='12' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M3 10V7.5C3 5.5 4.5 4.5 6.5 4.5H8V3l3 2.5L8 8V6.5H6.5C5.3 6.5 5 7 5 8v2z' fill='%23000'/%3E%3C/svg%3E") no-repeat;
  image-rendering: pixelated;
}
.desktop-links .desktop-link:hover .dl-ico img,
.desktop-links .desktop-link:focus-visible .dl-ico img { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)) brightness(0.8) sepia(1) hue-rotate(205deg) saturate(3); }
.desktop-links .desktop-link:focus-visible { outline: 1px dotted currentColor; outline-offset: 1px; }
html.light-desk .desktop-links .desktop-link,
html.light-desk .desktop-links .desktop-link:link,
html.light-desk .desktop-links .desktop-link:visited { color: #000; text-shadow: none; }
html.booting .desktop-links { visibility: hidden; }

@media (max-width: 700px) {
  /* Phones: a 3 x 2 grid in the middle of the screen (between the top bar and the bottom nav) */
  .desktop-links {
    top: calc(46px + (100vh - 104px) / 2);
    top: calc(46px + (100dvh - 104px) / 2);
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(3, 96px);
    gap: 10px 8px;
    width: auto;
  }
  .desktop-links .desktop-link,
  .desktop-links .desktop-link:link,
  .desktop-links .desktop-link:visited { width: 96px; padding: 6px 2px 4px; font-size: 13px; }
  .desktop-links .dl-ico, .desktop-links .dl-ico img { width: 48px; height: 48px; }
}

