/*
  taskbar.css, the bottom bar, Start button, running apps, tray, clock,
                calendar popover
*/

.os-taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--os-taskbar-h);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: var(--os-glass-strong);
  -webkit-backdrop-filter: blur(var(--os-blur));
  backdrop-filter: blur(var(--os-blur));
  border-top: 1px solid var(--os-border);
}

/* --- Start button --------------------------------------------------------- */
.os-start {
  flex: 0 0 auto;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 12px;
  border-radius: var(--os-radius);
  color: var(--os-text);
  font-weight: 600;
  font-size: 13px;
  transition: background var(--os-dur-fast) var(--os-ease-out);
}
.os-start:hover { background: var(--os-fill-hover); }
.os-start.is-active { background: var(--os-brand); color: var(--os-brand-contrast); }
.os-start__logo { display: grid; place-items: center; color: var(--os-brand); }
.os-start.is-active .os-start__logo { color: var(--os-brand-contrast); }

/* --- Running app buttons -------------------------------------------------- */
.os-running {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox: hide the scrollbar, keep scroll */
}
.os-running::-webkit-scrollbar { display: none; }

.os-running__btn {
  flex: 0 0 auto;
  height: 38px;
  max-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--os-radius);
  color: var(--os-text-muted);
  font-size: 12.5px;
  /* An underline accent that lights up for the active window. */
  border-bottom: 2px solid transparent;
  transition: background var(--os-dur-fast) var(--os-ease-out),
    color var(--os-dur-fast) var(--os-ease-out),
    border-color var(--os-dur-fast) var(--os-ease-out);
}
.os-running__btn:hover { background: var(--os-fill-soft); color: var(--os-text); }
.os-running__btn.is-active {
  background: var(--os-fill-hover);
  color: var(--os-text);
  border-bottom-color: var(--os-brand);
}
.os-running__btn.is-minimised { opacity: 0.62; }

.os-running__icon { width: 18px; height: 18px; border-radius: 5px; flex: 0 0 auto; }
.os-running__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Tray (settings + clock) --------------------------------------------- */
.os-tray {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.os-tray__btn {
  width: 36px;
  height: 36px;
  border-radius: var(--os-radius-sm);
  display: grid;
  place-items: center;
  color: var(--os-text-muted);
  transition: background var(--os-dur-fast) var(--os-ease-out), color var(--os-dur-fast);
}
.os-tray__btn:hover { background: var(--os-fill-hover); color: var(--os-text); }

.os-clock {
  height: 38px;
  padding: 0 10px;
  border-radius: var(--os-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.15;
  color: var(--os-text);
  transition: background var(--os-dur-fast) var(--os-ease-out);
}
.os-clock:hover { background: var(--os-fill-hover); }
.os-clock__time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.os-clock__date { font-size: 10.5px; color: var(--os-text-muted); }

/* --- Calendar popover ----------------------------------------------------- */
.os-cal {
  position: absolute;
  right: 8px;
  bottom: calc(var(--os-taskbar-h) + 8px);
  width: 260px;
  padding: 14px;
  border-radius: var(--os-radius);
  background: var(--os-glass-strong);
  -webkit-backdrop-filter: blur(var(--os-blur));
  backdrop-filter: blur(var(--os-blur));
  border: 1px solid var(--os-border);
  box-shadow: var(--os-shadow-menu);
  animation: os-pop-in 150ms var(--os-ease-out);
}
.os-cal__head {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--os-text);
}
.os-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.os-cal__dow {
  font-size: 10.5px;
  color: var(--os-text-dim);
  text-align: center;
  padding-bottom: 4px;
}
.os-cal__day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 12px;
  border-radius: var(--os-radius-sm);
  color: var(--os-text);
}
.os-cal__day:hover { background: var(--os-fill-hover); }
.os-cal__day.is-today {
  background: var(--os-brand);
  color: var(--os-brand-contrast);
  font-weight: 700;
}

/* On narrow screens the running list gets tight: hide the Start label + the
   date line to reclaim room; icons + time remain. */
@media (max-width: 640px) {
  .os-start__label { display: none; }
  .os-running__label { max-width: 84px; }
  .os-cal { left: 8px; right: 8px; width: auto; }
}
