/* My Day apps-grid bottom sheet — component styles.
 *
 * Extracted from my-day.css (same split as myday-id-sheet.css) so the
 * standalone My Day fragments (my_day_teacher.html / my_schedule.html) that
 * do NOT pull in my-day.css still get the sheet's fixed-position slide-up
 * styles. Without it the sheet renders in normal document flow — a giant
 * unstyled icon list at the page bottom — and "More" appears to do nothing.
 *
 * Wired by myday-apps-sheet.js; swipe-to-dismiss by myday-sheet-drag.js.
 */

/* ── Apps-grid bottom sheet (May 15) ───────────────────────────
 * Slide-up sheet revealed when the "More" tile is tapped on the
 * My Day quick-action row. Pattern modeled on the Chevy app's
 * apps-grid sheet (maintainer May 15 reference). Backdrop +
 * panel; panel slides from below on `.is-open`. Inside: a grid
 * of soft-tint icon rows (the `.myday-apps-row` recipe shares
 * the same accent system as the dock + dashboard tiles).
 *────────────────────────────────────────────────────────────── */
.myday-apps-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  /* visibility:hidden when closed so the (still-DOM) app links/buttons leave
     the keyboard tab order — opacity+pointer-events alone let Tab focus leak
     into the invisible sheet (Gemini #1190). Transitioned so the fade-out
     finishes before it's hidden. */
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
.myday-apps-sheet.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}
.myday-apps-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.myday-apps-sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--brand-paper, #fff);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 40px -8px rgba(15, 23, 42, 0.32);
  padding: 8px 16px max(16px, env(safe-area-inset-bottom, 16px));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.32, 1);
}
.myday-apps-sheet.is-open .myday-apps-sheet-panel { transform: translateY(0); }
html.dark .myday-apps-sheet-panel {
  background: #0d1626;
  box-shadow: 0 -16px 40px -8px rgba(0, 0, 0, 0.55);
}

/* Drag handle — flow element at the panel top; mobile slide-up affordance
   only (hidden on desktop, where the panel is a centered modal). */
.myday-apps-sheet-handle {
  display: block;
  width: 40px; height: 4px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
}
html.dark .myday-apps-sheet-handle { background: rgba(255, 255, 255, 0.20); }

/* Accent navy hero header — the signature aurora-on-navy surface. The navy
   base is constant; the glow is palette-driven (--accent), so the hero
   follows the chosen brand colour rather than a hardcoded ice. */
