/* ===========================
   Navigation (styled as the XP Taskbar)
   =========================== */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: linear-gradient(to bottom, var(--xp-taskbar-light) 0%, var(--xp-taskbar-dark) 100%);
  box-shadow:
    inset 0 2px 0 var(--xp-titlebar-light),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 -2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease;
}

.nav__container {
  position: relative;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 100%;
  margin-left: -1rem;
  font-family: var(--font-heading);
  padding: 0 1.3rem 0 0.7rem;
  border-radius: 0 10px 10px 0;
  border: none;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    #8FE870 0%,
    var(--xp-start-light) 18%,
    var(--xp-start-dark) 75%,
    #1F6B1F 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.nav__logo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
  border-radius: 0 10px 0 0;
  pointer-events: none;
}

.nav__logo-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background-image: var(--icon-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.nav__logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  font-style: italic;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.nav__logo:hover {
  filter: brightness(1.08);
}

.nav__logo:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  filter: brightness(0.95);
}

.nav__logo:active .nav__logo-text,
.nav__logo:active .nav__logo-icon {
  transform: translateY(1px);
}

.nav__menu {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 0.4rem;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav__menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* --- Authentic XP Start Menu --- */
.start-menu {
  width: 380px;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--xp-face);
  border: 1px solid var(--xp-titlebar-dark);
  border-radius: 8px 8px 0 0;
  box-shadow:
    inset 0 0 0 1px var(--xp-titlebar-light),
    0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.start-menu__header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(to right, var(--xp-titlebar-dark) 0%, var(--xp-titlebar-mid) 55%, var(--xp-titlebar-pale) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.start-menu__avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #fff var(--icon-url) center / contain no-repeat;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.start-menu__user {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.start-menu__body {
  display: flex;
  min-height: 280px;
}

.start-menu__col {
  list-style: none;
  display: flex;
  flex-direction: column;
  flex: 1 1 50%;
  padding: 0.5rem;
  gap: 1px;
}

.start-menu__col--left {
  background: #fff;
}

.start-menu__col--right {
  background: var(--xp-start-panel, #D3E4FD);
  padding-top: 0.6rem;
}

.start-menu__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: 1px solid transparent;
  text-align: left;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.35rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
}

.start-menu__item:disabled {
  cursor: default;
  color: var(--text);
}

.start-menu__item:not(:disabled):hover {
  color: #fff;
  background: var(--xp-titlebar-mid);
  border-color: var(--xp-titlebar-dark);
}

.start-menu__item-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-image: var(--icon-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.start-menu__item--right {
  font-weight: 500;
}

.start-menu__item--all {
  margin-top: 0.3rem;
  border-top: 1px solid var(--xp-bevel-shadow);
  border-radius: 0;
  padding-top: 0.5rem;
}

.start-menu__item-arrow {
  margin-left: auto;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-image: var(--icon-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.start-menu__divider {
  height: 1px;
  margin: 0.35rem 0.2rem;
  background: var(--xp-bevel-shadow);
}

.start-menu__spacer {
  flex: 1 1 auto;
}

.start-menu__item-icon--bordered {
  border: 1.5px solid #fff;
  border-radius: 4px;
}

@media (max-width: 480px) {
  .start-menu {
    width: calc(100vw - 2rem);
  }
  .start-menu__body {
    min-height: 0;
  }
}

/* Taskbar window buttons (one per open window, like the real XP taskbar) */
.nav__windows {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.nav__windows::-webkit-scrollbar {
  display: none;
}

.taskbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 1 130px;
  width: 130px;
  height: calc(100% - 6px);
  padding: 0 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  background: linear-gradient(to bottom, #4D8FEB 0%, #2C62C9 45%, #1E4FAE 100%);
  border: 1px solid #14336E;
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset -1px -1px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
  overflow: hidden;
}

.taskbar-btn[hidden] {
  display: none;
}

.taskbar-btn:hover {
  filter: brightness(1.08);
}

.taskbar-btn.active {
  background: linear-gradient(to bottom, #15296B 0%, #0C1D52 100%);
  box-shadow:
    inset 1px 1px 2px rgba(0, 0, 0, 0.75),
    inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.taskbar-btn__icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background-image: var(--icon-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.taskbar-btn__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* System tray (simulates the XP taskbar's notification area) */
.nav__tray {
  display: inline-flex;
  align-items: center;
  height: 100%;
  margin-right: -1rem;
  padding-left: 0.6rem;
  background: var(--xp-titlebar-light);
  border-left: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.18),
    0 1px 4px rgba(0, 0, 0, 0.4),
    -2px 0 4px rgba(0, 0, 0, 0.25);
}

.nav__tray-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-right: 0.6rem;
  margin-right: 0.6rem;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.18);
}

.nav__tray-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  color: #fff;
  opacity: 0.9;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.nav__tray-icon:hover {
  opacity: 1;
  transform: scale(1.15);
}

.nav__tray-icon:active {
  transform: scale(0.92);
}

.nav__tray-icon .icon {
  width: 13px;
  height: 13px;
}

.nav__tray-clock {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  padding-right: 0.8rem;
}
