/* eggs.css: styles for eggs.js (screenshot flash, kernel panic, Force Quit, Fast User
   Switching login window, the user menu in the menu bar). Everything is scoped to .egg-*. */

/* ---------- Screenshot ---------- */
.egg-flash {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #fff;
  pointer-events: none;
  animation: egg-flash 0.35s ease-out forwards;
}
@keyframes egg-flash { from { opacity: 0.85; } to { opacity: 0; } }

/* ---------- Kernel panic (10.3 style) ----------
   xnu-517 osfmk/console/panic_dialog.c halves every pixel channel (dim_screen_32), one row
   after another from the top, then blits panic_image.c: a 472x255 rectangle, drawn here at
   1.2x. Box colours conflict between sources: xnu-517's picture is near-black (#222) with
   white text, Apple TN2063 Figure 1 (a 10.2 screenshot) shows a light grey box with dark text.
   The dark colours below are kept on purpose. */
.egg-panic {
  position: fixed;
  inset: 0;
  z-index: 2147483100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  font-family: "Lucida Grande", var(--ui-font, sans-serif);
}
/* The dim drops from the top of the screen: 50% black stands in for halving each channel. */
.egg-panic::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: egg-curtain 0.9s linear forwards;
}
@keyframes egg-curtain { to { height: 100%; } }
.egg-panic-box {
  position: relative;
  box-sizing: border-box;
  width: min(566px, calc(100vw - 32px));
  min-height: 306px;
  padding: 24px 32px 20px;
  background: rgba(32, 32, 32, 0.92);
  color: #fff;
  text-align: left;
  opacity: 0;
  animation: egg-fade 0.4s ease 0.95s forwards;
}
/* the power symbol is a watermark behind the text, centred in the box */
.egg-panic-box svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  color: rgba(255, 255, 255, 0.2);
}
.egg-panic-box p { position: relative; margin: 0 0 19px; font-size: 14.4px; line-height: 19px; }
.egg-panic-box p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .egg-panic-box { min-height: 0; padding: 18px 20px; }
  .egg-panic-box p { font-size: 13px; line-height: 17px; margin-bottom: 14px; }
  .egg-panic-box .egg-br { display: none; }
  .egg-panic-box svg { width: 140px; height: 140px; margin: -70px 0 0 -70px; }
}
@keyframes egg-fade { to { opacity: 1; } }
.egg-panic.egg-restart::before { animation: none; height: 100%; background: #6a6a6a; transition: background 0.5s; }
.egg-panic.egg-restart .egg-panic-box { display: none; }

/* ---------- Force Quit Applications ---------- */
.egg-fq.osx-win {
  position: fixed;
  z-index: 2147482000;
  width: 340px;
  max-width: calc(100vw - 24px);
}
/* The stacked phone layout makes every .osx-win static and full width; this one stays a
   floating panel. */
@media (max-width: 960px) {
  .egg-fq.osx-win {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 60px !important;
    width: auto !important;
  }
}
.egg-fq .osx-body { padding: 12px 16px 14px; font-size: 12px; }
.egg-fq p { margin: 0 0 9px; line-height: 1.3; }
.egg-fq-list {
  list-style: none;
  margin: 0 0 9px;
  padding: 0;
  height: 172px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #8a8a8a;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.egg-fq-list:focus { outline: 2px solid #7ba7e1; outline-offset: -1px; }
.egg-fq-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
}
.egg-fq-list li:nth-child(even) { background: var(--aqua-stripe, #edf3fe); }
.egg-fq-list li.sel { background: var(--aqua-sel, #3875d7); color: #fff; }
.egg-fq-list li svg { width: 18px; height: 18px; flex: 0 0 auto; }
.egg-fq-note { font-size: 11px; color: #4a4a4a; }
.egg-fq-btns { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Menu bar user name (Fast User Switching) ---------- */
.egg-user { margin-left: 4px; }
.egg-user > .menu-title { font-weight: 700; }
.egg-user > .menu-drop { left: auto; right: 0; min-width: 210px; }
.egg-user .egg-user-item { justify-content: flex-start; gap: 7px; min-height: 36px; padding-left: 8px; }
.egg-user .egg-user-item img { width: 32px; height: 32px; object-fit: cover; flex: 0 0 auto; }
.egg-user .egg-user-item:disabled img, .egg-user .egg-user-item:disabled .egg-user-on { opacity: 0.5; }
/* logged in: a white check on an orange disc */
.egg-user-on {
  position: relative;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffc66b, #f08a12 70%);
}
.egg-user-on::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.5px;
  width: 3px;
  height: 6.5px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(40deg);
}

/* ---------- Login window + cube ---------- */
.egg-cubing, .egg-cubing body { background: #000 !important; overflow: hidden !important; }
.egg-cubing body { backface-visibility: hidden; will-change: transform; }
.egg-login {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: flex;
  align-items: center;
  justify-content: center;
  /* fallback; eggs.js puts index.html's Aqua Blue desktop picture on top */
  background-color: #2462ae;
  background-image: linear-gradient(160deg, #5a8fd6 0%, #2462ae 55%, #173f7d 100%);
  background-size: cover;
  background-position: center;
  backface-visibility: hidden;
  font-family: "Lucida Grande", var(--ui-font, sans-serif);
}
.egg-login[hidden] { display: none; }
/* Laid out after GUIdebook's 10.3 login screen and Ars Technica's fus-login.png: a square
   pinstriped panel (472px wide there), silver apple, bold "Mac OS X", the computer name, the
   users in a recessed rounded well, and round Sleep / Restart / Shut Down buttons. */
.egg-login-panel {
  box-sizing: border-box;
  width: min(472px, calc(100vw - 32px));
  padding: 28px 28px 11px;
  background: var(--pinstripe-bg, #eee);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.18);
  text-align: center;
  color: #000;
}
.egg-login-apple { display: block; width: 66px; height: 80px; margin: 0 auto 14px; }
.egg-login-title { font-size: 27px; line-height: 32px; font-weight: 700; color: #1a1a1a; }
.egg-login-host { margin-top: 1px; font-size: 12px; line-height: 15px; color: #5f5f5f; }
.egg-login-list {
  display: grid;
  justify-content: center; /* one centred column, as wide as the longest name */
  gap: 12px;
  margin: 18px 0 20px;
  padding: 11px 8px;
  border: 1px solid #c4c4c4;
  border-top-color: #9d9d9d;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.035);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.egg-login-user {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 190px;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font: 14px/1.2 "Lucida Grande", var(--ui-font, sans-serif);
  color: #000;
  text-align: left;
  cursor: default;
}
.egg-login-pic { display: block; width: 48px; height: 48px; object-fit: cover; flex: 0 0 auto; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.egg-login-user:not(.egg-login-other):hover { background: var(--aqua-sel, #3875d7); color: #fff; }
.egg-login-user:focus-visible { outline: 2px solid #7ba7e1; outline-offset: 2px; }
.egg-login-foot { display: flex; justify-content: center; gap: 36px; font-size: 11px; color: #000; }
.egg-login-foot span { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 50px; }
.egg-login-foot i {
  display: block;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid #6f6f6f;
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f1f1f1 45%, #c9c9c9 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.egg-login-foot svg { display: block; width: 28px; height: 28px; }

/* iChat: a single click selects a buddy (double-click opens the chat) */
.buddy-row.selected { background: var(--aqua-sel, #3875d7); color: #fff; }
.buddy-row.selected .buddy-text span { color: #e4ecfa; }

/* killall Dock: the Dock blinks away and comes back */
/* No fill mode: when it ends the Dock's own centring transform (translateX(-50%), plus any
   scale-to-fit) applies again; the keyframes keep the centring while it runs. */
.egg-dock-restart { animation: egg-dock 1.1s ease; }
@keyframes egg-dock { 30%, 55% { opacity: 0; transform: translateX(-50%) translateY(30px); } }

@media (prefers-reduced-motion: reduce) {
  .egg-panic::before { animation-duration: 0.01s; }
  .egg-panic-box { animation-delay: 0s; }
  .egg-dock-restart { animation: none; }
}