.myday-apps-sheet-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin: 0 0 12px;
  padding: 18px 20px;
  border-radius: 16px;
  /* Solid navy fallback first — if color-mix() isn't supported the browser
     drops the whole gradient declaration, which would leave light text on a
     default white panel (Gemini #1190). */
  background: #0E1A33;
  background:
    radial-gradient(120% 140% at 100% -20%, color-mix(in srgb, var(--accent, #2563EB) 32%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, #0E1A33 0%, #0A1224 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #ECF2FF;
}
.myday-apps-sheet-title {
  margin: 0;
  font: 400 24px/1 'Instrument Serif', Georgia, serif;
  letter-spacing: -0.01em;
  color: #ECF2FF;
}
.myday-apps-sheet-title em {
  font-style: italic;
  color: color-mix(in srgb, var(--accent, #38BDF8) 60%, #ffffff);
}
.myday-apps-sheet-sub {
  margin: 5px 0 0;
  font: 400 13px/1.4 var(--brand-font-body, system-ui);
  color: rgba(220, 232, 255, 0.62);
}
.myday-apps-sheet-close {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.10);
  border: 0;
  border-radius: 999px;
  color: #ECF2FF;
  cursor: pointer;
  transition: background 0.12s;
}
.myday-apps-sheet-close:hover { background: rgba(255, 255, 255, 0.18); }
.myday-apps-sheet-close svg { width: 18px; height: 18px; }

.myday-apps-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 6px 0 16px;
}
@media (min-width: 640px) {
  .myday-apps-sheet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.myday-apps-row {
  display: flex; align-items: center; gap: 12px;
  /* border-box so the hover border thickening (0.5px → 2px) doesn't change the
     tile's outer size — the grid stays put, the content just insets ~1.5px. */
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 14px;
  text-decoration: none;
  background: var(--brand-paper-2, rgba(15, 23, 42, 0.04));
  border: 0.5px solid var(--border-hairline, rgba(15, 23, 42, 0.08));
  color: var(--brand-ink-1, #0F172A);
  transition: transform 0.12s, border-color 0.12s, border-width 0.12s, background 0.12s;
}
html.dark .myday-apps-row {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}
.myday-apps-row:hover, .myday-apps-row:focus-visible {
  transform: translateY(-1px);
  /* Thicker accent borderline on hover (maintainer Jun 7). */
  border-width: 2px;
  border-color: var(--brand-teal-line, rgba(37, 214, 173, 0.45));
  outline: none;
}
.myday-apps-row-glyph {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;       /* was 40 — bumped to match the bigger row glyph (May 15) */
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}
.myday-apps-row-glyph svg { width: 28px; height: 28px; }   /* was 22 */
.myday-apps-row-label {
  font: 600 14px/1.2 var(--brand-font-body, system-ui);
  letter-spacing: -0.005em;
}

/* Per-accent soft-tint — same recipe as everywhere else.
 * Light: deep stroke / Dark: bright stroke. */
.myday-apps-row.mdar--teal    .myday-apps-row-glyph { background: rgba(37, 214, 173, 0.18);  color: #0F8A6B; }
.myday-apps-row.mdar--emerald .myday-apps-row-glyph { background: rgba(52, 211, 153, 0.18);  color: #047857; }
.myday-apps-row.mdar--amber   .myday-apps-row-glyph { background: rgba(251, 191, 36, 0.18);  color: #b45309; }
.myday-apps-row.mdar--rose    .myday-apps-row-glyph { background: rgba(251, 113, 133, 0.18); color: #be123c; }
.myday-apps-row.mdar--sky     .myday-apps-row-glyph { background: rgba(56, 189, 248, 0.18);  color: #0369a1; }
.myday-apps-row.mdar--violet  .myday-apps-row-glyph { background: rgba(167, 139, 250, 0.18); color: #6d28d9; }
.myday-apps-row.mdar--indigo  .myday-apps-row-glyph { background: rgba(129, 140, 248, 0.18); color: #4f46e5; }
.myday-apps-row.mdar--cyan    .myday-apps-row-glyph { background: rgba(34, 211, 238, 0.18);  color: #0e7490; }
.myday-apps-row.mdar--slate   .myday-apps-row-glyph { background: rgba(148, 163, 184, 0.18); color: #475569; }
html.dark .myday-apps-row.mdar--teal    .myday-apps-row-glyph { color: #25D6AD; }
html.dark .myday-apps-row.mdar--emerald .myday-apps-row-glyph { color: #6ee7b7; }
html.dark .myday-apps-row.mdar--amber   .myday-apps-row-glyph { color: #fcd34d; }
html.dark .myday-apps-row.mdar--rose    .myday-apps-row-glyph { color: #fda4af; }
html.dark .myday-apps-row.mdar--sky     .myday-apps-row-glyph { color: #7dd3fc; }
html.dark .myday-apps-row.mdar--violet  .myday-apps-row-glyph { color: #c4b5fd; }
html.dark .myday-apps-row.mdar--indigo  .myday-apps-row-glyph { color: #a5b4fc; }
html.dark .myday-apps-row.mdar--cyan    .myday-apps-row-glyph { color: #67e8f9; }
html.dark .myday-apps-row.mdar--slate   .myday-apps-row-glyph { color: #cbd5e1; }

/* ── Desktop: centered modal instead of a slide-up sheet ──────────────
 * Maintainer Jun 6: "on desktop launch more apps as a page in the middle
 * rather than sliding up; keep [the slide-up] for mobile." At >=1024px the
 * panel is centered in the viewport and fades + scales in; the drag handle
 * is hidden. Below 1024px the bottom-sheet slide-up above is unchanged. */
@media (min-width: 1024px) {
  .myday-apps-sheet-panel {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(720px, 92vw);
    max-height: min(82vh, 780px);
    border-radius: 22px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
    transform: translate(-50%, -50%) scale(0.96);
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0.32, 1);
  }
  .myday-apps-sheet.is-open .myday-apps-sheet-panel {
    transform: translate(-50%, -50%) scale(1);
  }
  .myday-apps-sheet-handle { display: none; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  /* No scale animation under reduced motion — pin the panel at scale(1) in
     both states so it only fades in via the parent (Gemini #1190). */
  .myday-apps-sheet-panel,
  .myday-apps-sheet.is-open .myday-apps-sheet-panel {
    transform: translate(-50%, -50%) scale(1);
    transition: none;
  }
}
