/* ======================================================================
   DESKTOP CONTROLS — Jerry Zhao / Figments of Dreams

   1. Desktop shortcuts
   2. Window buttons
   3. Start menu
   4. Close website dialog
   5. Works folder and small-screen adjustments

   General colors, page layouts, and typography remain in xp.css.
   ====================================================================== */

/* 1. DESKTOP SHORTCUTS -------------------------------------------------- */

.desktop-icons {
  position: absolute;
  top: 26px;
  left: 18px;
  width: 104px;
  display: grid;
  gap: 23px;
}

.desktop-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 7px 3px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: white;
  text-decoration: none;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  text-shadow: 1px 1px 2px #224e85;
}

.desktop-shortcut .pixel-icon {
  width: 34px;
  height: 34px;
}

.desktop-shortcut:hover,
.desktop-shortcut:focus-visible {
  color: white;
  background: #c1ddff26;
  border-color: #c4dfff;
  outline: 1px dotted #fff;
  outline-offset: -4px;
}

/* 2. WINDOW BUTTONS ---------------------------------------------------- */

/* Draw a short bar inside the button instead of using a low text baseline. */
.window-controls .window-minimize::after {
  content: "";
  display: block;
  width: 9px;
  height: 3px;
  transform: translateY(2px);
  background: white;
  box-shadow: 1px 1px #1b50ad;
}

/* 3. START MENU -------------------------------------------------------- */

.start-button {
  border: 0;
  cursor: pointer;
}

.start-button[aria-expanded="true"] {
  background: linear-gradient(#225c1c, #3a8e2b 50%, #548f34);
  box-shadow: inset 2px 2px 5px #164819;
}

.start-button:focus-visible {
  outline: 1px dotted white;
  outline-offset: -5px;
}

.start-menu {
  position: fixed;
  bottom: 33px;
  left: 3px;
  z-index: 80;
  width: 406px;
  max-width: calc(100vw - 6px);
  max-height: calc(100dvh - 43px);
  overflow-y: auto;
  background: white;
  border: 2px solid #1751b9;
  border-radius: 7px 7px 0 0;
  box-shadow: 4px -3px 14px #10295055;
  color: #24344d;
}

.start-menu[hidden] {
  display: none;
}

.start-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 69px;
  padding: 9px 13px;
  background: linear-gradient(#4299f6, #1764cd 55%, #2778e1);
  border-bottom: 2px solid #ecc55b;
  color: white;
  text-shadow: 1px 1px #164682;
  font-size: 18px;
}

.start-avatar {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e4f1ff, #69a2e0);
  border: 2px solid white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 1px 1px 3px #124384;
}

.start-avatar .pixel-icon {
  width: 35px;
  height: 35px;
  transform: translateY(3px);
}

.start-menu-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 246px;
}

.start-main-links,
.start-work-links {
  padding: 9px 6px 13px;
}

.start-work-links {
  background: #d9e7fa;
  border-left: 1px solid #9ab5dc;
}

.start-column-label {
  margin: 3px 10px 8px;
  color: #355e98;
  font-size: 11px;
  font-weight: bold;
}

.start-menu-columns a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 9px;
  color: #233d62;
  text-decoration: none;
  line-height: 1.35;
  font-size: 13px;
}

.start-main-links .pixel-icon {
  width: 27px;
  height: 27px;
}

.start-menu-columns strong,
.start-menu-columns small {
  display: block;
}

.start-menu-columns small {
  color: #6a7990;
  margin-top: 3px;
  font-size: 10px;
}

.start-menu-columns a:hover,
.start-menu-columns a:focus-visible {
  color: white;
  background: #2f6ac5;
  outline: none;
}

.start-menu-columns a:hover small,
.start-menu-columns a:focus-visible small {
  color: #e8f1ff;
}

.start-separator {
  height: 1px;
  margin: 7px 10px;
  background: linear-gradient(90deg, transparent, #bac7d8, transparent);
}

.start-menu-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  padding: 10px 13px;
  background: linear-gradient(#3f95ed, #1462ce);
  border-top: 1px solid #95bef5;
}

.start-menu-footer a,
.start-menu-footer button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 11px;
  text-decoration: none;
}

.start-menu-footer a:hover,
.start-menu-footer button:hover {
  text-decoration: underline;
}

.start-menu-footer a:focus-visible,
.start-menu-footer button:focus-visible {
  outline-color: white;
}

.start-menu-footer .power-symbol,
.logoff-icon {
  width: 25px;
  height: 25px;
}

