/* ══════════════════════════════════════════
   Auth-check skeleton loader
   Shown only when logged_in hint cookie is
   present AND /api/auth/me takes > 300ms.
   Mirrors the exact Today view structure so
   content arrival is visually continuous.
══════════════════════════════════════════ */

/* ── Container ── */
#skeleton {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; flex-direction: column;
  opacity: 0;
  transition: opacity 0.15s ease-out;
  pointer-events: none;
}
#skeleton.visible { opacity: 1; }
#skeleton.hiding  { opacity: 0; transition-duration: 0.2s; }

/* ── Base shimmer block ── */
.sk-block {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--rsm);
  overflow: hidden;
  flex-shrink: 0;
}
.sk-block::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    transparent           0%,
    rgba(255,255,255,.07) 50%,
    transparent           100%
  );
  transform: translateX(-100%);
  animation: sk-shimmer 1.5s linear infinite;
}
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }

/* ── Reduced motion: static blocks, no shimmer ── */
@media (prefers-reduced-motion: reduce) {
  .sk-block::after { display: none; }
  .sk-block        { background: rgba(255, 255, 255, 0.05); }
  #skeleton        { transition: none; }
}

/* ══════════════════════════════════════════
   TOPBAR — mirrors .topbar
   Order: burger | logo-icon | brand-name | class-pill | [spacer] | clock | notif
   (user-pill and logout-btn are display:none in the real app)
══════════════════════════════════════════ */
.sk-topbar {
  height: 3.5rem; flex-shrink: 0;
  background: rgba(8, 8, 8, 0.92);
  border-bottom: 1px solid var(--b1);
  display: flex; align-items: center;
  padding: 0 1.25rem; gap: 0.75rem;
}

/* Burger — 3 static lines, no shimmer (structural affordance) */
.sk-burger {
  width: 2.5rem; height: 2.5rem; flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.3125rem;
}
.sk-burger-line {
  width: 1.25rem; height: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.sk-topbar-icon  { width: 1.75rem; height: 1.75rem; border-radius: 0.4375rem; }
.sk-topbar-name  { width: 5rem; height: 0.875rem; border-radius: var(--rxs); }
.sk-topbar-pill  { width: 1.75rem; height: 1.375rem; border-radius: 99px; }
.sk-topbar-spacer { flex: 1; }
.sk-topbar-clock { width: 3.5rem; height: 0.75rem; border-radius: var(--rxs); }
.sk-topbar-notif { width: 2.25rem; height: 2.25rem; border-radius: var(--rxs); }

/* ══════════════════════════════════════════
   CONTENT AREA — mirrors .content-area
══════════════════════════════════════════ */
.sk-content {
  flex: 1; overflow: hidden;
  padding: 1.75rem 1.5rem;
  max-width: 75rem; width: 100%; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* ── Greeting row — mirrors .greeting-row (flex, text left / day-picker right) ── */
.sk-greeting-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
  margin-bottom: 0; /* gap on sk-content handles spacing */
}
.sk-greeting-text {
  display: flex; flex-direction: column; gap: 0.4375rem;
}
/* h2 mirror: font-size 1.3125rem, font-weight 700 */
.sk-greeting-h2  { width: 14rem; height: 1.4rem; border-radius: var(--rxs); }
/* p mirror: font-size 0.8125rem */
.sk-greeting-p   { width: 9rem;  height: 0.8125rem; border-radius: var(--rxs); }

/* Day picker mirror: .day-picker (card with padding, border-radius var(--r)) */
.sk-day-picker-pill {
  width: 15.5rem; height: 2.5rem;
  border-radius: var(--r);
}

/* ── Stat chips — mirrors .today-stats (3-col grid) + .stat-chip (card) ── */
.sk-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem;
}
.sk-stat-card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--rsm); padding: 1rem 1.125rem;
  display: flex; flex-direction: column; gap: 0.375rem;
}
/* .stat-chip-val mirror: font-size 1.5rem */
.sk-stat-val { width: 2.25rem; height: 1.5rem; border-radius: var(--rxs); }
/* .stat-chip-lbl mirror: font-size 0.71875rem */
.sk-stat-lbl { width: 4.5rem;  height: 0.71875rem; border-radius: var(--rxs); }

