/* ==========================================================================
   Taskbar
   Fixed 32px strip at the bottom of the viewport. Contains the Start
   button, running-window list, and the system tray / clock.
   ========================================================================== */

#sz-taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35px;
  background: var(--sz-color-button-face, #eeeddd);
  border-top: 1px solid var(--sz-color-button-highlight, white);
  display: flex;
  align-items: center;
  z-index: 1000;
  user-select: none;
  padding: 0 2px;
}

/* --------------------------------------------------------------------------
   Start Button
   -------------------------------------------------------------------------- */

#sz-start-button {
  height: 26px;
  padding: 0 8px;
  margin: 0 4px 0 0;
  font-weight: bold;
  font-size: 11px;
  background: var(--sz-color-button-face, #eeeddd);
  border: 1px outset var(--sz-color-button-highlight, white);
  cursor: default;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

#sz-start-button:active,
#sz-start-button.active {
  border-style: inset;
}

/* When skinned, border/padding are removed by JS so these no-ops are fine */
#sz-start-button[data-sz-skinned] {
  border: none;
  padding: 0;
}

#sz-start-button img {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Quick-launch separator (thin vertical line between start and window list)
   -------------------------------------------------------------------------- */

.sz-taskbar-separator {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--sz-color-button-shadow, #cac6af);
  border-right: 1px solid var(--sz-color-button-highlight, white);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Window List (running-window buttons)
   -------------------------------------------------------------------------- */

#sz-window-list {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow: hidden;
  padding: 0 2px;
}

.sz-taskbar-button {
  height: 24px;
  min-width: 120px;
  max-width: 180px;
  padding: 0 8px;
  border: 1px solid var(--sz-taskbar-btn-border, rgba(255,255,255,0.25));
  border-radius: 2px;
  background: var(--sz-taskbar-btn-bg, rgba(255,255,255,0.15));
  color: var(--sz-taskbar-btn-text, white);
  font-size: 11px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
  flex-shrink: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sz-taskbar-button img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}

.sz-taskbar-button.active {
  background: var(--sz-taskbar-btn-active-bg, rgba(255,255,255,0.35));
  border-color: var(--sz-taskbar-btn-active-border, rgba(255,255,255,0.4));
}

.sz-taskbar-button:hover:not(.active) {
  background: var(--sz-taskbar-btn-hover-bg, rgba(255,255,255,0.25));
}

/* When too many windows are open, shrink buttons proportionally */
#sz-window-list.sz-overflow .sz-taskbar-button {
  min-width: 48px;
  flex-shrink: 1;
  flex-grow: 0;
  flex-basis: 0;
}

/* --------------------------------------------------------------------------
   System Tray / Notification Area
   -------------------------------------------------------------------------- */

#sz-system-tray {
  margin-left: auto;
  padding: 0 8px;
  font-size: 11px;
  color: var(--sz-taskbar-btn-text, white);
  border-left: 1px solid rgba(255,255,255,0.2);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

#sz-system-tray .sz-tray-icon {
  width: 16px;
  height: 16px;
  cursor: default;
}

#sz-clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
}

.sz-clock-date {
  font-size: 9px;
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Start Menu — Windows XP two-column layout
   -------------------------------------------------------------------------- */

#sz-start-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 380px;
  max-height: calc(100vh - 40px);
  background: var(--sz-color-button-face, #eeeddd);
  border: 2px solid var(--sz-color-highlight, #316ac5);
  border-radius: 6px 6px 0 0;
  box-shadow: 2px -2px 8px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  display: none;
  flex-direction: column;
  font-family: Tahoma, Verdana, sans-serif;
  font-size: 11px;
  overflow: hidden;
}

#sz-start-menu.open {
  display: flex;
}

/* Header (user avatar + name) */
.sz-start-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(to right, #1856b0, #2a72d5, #1856b0);
  color: white;
  font-weight: bold;
  font-size: 13px;
}

.sz-start-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.6);
  background: transparent;
  flex-shrink: 0;
  object-fit: contain;
}

.sz-start-username {
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Two-column body */
.sz-start-body {
  display: flex;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.sz-start-left {
  flex: 1;
  background: white;
  padding: 4px 0;
  border-right: 1px solid var(--sz-color-button-shadow, #cac6af);
  overflow-y: auto;
}

.sz-start-right {
  width: 150px;
  padding: 4px 0;
  background: var(--sz-color-button-face, #eeeddd);
  overflow-y: auto;
}

/* Footer (log off / turn off) */
.sz-start-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px 8px;
  background: linear-gradient(to right, #1856b0, #2a72d5, #1856b0);
  border-top: 1px solid rgba(255,255,255,0.3);
}

.sz-start-footer button {
  font-size: 10px;
  padding: 2px 10px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  color: white;
  border-radius: 3px;
  cursor: default;
}

.sz-start-footer button:hover {
  background: rgba(255,255,255,0.3);
}

/* Menu items */
.sz-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 11px;
  cursor: default;
  color: var(--sz-color-button-text, black);
}

.sz-menu-item:hover {
  background: var(--sz-color-highlight, #316ac5);
  color: var(--sz-color-highlight-text, white);
}

.sz-menu-item img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  pointer-events: none;
}

.sz-menu-system-item {
  font-weight: bold;
  padding: 4px 12px;
}

.sz-menu-system-item:hover img,
.sz-menu-item:hover img {
  filter: brightness(10);
}

.sz-all-programs {
  justify-content: space-between;
  font-weight: bold;
}

.sz-menu-arrow {
  font-size: 8px;
  opacity: 0.6;
}

.sz-menu-separator {
  height: 1px;
  margin: 2px 8px;
  background: var(--sz-color-button-shadow, #cac6af);
}

/* --------------------------------------------------------------------------
   MRU section
   -------------------------------------------------------------------------- */

.sz-mru-section {
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   Category items (All Programs view)
   -------------------------------------------------------------------------- */

.sz-menu-category {
  position: relative;
}

.sz-menu-category.active {
  background: var(--sz-color-highlight, #316ac5);
  color: var(--sz-color-highlight-text, white);
}

.sz-menu-category-icon {
  font-size: 14px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   "Back" item
   -------------------------------------------------------------------------- */

.sz-menu-back {
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   Flyout submenu (category apps)
   -------------------------------------------------------------------------- */

.sz-start-flyout {
  position: fixed;
  width: 200px;
  background: white;
  border: 1px solid var(--sz-color-button-shadow, #cac6af);
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 10001;
  display: none;
  flex-direction: column;
  padding: 4px 0;
}

.sz-start-flyout.visible {
  display: flex;
}

.sz-start-body {
  position: relative;
}

/* --------------------------------------------------------------------------
   Small icons mode
   -------------------------------------------------------------------------- */

#sz-start-menu.sz-small-icons .sz-menu-item {
  padding: 2px 12px;
  gap: 6px;
  font-size: 11px;
}

#sz-start-menu.sz-small-icons .sz-menu-item img {
  width: 16px;
  height: 16px;
}

#sz-start-menu.sz-small-icons .sz-menu-category-icon {
  font-size: 11px;
  width: 16px;
}

/* --------------------------------------------------------------------------
   Auto-hide taskbar
   -------------------------------------------------------------------------- */

#sz-taskbar.sz-auto-hide {
  transform: translateY(calc(100% - 2px));
  transition: transform 0.3s ease;
}

#sz-taskbar.sz-auto-hide:hover,
#sz-taskbar.sz-auto-hide:has(.open) {
  transform: translateY(0);
}