.logoff-icon {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(#ffe08a, #c79b2d);
  border: 1px solid #fff0b8;
  border-radius: 3px;
  font-size: 19px;
}

/* 4. CLOSE WEBSITE DIALOG ---------------------------------------------- */

.login-close {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  border: 1px solid transparent;
  background: none;
  color: white;
  font-size: 12px;
}

.login-close:hover {
  border-color: #afc8ef;
  background: #ffffff12;
  border-radius: 3px;
}

.login-close:focus-visible {
  outline-color: white;
}

.close-dialog {
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 0;
  border: 3px solid #1259c6;
  border-top: 0;
  border-radius: 8px 8px 0 0;
  background: #ece9d8;
  box-shadow: 5px 8px 25px #0d245080;
  color: #24344d;
}

.close-dialog::backdrop {
  background: #081b4b66;
}

.close-dialog-content {
  padding: 22px 23px;
  font-size: 13px;
}

.close-dialog-content kbd {
  padding: 2px 5px;
  border: 1px solid #b2b5bb;
  border-radius: 2px;
  background: #fffefb;
  font: inherit;
  white-space: nowrap;
}

.close-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* 5. WORKS FOLDER AND RESPONSIVE ADJUSTMENTS ---------------------------- */

.work-folder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.work-folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 18px;
  border: 1px solid #b9cce4;
  background: #f7faff;
  text-align: center;
  text-decoration: none;
}

.work-folder-card:hover {
  background: #e8f1ff;
}

.work-folder-card span {
  color: #72839a;
  font-size: 12px;
}

.scrap-entry {
  padding: 22px 0;
  border-bottom: 1px solid #d1ddeb;
}

.scrap-entry time {
  display: block;
  margin-bottom: 12px;
  color: #72839a;
  font-size: 11px;
}

/* A row above the window keeps both icons usable when there is no side space. */
@media (max-width: 1399px) {
  .desktop-icons {
    position: static;
    width: auto;
    max-width: 1118px;
    margin: 0 auto 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }

  .desktop-shortcut {
    width: 102px;
  }
}

@media (max-width: 540px) {
  .desktop-icons {
    margin-bottom: 13px;
    gap: 7px;
  }

  .desktop-shortcut {
    padding: 3px;
    gap: 5px;
    font-size: 10px;
  }

  .desktop-shortcut .pixel-icon {
    width: 28px;
    height: 28px;
  }

  .start-menu-columns a {
    font-size: 12px;
    gap: 7px;
    padding: 8px 6px;
  }

  .start-main-links .pixel-icon {
    width: 23px;
    height: 23px;
  }

  .start-menu-header {
    font-size: 17px;
  }

  .work-folder-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media print {
  .desktop-icons,
  .start-menu,
  .close-dialog {
    display: none !important;
  }
}

/* 6. WORKS LINK AND DROPDOWN -------------------------------------------
   Clicking the word Works opens the collection. The small arrow is separate. */

.works-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px 6px 13px;
  border: 1px solid transparent;
  color: #172b47;
  text-decoration: none;
  font-size: 13px;
}

.works-menu > .works-toggle {
  padding: 6px 8px;
  min-width: 25px;
  font-size: 10px;
}

.works-link:hover,
.works-menu.is-open > .works-link {
  background: #fff7d0;
  border-color: #c8a955;
  color: #153d6d;
}

/* 7. GUEST NAME, LOCAL TIME, AND LOCAL DATE ----------------------------- */

.taskbar {
  height: 44px;
}

.start-menu {
  bottom: 44px;
  max-height: calc(100dvh - 54px);
}

.system-tray {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 4px 13px;
  flex-shrink: 0;
  min-height: 44px;
}

.tray-guest {
  font-size: 11px;
  white-space: nowrap;
}

.tray-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.25;
  min-width: 65px;
  font-size: 10px;
}

@media (max-width: 620px) {
  .active-task {
    flex: 1;
    width: auto;
    min-width: 28px;
    max-width: 160px;
    overflow: hidden;
  }

  .active-task > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .system-tray {
    gap: 7px;
    padding: 3px 7px;
  }

  .tray-guest {
    font-size: 10px;
  }

  .works-link {
    font-size: 11px;
    padding: 6px 2px 6px 6px;
  }

  .works-menu > .works-toggle {
    padding: 6px 5px;
    min-width: 22px;
  }
}

@media (max-width: 360px) {
  .taskbar {
    gap: 4px;
  }

  .start-button {
    min-width: 88px;
    padding-right: 11px;
  }

  .active-task > span,
  .task-divider {
    display: none;
  }
}