/* ── Today grid — mirrors .today-grid (1fr 18.75rem) ── */
.sk-today-grid {
  display: grid; grid-template-columns: 1fr 18.75rem; gap: 1.75rem;
  flex: 1;
}
.sk-col {
  display: flex; flex-direction: column; gap: 0.5rem;
}
/* section-label mirror */
.sk-section-label {
  width: 8rem; height: 0.75rem; border-radius: var(--rxs);
  margin-bottom: 0.25rem;
}

/* ── Timeline items — mirrors .tl-item (flex: bar + time + body) ── */
.sk-tl-item {
  display: flex; gap: 0.75rem; align-items: stretch;
  padding: 0.875rem 1rem;
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--rsm);
}
.sk-tl-item--dim { opacity: 0.45; }

/* .tl-bar mirror: 3px wide colored stripe */
.sk-tl-bar {
  width: 3px; border-radius: 99px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

/* .tl-time mirror: 3.125rem wide, tabular */
.sk-tl-time {
  width: 3.125rem; height: 2.5rem; flex-shrink: 0;
  border-radius: var(--rxs);
}

/* .tl-body mirror */
.sk-tl-body {
  flex: 1; display: flex; flex-direction: column;
  gap: 0.375rem; justify-content: center;
}
/* .tl-subj: 0.875rem bold */
.sk-tl-subj { width: 60%; height: 0.875rem; border-radius: var(--rxs); }
/* .tl-meta: 0.75rem, var(--t3) */
.sk-tl-meta { width: 40%; height: 0.75rem; border-radius: var(--rxs); }

/* ── Deadline cards — mirrors .dl-card (flex: datebox + info + chip) ── */
.sk-dl-card {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.875rem 1rem;
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--rsm);
}
.sk-dl-card--dim { opacity: 0.5; }

/* .dl-datebox mirror: 2.5rem wide card */
.sk-dl-datebox {
  width: 2.5rem; height: 3rem; flex-shrink: 0;
  border-radius: var(--rxs);
}

/* .dl-info mirror */
.sk-dl-info {
  flex: 1; display: flex; flex-direction: column;
  gap: 0.375rem; justify-content: center;
}
/* .dl-title: 0.8125rem bold */
.sk-dl-title { width: 70%; height: 0.8125rem; border-radius: var(--rxs); }
/* .dl-sub: 0.71875rem */
.sk-dl-sub   { width: 50%; height: 0.71875rem; border-radius: var(--rxs); }
/* .dl-away: 0.6875rem */
.sk-dl-away  { width: 30%; height: 0.6875rem; border-radius: var(--rxs); }

/* .dl-chip mirror: pill badge */
.sk-dl-chip {
  width: 3.75rem; height: 1.25rem;
  border-radius: 99px; flex-shrink: 0;
  align-self: flex-start;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

/* Collapse today-grid to single column on narrow viewports */
@media (max-width: 820px) {
  .sk-today-grid { grid-template-columns: 1fr; }
  /* Hide deadline column on small screens (real app probably collapses too) */
  .sk-col:last-child { display: none; }
}

@media (max-width: 600px) {
  .sk-content           { padding: 0.875rem; }
  .sk-topbar            { padding: 0 0.875rem; gap: 0.5rem; }
  .sk-topbar-clock      { display: none; }
  .sk-greeting-h2       { width: 10rem; }
  .sk-greeting-p        { width: 7rem; }
  .sk-day-picker-pill   { width: 10rem; }
  .sk-stats-grid        { gap: 0.5rem; }
  .sk-stat-val          { width: 1.75rem; }
  .sk-stat-lbl          { width: 3.5rem; }
}
