/*
 * ui-polish.css — Cross-page UI improvements for both dark and light themes
 * Drop as: app/static/css/ui-polish.css
 * Load AFTER layout.css and fixes.css in base.html
 */

/* ═══════════════════════════════════════════════════════════
   GLOBAL SMOOTH TRANSITIONS — applied to interactive elements only
   (wildcard * rule removed to prevent animation jank)
═══════════════════════════════════════════════════════════ */
.card, .quest, .news-item, .item-card, .staff-card,
.rb-item-card, .rb-selected-card, .toplayer-row, .prow,
.op-link, .nitem, .activity-item {
  transition: background-color 0.18s ease, border-color 0.2s ease,
              transform 0.18s ease, box-shadow 0.2s ease, color 0.18s ease;
}

/* ═══════════════════════════════════════════════════════════
   FOCUS RING — accessible but styled
═══════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--rust2);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHY IMPROVEMENTS
═══════════════════════════════════════════════════════════ */
body {
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════
   IMPROVED SCROLLBARS (dark mode)
═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.03); border-radius: 999px; }
::-webkit-scrollbar-thumb { background: rgba(196,68,10,.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232,92,26,.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(196,68,10,.28) transparent; }

/* ═══════════════════════════════════════════════════════════
   TOPBAR IMPROVEMENTS
═══════════════════════════════════════════════════════════ */
.topbar {
  gap: 10px;
}
.topbar-user {
  transition: border-color .18s ease, background .18s ease;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR IMPROVEMENTS
═══════════════════════════════════════════════════════════ */
.sn-link {
  border-radius: 0;
  overflow: hidden;
}
/* Subtle glow on active link */
.sn-link.active::before {
  box-shadow: 0 0 10px var(--rust2), 0 0 20px rgba(232,92,26,.3);
}

/* ═══════════════════════════════════════════════════════════
   CARD TOP-ACCENT LINES — consistent across all pages
═══════════════════════════════════════════════════════════ */
.list-box {
  position: relative;
  overflow: hidden;
}
.list-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rust2) 40%, var(--rust3) 65%, transparent);
  opacity: .45;
  pointer-events: none;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   PAGE-HERO IMPROVEMENTS
═══════════════════════════════════════════════════════════ */
.page-hero {
  position: relative;
}
.page-hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brust) 30%, var(--brust) 70%, transparent);
  opacity: .6;
}

/* sec-head h2 font-size removed — layout.css 1rem value is correct */

/* ═══════════════════════════════════════════════════════════
   BUTTON CONSISTENCY
═══════════════════════════════════════════════════════════ */
.hbtn-primary {
  letter-spacing: .12em;
}
.hbtn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   LEADERBOARD PAGE IMPROVEMENTS
═══════════════════════════════════════════════════════════ */
.namecol .player-link {
  letter-spacing: .03em;
}
/* Consistent rank number styling */
.rankcol {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   ITEMS PAGE — image grid polish
═══════════════════════════════════════════════════════════ */
.item-img {
  image-rendering: -webkit-optimize-contrast;
}
/* Better quest link box typography */
.box-title {
  letter-spacing: .1em;
  margin-bottom: 6px;
}
.ql-list li {
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   QUESTS — better card spacing
═══════════════════════════════════════════════════════════ */
.quest {
  line-height: 1.5;
}
.quest-title {
  letter-spacing: .04em;
  margin-bottom: 2px;
}
/* Image grid spacing fix */
.rewards {
  gap: 8px;
  margin-top: 10px;
}
.reward {
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
}
.reward:hover {
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   BUGS PAGE — table row hover improvement
═══════════════════════════════════════════════════════════ */
.bugs-table tbody tr {
  transition: background .12s ease;
}
.icon {
  transition: background .15s ease, border-color .15s ease;
}

/* ═══════════════════════════════════════════════════════════
   RAIDABLE BOATS — modal polish
═══════════════════════════════════════════════════════════ */
.rb-modal-backdrop {
  transition: opacity .2s ease;
}
.rb-modal {
  transform: translateY(0);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rb-modal-backdrop:not(.is-open) .rb-modal {
  transform: translateY(8px);
}

/* ═══════════════════════════════════════════════════════════
   PLAYER CARD — column gap fix on small screens
═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .pc-cols {
    grid-template-columns: 1fr !important;
  }
  .pc-kbg {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   TEAM PAGE — avatar shadow fix
═══════════════════════════════════════════════════════════ */
.sc-avatar {
  transition: box-shadow .2s ease, border-color .2s ease;
}
.staff-card:hover .sc-avatar {
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ═══════════════════════════════════════════════════════════
   NEWS PAGE — image aspect ratio lock
═══════════════════════════════════════════════════════════ */
.news-img-wrap {
  min-height: 200px;
  max-height: 320px;
  overflow: hidden;
}
.news-img {
  transition: opacity .3s ease, transform .4s ease;
}
.news-item:hover .news-img {
  transform: scale(1.02);
}

/* ═══════════════════════════════════════════════════════════
   ONLINE PLAYERS WIDGET — improved border highlight
═══════════════════════════════════════════════════════════ */
.op-widget::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rust2) 45%, transparent);
  opacity: .55;
}

/* ═══════════════════════════════════════════════════════════
   WIPE COUNTDOWN — pulse on seconds digit
═══════════════════════════════════════════════════════════ */
.wipe-num {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   HERO STAT STRIP — smoother counters
═══════════════════════════════════════════════════════════ */
.hs-val {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE MOBILE-LOGO improvements
═══════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  .hero-mobile-logo {
    box-shadow: 0 4px 20px rgba(196,68,10,.18);
  }
}

/* ═══════════════════════════════════════════════════════════
   PILL / BADGE CONSISTENCY
═══════════════════════════════════════════════════════════ */
.feat-kicker,
.news-kicker,
.nmi-badge,
.nbadge {
  letter-spacing: .12em;
}

/* ═══════════════════════════════════════════════════════════
   SECTION CARD HOVER — subtle lift for ALL cards
═══════════════════════════════════════════════════════════ */
.card,
.wipe-card,
.activity-card,
.connect-card,
.toplayer-card,
.bases-card {
  will-change: transform, box-shadow;
}

/* ═══════════════════════════════════════════════════════════
   PRINT — minimal styles
═══════════════════════════════════════════════════════════ */
@media print {
  .sidenav, .topbar, .mobile-bar, .op-widget, .radio-wrap, .radio-toggle { display: none !important; }
  .g-main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
}
