/* ═══════════════════════════════════════════════════════════════════════════
   CruiseDucky — UI Kit
   /public_html/assets/css/cd-ui.css

   ONE design language for the whole site. Every page that adopts these classes
   stops inventing its own cards, headers and chips — which is what made the app
   feel like several apps stitched together.

   Load AFTER app.css. It only ADDS classes (all prefixed .cd-), so nothing that
   already exists can break.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Radius scale — four values, not sixteen */
  --cd-r-sm:   12px;   /* inputs, small chips, thumbnails */
  --cd-r-md:   16px;   /* cards */
  --cd-r-lg:   20px;   /* heroes, panels */
  --cd-r-pill: 999px;  /* chips, buttons */

  /* Elevation */
  --cd-shadow-sm: 0 2px 8px  rgba(13, 27, 42, .06);
  --cd-shadow-md: 0 6px 20px rgba(13, 27, 42, .09);
  --cd-shadow-lg: 0 14px 40px rgba(13, 27, 42, .16);

  /* The brand gradient — used by every page hero */
  --cd-hero-bg: linear-gradient(135deg, var(--navy) 0%, #14355c 55%, var(--ocean) 100%);
}

/* ─── PAGE HERO ────────────────────────────────────────────────────────────
   The single most important component: every page opens the same way.      */
.cd-hero {
  position: relative;
  background: var(--cd-hero-bg);
  border-radius: var(--cd-r-lg);
  padding: 22px 20px 30px;
  margin-bottom: var(--space-lg);
  overflow: hidden;
  color: #fff;
}
.cd-hero::after {                    /* the wave that ties it to the page */
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 22px;
  background: var(--bg-page);
  clip-path: ellipse(60% 100% at 50% 100%);
}
.cd-hero--onCard::after { background: var(--bg-card); }
.cd-hero__bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cd-hero__bubbles span {
  position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .05);
}
.cd-hero__inner { position: relative; z-index: 1; }
.cd-hero__back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 600;
  color: rgba(255, 255, 255, .6); text-decoration: none;
  margin-bottom: 10px;
}
.cd-hero__back:hover { color: #fff; text-decoration: none; }
.cd-hero__row { display: flex; align-items: flex-start; gap: 14px; }
.cd-hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.35rem; line-height: 1.15; letter-spacing: -.02em;
  margin: 0; color: #fff;
}
.cd-hero__sub {
  font-size: .82rem; color: rgba(255, 255, 255, .6);
  margin-top: 3px; line-height: 1.45;
}
.cd-hero__actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* Avatar in a hero */
.cd-hero__avatar {
  width: 54px; height: 54px; border-radius: 14px;
  object-fit: cover; flex-shrink: 0;
  border: 2.5px solid var(--duck-yellow);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

/* ─── CHIPS ──────────────────────────────────────────────────────────────── */
.cd-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  padding: 5px 12px; border-radius: var(--cd-r-pill);
  background: var(--foam); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.cd-chip--onHero {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .2);
  color: #fff; backdrop-filter: blur(4px);
}
.cd-chip--gold   { background: linear-gradient(135deg, #F5C518, #E8A000); border: none; color: var(--navy); }
.cd-chip--green  { background: rgba(34, 197, 94, .14);  border-color: rgba(34, 197, 94, .4);  color: #15803d; }
.cd-chip--blue   { background: rgba(27, 108, 168, .12); border-color: rgba(27, 108, 168, .3); color: var(--ocean); }
.cd-chip--amber  { background: rgba(245, 197, 24, .16); border-color: rgba(245, 197, 24, .45); color: #8a6d00; }
.cd-chip--muted  { background: var(--bg-page); color: var(--text-muted); }

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.cd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--cd-r-md);
  box-shadow: var(--cd-shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-md);
}
.cd-card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.cd-card__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: .95rem; color: var(--text-primary);
}
.cd-card__head .cd-card__title + * { margin-left: auto; }
.cd-card__body { padding: 16px; }
.cd-card__body--flush { padding: 0; }

/* Icon bubble — the emoji treatment used across the app */
.cd-ico {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--cd-r-sm);
  background: var(--foam); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; line-height: 1;
}
.cd-ico--amber { background: rgba(245, 197, 24, .16); border-color: rgba(245, 197, 24, .4); }
.cd-ico--green { background: rgba(34, 197, 94, .12);  border-color: rgba(34, 197, 94, .3); }
.cd-ico--blue  { background: rgba(27, 108, 168, .1);  border-color: rgba(27, 108, 168, .28); }

/* ─── PANELS (tinted info blocks: hints, notes, callouts) ─────────────────── */
.cd-panel {
  border-radius: var(--cd-r-sm);
  padding: 13px 15px;
  border: 1px solid var(--border);
  background: var(--foam);
}
.cd-panel__label {
  font-size: .66rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 5px;
}
.cd-panel--amber { background: rgba(245, 197, 24, .08); border-color: rgba(245, 197, 24, .3); }
.cd-panel--blue  { background: rgba(27, 108, 168, .06); border-color: rgba(27, 108, 168, .22); }
.cd-panel--green { background: rgba(34, 197, 94, .07);  border-color: rgba(34, 197, 94, .28); }

/* ─── STATS ROW ──────────────────────────────────────────────────────────── */
.cd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.cd-stat {
  background: var(--foam); border: 1px solid var(--border);
  border-radius: var(--cd-r-sm); padding: 11px 6px 9px; text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cd-stat:hover { transform: translateY(-2px); box-shadow: var(--cd-shadow-md); }
.cd-stat__value { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--navy); line-height: 1; }
.cd-stat__label { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-top: 4px; }

