/* ───────── Global ───────── */
html, body {
  text-align: left;
  font-size: var(--font-size-sm);
  color: var(--color-white);
  font-family: var(--font-work-sans);
}

body {
  background-image: url('https://files.supernova-analytics.com/sn-app-icons/Profile/Page-Background-dark.png');
  background-size: cover;
  background-position: center;
  background-repeat: repeat;
  background-attachment: fixed;
}

@keyframes wep-spin-center {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}
@keyframes wep-spin {
  to { transform: rotate(360deg); }
}

/* ───────── Page shell ───────── */
.weapons-page {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(0, 1fr);

  position: relative;
  width: calc(100% - 112px);
  top: 72px;
  left: 90px;
  padding-bottom: 48px;
}

/* ───────── Toolbar ───────── */
.weapons-toolbar {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-left { flex: 1; min-width: 200px; }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.input-with-icon {
  display: grid;
  grid-template-columns: 18px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(28,28,36,.5);
}

.input-with-icon input {
  border: 0; outline: 0; background: transparent; color: #fff; min-width: 220px;
}

.select { position: relative; }
.select select {
  border-radius: 8px;
  padding: 8px 28px 8px 10px;
  color: #fff;
  background: rgba(28,28,36,.5);
  border: 1px solid rgba(255,255,255,.12);
  appearance: none;
  background-image: url('/public/ui/icon-chev-down.svg');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  cursor: pointer;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cfd3dc;
  cursor: pointer;
  user-select: none;
}

.toggle-label input { cursor: pointer; accent-color: #7b5897; }

/* ───────── Meta line ───────── */
.weapons-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #aeb6c2;
  min-height: 18px;
}

/* ───────── Grid ───────── */
.weapons-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  justify-content: start;
  align-content: start;
  position: relative;
  min-height: 260px;
  padding-bottom: 40px;
}

.weapons-grid > * { min-width: 0; }

/* Loading overlay */
.weapons-grid.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(18,20,26,.25);
  backdrop-filter: blur(2px);
  z-index: 1;
}

.weapons-grid.is-loading::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: #7b5897;
  animation: wep-spin-center .9s linear infinite;
  z-index: 2;
}

/* ───────── Weapon Card ───────── */
.weapon-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(28,28,36,.5), rgba(28,28,36,.92));
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  min-width: 0;
}

.weapon-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

/* Tier border accents */
.weapon-card.tier-exotic    { border-color: rgba(206,174,51,.35); }
.weapon-card.tier-legendary { border-color: rgba(123,88,151,.35); }
.weapon-card.tier-rare      { border-color: rgba(80,118,163,.35); }

.weapon-card.tier-exotic:hover    { border-color: rgba(206,174,51,.7); box-shadow: 0 6px 24px rgba(206,174,51,.15); }
.weapon-card.tier-legendary:hover { border-color: rgba(123,88,151,.7); box-shadow: 0 6px 24px rgba(123,88,151,.15); }

/* Weapon icon — square with watermark overlay */
.weapon-icon {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.weapon-icon img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.weapon-icon.icon-fallback {
  background: rgba(255,255,255,.06);
}

/* Expansion/season watermark — bottom-right corner overlay */
.icon-watermark {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Adept badge — top-right pip */
.badge-adept {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(206,174,51,.85);
  color: #1a1200;
  line-height: 1.4;
  pointer-events: none;
}

/* Card body */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.weapon-name {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weapon-type {
  font-size: 11px;
  color: #aeb6c2;
}

.card-stats {
  display: flex;
  gap: 8px;
  font-size: 12px;
  margin-top: 4px;
}

.stat-kills { color: #e9edf3; font-weight: 600; }
.stat-prec  { color: #aeb6c2; }

.card-unused {
  color: #5a606c;
  font-style: italic;
}

/* ───────── Chips (shared with detail page) ───────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* Damage type chips */
.dmg-kinetic { background: rgba(200,200,200,.12); border-color: rgba(200,200,200,.25); color: #d6d8dc; }
.dmg-arc     { background: rgba(121,199,227,.12); border-color: rgba(121,199,227,.35); color: #79c7e3; }
.dmg-solar   { background: rgba(240,99,31,.12);   border-color: rgba(240,99,31,.35);   color: #f0631f; }
.dmg-void    { background: rgba(177,133,223,.12); border-color: rgba(177,133,223,.35); color: #b185df; }
.dmg-stasis  { background: rgba(79,145,195,.12);  border-color: rgba(79,145,195,.35);  color: #4f91c3; }
.dmg-strand  { background: rgba(109,192,92,.12);  border-color: rgba(109,192,92,.35);  color: #6dc05c; }

/* Ammo chips */
.chip-ammo { }
.ammo-primary { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: #cfd3dc; }
.ammo-special { background: rgba(72,198,148,.10);  border-color: rgba(72,198,148,.3);   color: #48c694; }
.ammo-heavy   { background: rgba(214,89,89,.10);   border-color: rgba(214,89,89,.3);    color: #d65959; }

/* Tier chip (detail page) */
.chip-tier { }
.tier-exotic    { background: rgba(206,174,51,.12); border-color: rgba(206,174,51,.4); color: #ceae33; }
.tier-legendary { background: rgba(123,88,151,.12); border-color: rgba(123,88,151,.4); color: #b07fd4; }
.tier-rare      { background: rgba(80,118,163,.12); border-color: rgba(80,118,163,.4); color: #5076a3; }

.chip-wtype {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: #cfd3dc;
}

@media (max-width: 1200px) {
  .weapons-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 900px) {
  .weapons-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ══════════════════════════════════════════════════════════════════════
   MARKETING DEMO DEVIATIONS — everything above this line is a byte-for-byte
   copy of the app's css/destiny-2/weapons.css. The rules below are the only
   ones written for the static port, and they exist solely because the demo
   has no app chrome and no /public asset folder.

     1. Vertical offset. The app reserves 72px for its real header; the demo's
        sticky .sn-report-topbar is ~57px, so the page shifts up. Same change
        analytics.html's demo-overrides.css makes to .widget-container.

     2. Select chevron. The app points at /public/ui/icon-chev-down.svg, which
        does not ship with the marketing site. Inlined as a data URI so the
        control keeps its arrow with no extra request and no new asset file.
   ══════════════════════════════════════════════════════════════════════ */

/* --- 1. Offset ----------------------------------------------------- */
.weapons-page {
  top: 20px;
}

/* --- 2. Select chevron --------------------------------------------- */
.select select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23cfd3dc' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* --- 3. Search icon sizing ----------------------------------------- */
/* The app's icon-search.svg is intrinsically 18px; the inlined replacement in
   weapons.html is a bare <svg>, so give it the same box the grid column expects. */
.input-with-icon > svg {
  width: 18px;
  height: 18px;
  display: block;
  color: #aeb6c2;
}
