/* Spark Agency HR — Christmas season theme (v38). Only active with body.xmas. */
@media screen {
  #xmas-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 0;
    padding: 0;
    margin: 0 8px 0 auto;
    border-radius: 11px;
  }
  #xmas-toggle[aria-pressed="true"] {
    background: #fdecec;
    border-color: #efc2c5;
    color: #b8323a;
  }
  .xmas-lights,
  .xmas-hat,
  .xmas-snow {
    display: none;
  }

  body.xmas {
    --xmas-red: #c8323a;
    --xmas-green: #1f6b4f;
    --xmas-gold: #e2b04a;
  }

  /* Snow canvas: sidebar and sign-in only */
  body.xmas .xmas-snow {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
  }
  body.xmas > aside {
    isolation: isolate;
    background:
      linear-gradient(180deg, #0f2a36 0%, #10303a 55%, #123a37 100%);
  }
  body.xmas > aside > *:not(.xmas-snow) {
    position: relative;
    z-index: 1;
  }
  body.xmas:not(.auth-mode) .login-ambient {
    display: none;
  }

  /* Santa hat on the eye */
  body.xmas .xmas-hat {
    display: block;
    position: absolute !important;
    top: 18px;
    left: calc(50% - 56px);
    width: 40px;
    height: 30px;
    transform: rotate(-18deg);
    z-index: 2 !important;
    filter: drop-shadow(0 2px 2px #0006);
  }
  body.xmas .xmas-hat svg {
    width: 100%;
    height: 100%;
  }

  /* Active page marker becomes a red bauble */
  body.xmas .workspace-nav button::after {
    background: var(--xmas-red);
    box-shadow: 0 0 0 3px #c8323a33, inset -1px -1px 0 #0003;
  }
  body.xmas .workspace-nav button.active {
    background: #c8323a1f;
  }
  body.xmas .workspace-nav button.active .nav-icon {
    color: #ff9aa0;
  }

  /* String of lights along the top of the work area */
  body.xmas:not(.auth-mode) .xmas-lights {
    display: block;
    position: relative;
    z-index: 1;
    height: 18px;
    margin: -30px -36px 12px;
    pointer-events: none;
    background:
      radial-gradient(circle at 12px 12px, #d23c3c 0 4px, transparent 5px) 0 0 / 96px 18px repeat-x,
      radial-gradient(circle at 36px 13px, #e2b04a 0 4px, transparent 5px) 0 0 / 96px 18px repeat-x,
      radial-gradient(circle at 60px 12px, #2e9e6f 0 4px, transparent 5px) 0 0 / 96px 18px repeat-x,
      radial-gradient(circle at 84px 13px, #3b8fd6 0 4px, transparent 5px) 0 0 / 96px 18px repeat-x,
      linear-gradient(#0f2a3655, #0f2a3655) 0 6px / 100% 1px no-repeat;
  }
  body.xmas:not(.auth-mode) .xmas-lights::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 12px 12px, #ffd7d7 0 2px, transparent 7px) 0 0 / 192px 18px repeat-x,
      radial-gradient(circle at 132px 13px, #fff2cf 0 2px, transparent 7px) 0 0 / 192px 18px repeat-x;
    opacity: 0.3;
    animation: xmas-twinkle 2.4s ease-in-out infinite alternate;
  }
  @keyframes xmas-twinkle {
    to {
      opacity: 1;
    }
  }

  /* Overview greeting */
  body.xmas .xmas-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin: 16px 0;
    padding: 16px 22px;
    background:
      radial-gradient(circle at 92% -20%, #e2b04a22 0 120px, transparent 121px),
      linear-gradient(120deg, #fff 0%, #fff7f2 100%);
    border-color: #f0d9cf;
  }
  .xmas-tree {
    width: 52px;
    height: 58px;
  }
  .xmas-text h2 {
    margin: 0 0 2px;
    font-size: 17px;
    color: var(--xmas-green);
  }
  .xmas-text p {
    margin: 0;
    color: var(--text-2);
  }
  .xmas-days {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
  }
  .xmas-days li {
    padding: 6px 10px;
    border-radius: 9px;
    background: #fff;
    border: 1px solid #f0d9cf;
    white-space: nowrap;
  }
  .xmas-days b {
    color: var(--xmas-red);
    margin-right: 4px;
  }

  /* Sign-in screen */
  body.xmas #auth .login-orbit {
    position: relative;
  }
  body.xmas .xmas-hat.xmas-hat-login {
    top: -4%;
    left: 8%;
    width: 34%;
    height: auto;
    aspect-ratio: 60 / 44;
    transform: rotate(-16deg);
  }
  .xmas-greet {
    display: none;
  }
  body.xmas .xmas-greet {
    display: block;
    width: fit-content;
    margin: 0 0 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ffffff1f;
    border: 1px solid #ffffff33;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
  }
  body.xmas.auth-mode .login-ambient,
  body.xmas.auth-mode #auth {
    isolation: isolate;
  }

  /* ---------- Greeting card v39: tree + holidays + countdown ---------- */
  body.xmas .xmas-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .xmas-text .xmas-days {
    margin-top: 10px;
  }
  .xmas-tree-btn {
    display: grid;
    place-items: center;
    width: 70px;
    height: 76px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
  }
  .xmas-tree-btn:hover {
    background: #1f6b4f12;
  }
  .xmas-tree-btn:hover .xmas-tree {
    transform: rotate(-4deg) scale(1.06);
  }
  .xmas-tree-btn:focus-visible {
    outline: 3px solid var(--xmas-gold);
  }
  .xmas-tree {
    transition: transform 0.25s;
  }
  body.xmas .xmas-tree .star {
    transform-box: fill-box;
    transform-origin: center;
    animation: star-glow 1.8s ease-in-out infinite alternate;
  }
  body.xmas .xmas-tree .b1 { animation: bulb 1.2s ease-in-out infinite alternate; }
  body.xmas .xmas-tree .b2 { animation: bulb 1.2s 0.4s ease-in-out infinite alternate; }
  body.xmas .xmas-tree .b3 { animation: bulb 1.2s 0.8s ease-in-out infinite alternate; }
  @keyframes star-glow {
    to { transform: scale(1.25) rotate(18deg); }
  }
  @keyframes bulb {
    from { opacity: 0.45; }
    to { opacity: 1; }
  }

  .ny-count {
    text-align: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: #0f2a36;
    color: #fff;
    min-width: 290px;
  }
  .ny-label {
    margin: 0 0 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #f6d58a;
  }
  .ny-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .ny-tiles span {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 7px 4px 5px;
    border-radius: 9px;
    background: #ffffff12;
  }
  .ny-tiles b {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
  }
  .ny-tiles small {
    font-size: 10.5px;
    color: #ffffffa6;
  }
  .ny-wish {
    margin: 0;
    font-size: 13px;
  }
  .ny-count.compact {
    position: relative;
    z-index: 2;
    margin-top: 18px;
    max-width: 330px;
    background: #ffffff1a;
    border: 1px solid #ffffff2e;
  }
  .ny-count.compact .ny-tiles b {
    font-size: 20px;
  }

  /* ---------- Santa fly-by (transform/opacity only) ---------- */
  .santa-fly {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 900;
    pointer-events: none;
    overflow: hidden;
  }
  .santa-track {
    position: absolute;
    left: 0;
    top: 10px;
    display: flex;
    align-items: center;
    will-change: transform;
    animation: santa-fly 10s linear forwards;
  }
  @keyframes santa-fly {
    0% { transform: translate3d(-460px, 40px, 0); }
    25% { transform: translate3d(calc(25vw - 230px), 0, 0); }
    50% { transform: translate3d(calc(50vw - 230px), 18px, 0); }
    75% { transform: translate3d(calc(75vw - 230px), -6px, 0); }
    100% { transform: translate3d(calc(100vw + 40px), 26px, 0); }
  }
  .santa-bob {
    position: relative;
    animation: santa-bob 0.9s ease-in-out infinite alternate;
  }
  @keyframes santa-bob {
    from { transform: translateY(-4px) rotate(-1.5deg); }
    to { transform: translateY(4px) rotate(1.5deg); }
  }
  .santa-svg {
    display: block;
    width: 340px;
    height: auto;
    filter: drop-shadow(0 6px 8px #0f2a3640);
  }
  .santa-svg .legs-front path,
  .santa-svg .legs-back path,
  .santa-svg .antler {
    stroke: #6b4423;
    stroke-width: 3.4;
    stroke-linecap: round;
    fill: none;
  }
  .santa-svg .antler {
    stroke-width: 2.4;
  }
  .santa-svg .legs-front,
  .santa-svg .legs-back {
    transform-box: fill-box;
    transform-origin: top center;
    animation: gallop 0.45s ease-in-out infinite alternate;
  }
  .santa-svg .legs-back {
    animation-delay: 0.22s;
  }
  @keyframes gallop {
    from { transform: rotate(-14deg); }
    to { transform: rotate(14deg); }
  }
  .santa-svg .nose {
    animation: nose 0.6s ease-in-out infinite alternate;
  }
  @keyframes nose {
    from { opacity: 0.6; }
    to { opacity: 1; }
  }
  .santa-svg .santa-arm {
    transform-box: fill-box;
    transform-origin: bottom left;
    animation: wave 0.5s ease-in-out infinite alternate;
  }
  @keyframes wave {
    from { transform: rotate(-12deg); }
    to { transform: rotate(14deg); }
  }
  .santa-say {
    position: absolute;
    top: -18px;
    left: 70px;
    padding: 4px 10px;
    border-radius: 12px 12px 12px 2px;
    background: #fff;
    color: #c8323a;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 12px #0f2a3626;
    opacity: 0;
    animation: say 10s linear forwards;
  }
  @keyframes say {
    0%, 22% { opacity: 0; transform: translateY(6px) scale(0.8); }
    28%, 62% { opacity: 1; transform: none; }
    70%, 100% { opacity: 0; transform: translateY(-4px); }
  }
  .santa-trail {
    position: relative;
    width: 120px;
    height: 40px;
    margin-right: -6px;
  }
  .santa-trail i {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffe9a8;
    box-shadow: 0 0 8px 2px #ffd56a;
    animation: sparkle 0.9s ease-in-out infinite alternate;
  }
  .santa-trail i:nth-child(1) { left: 110px; top: 22px; }
  .santa-trail i:nth-child(2) { left: 92px; top: 12px; animation-delay: 0.15s; }
  .santa-trail i:nth-child(3) { left: 76px; top: 28px; animation-delay: 0.3s; width: 4px; height: 4px; }
  .santa-trail i:nth-child(4) { left: 58px; top: 16px; animation-delay: 0.45s; }
  .santa-trail i:nth-child(5) { left: 40px; top: 30px; animation-delay: 0.6s; width: 4px; height: 4px; }
  .santa-trail i:nth-child(6) { left: 22px; top: 20px; animation-delay: 0.75s; width: 3px; height: 3px; }
  .santa-trail i:nth-child(7) { left: 6px; top: 26px; animation-delay: 0.9s; width: 3px; height: 3px; }
  @keyframes sparkle {
    from { opacity: 0.2; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1.2); }
  }
  .santa-gift {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 899;
    width: 18px;
    height: 16px;
    border-radius: 3px;
    pointer-events: none;
    background:
      linear-gradient(90deg, transparent 7px, #e2b04a 7px 11px, transparent 11px),
      linear-gradient(0deg, transparent 6px, #e2b04a 6px 10px, transparent 10px),
      #c8323a;
    transform: translate(var(--x), var(--y));
    animation: gift-fall 2.6s cubic-bezier(0.45, 0, 0.8, 0.6) forwards;
  }
  .santa-gift.g1 { background-color: #2e9e6f; }
  .santa-gift.g2 { background-color: #3b82f6; }
  @keyframes gift-fall {
    0% { transform: translate(var(--x), var(--y)) rotate(0); opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translate(calc(var(--x) + 60px), calc(var(--y) + 55vh)) rotate(320deg); opacity: 0; }
  }

  @media (max-width: 900px) {
    body.xmas .xmas-card {
      grid-template-columns: auto minmax(0, 1fr);
    }
    .ny-count {
      grid-column: 1 / -1;
      min-width: 0;
    }
    .santa-svg {
      width: 240px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .santa-fly,
    .santa-gift {
      display: none !important;
    }
    body.xmas .xmas-tree * {
      animation: none !important;
    }
  }

  @media (max-width: 900px) {
    body.xmas:not(.auth-mode) .xmas-lights {
      margin: -18px -16px 10px;
    }
    body.xmas .xmas-card {
      grid-template-columns: auto minmax(0, 1fr);
    }
    .xmas-days {
      grid-column: 1 / -1;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    body.xmas .xmas-lights::after {
      animation: none;
      opacity: 0.7;
    }
  }
}
@media print {
  .xmas-lights,
  .xmas-hat,
  .xmas-snow,
  .xmas-card,
  #xmas-toggle {
    display: none !important;
  }
}