/* ─── BIG CODE DISPLAY (claim codes, serials) ────────────────────────────── */
.cd-code {
  font-family: var(--font-display); font-weight: 800;
  font-size: 2.3rem; letter-spacing: .22em;
  color: var(--navy);
  background: linear-gradient(135deg, rgba(245, 197, 24, .18), rgba(245, 197, 24, .05));
  border: 2px dashed var(--duck-yellow);
  border-radius: var(--cd-r-md);
  padding: 16px 22px 16px 30px;   /* extra left pad balances the letter-spacing */
  display: inline-block;
}

/* ─── EMPTY STATE ────────────────────────────────────────────────────────── */
.cd-empty { text-align: center; padding: 34px 20px; color: var(--text-muted); }
.cd-empty__icon { font-size: 2.6rem; line-height: 1; margin-bottom: 10px; opacity: .8; }
.cd-empty__title { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--text-secondary); margin-bottom: 4px; }
.cd-empty__desc { font-size: .84rem; line-height: 1.5; max-width: 300px; margin: 0 auto; }

/* ─── SKELETON LOADER ────────────────────────────────────────────────────── */
.cd-skel {
  background: linear-gradient(90deg, var(--foam) 25%, var(--border) 50%, var(--foam) 75%);
  background-size: 200% 100%;
  animation: cdSkel 1.4s ease-in-out infinite;
  border-radius: var(--cd-r-sm);
}
@keyframes cdSkel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── PHOTO GRID (photo-forward, not thumbnail-shy) ──────────────────────── */
.cd-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cd-photo {
  position: relative; aspect-ratio: 4 / 3;
  border-radius: var(--cd-r-sm); overflow: hidden;
  background: var(--foam); line-height: 0;
}
.cd-photo img {
  width: 100%; height: 100%; object-fit: cover;
  cursor: zoom-in; transition: transform .3s ease;
}
.cd-photo:hover img { transform: scale(1.05); }
.cd-photo__state {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--text-muted); font-size: .74rem; line-height: 1.3;
}
.cd-photo--wide { grid-column: span 2; }

/* ─── SECTION LABEL ──────────────────────────────────────────────────────── */
.cd-section {
  display: flex; align-items: center; gap: 8px;
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--text-muted);
  margin: var(--space-lg) 0 10px;
}
.cd-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 480px) {
  .cd-hero { padding: 18px 16px 26px; }
  .cd-hero__title { font-size: 1.15rem; }
  .cd-code { font-size: 1.75rem; padding: 13px 16px 13px 24px; }
}

/* ─── LEGACY BRIDGE ────────────────────────────────────────────────────────
   Gently pull pages still using the original .card / .empty-state classes
   into the kit's look — same radii, same shadow, same empty-state voice —
   without having to touch every page's markup. Additive and safe.        */
.card {
  border-radius: var(--cd-r-md);
  box-shadow: var(--cd-shadow-sm);
}
.empty-state { padding: 34px 20px; }
.empty-state__icon, .empty-state .icon { font-size: 2.6rem; opacity: .85; }
.empty-state__title { font-family: var(--font-display); font-weight: 800; }
.legend-tabs { gap: 6px; }
.cruise-hero__pill { border-radius: var(--cd-r-pill); }


/* ─── ACCESSIBILITY ────────────────────────────────────────────────────────
   Keyboard skip-link, visible focus rings, and reduced-motion support so the
   whole site is navigable without a mouse and comfortable for everyone.     */
.cd-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--navy, #0D1B2A); color: #fff;
  padding: 10px 18px; border-radius: 0 0 10px 0;
  font-weight: 700; text-decoration: none;
}
.cd-skip-link:focus { left: 0; }

/* A clear, consistent focus ring for keyboard users on every interactive thing.
   :focus-visible means mouse clicks don't get the ring, only keyboard nav. */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid var(--ocean, #1B6CA8);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Screen-reader-only helper */
.cd-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── "MY DUCKS" NAV BUTTON ────────────────────────────────────────────────
   A cute basket that wiggles, with a live count badge for ducks in hand.    */
.topnav__myducks { position: relative; }
.topnav__myducks .myducks-emoji {
  display: inline-block;
  transition: transform .2s ease;
}
.topnav__myducks:hover .myducks-emoji {
  animation: myducksWiggle .5s ease;
}
@keyframes myducksWiggle {
  0%,100% { transform: rotate(0) scale(1.05); }
  25%     { transform: rotate(-12deg) scale(1.12); }
  75%     { transform: rotate(12deg) scale(1.12); }
}
.myducks-badge {
  position: absolute; top: -3px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: linear-gradient(135deg, #F5C518, #E8A000);
  color: var(--navy); border: 2px solid var(--bg-card, #fff);
  border-radius: 999px;
  font-size: .62rem; font-weight: 800; line-height: 13px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(232,160,0,.4);
  animation: myducksPop .3s ease;
}
@keyframes myducksPop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .topnav__myducks:hover .myducks-emoji, .myducks-badge { animation: none; }
}


/* My Ducks dashboard tile (sits beside See Hints) */
.db-action--myducks {
  background: linear-gradient(135deg, rgba(245,197,24,.10), rgba(27,108,168,.06));
}
