/* ============================================================
   shared.css — ALL FIGHT Public Website
   Common styles shared across all pages
   ============================================================ */

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* Base */
body {
  background-color: #f0eeec;
  color: #1a1c20;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html { scroll-behavior: smooth; overflow-x: hidden; }

/* Scrollbar */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0);   }
}
@keyframes fadeIn {
  from { opacity: 0; filter: blur(3px); }
  to   { opacity: 1; filter: blur(0);   }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.anim-fade-in {
  opacity: 0;
  animation: fadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.anim-delay-1 { animation-delay: 0.08s; }
.anim-delay-2 { animation-delay: 0.18s; }
.anim-delay-3 { animation-delay: 0.3s;  }
.anim-delay-4 { animation-delay: 0.44s; }
.anim-delay-5 { animation-delay: 0.58s; }

/* Page transition */
body.page-exit {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.22s ease-in, transform 0.22s ease-in;
  pointer-events: none;
}

/* Card hover — index.html + events.html */
.event-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.event-card:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Fighter row hover — index.html + fighters.html */
.fighter-row { transition: background-color 0.25s ease; }

/* Animation flash fix — skip hero anims on back navigation */
.no-hero-anim .anim-fade-up,
.no-hero-anim .anim-fade-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
  filter: none !important;
  animation: none !important;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(4px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Nav */
.nav-link { transition: color 0.25s ease; }
.nav-link:hover { color: #bb152c; }

/* Primary button */
.btn-primary {
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:focus-visible { outline: 2px solid #bb152c; outline-offset: 2px; }

/* Store buttons (homepage) */
.btn-store {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-store:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 51, 56, 0.1);
}
.btn-store:active { transform: scale(0.98) translateY(0); }
.btn-store:focus-visible { outline: 2px solid #2d3338; outline-offset: 2px; }

/* CTA link (underline style) */
.cta-link { transition: color 0.2s ease, border-color 0.2s ease; }
.cta-link:hover { color: #a90022; border-color: #bb152c; }
.cta-link:focus-visible { outline: 2px solid #bb152c; outline-offset: 2px; }

/* Back button */
.back-btn { transition: color 0.2s ease; }
.back-btn:hover { color: #bb152c; }

/* Fighter avatar gradients */
.avatar-gradient-1 { background: linear-gradient(135deg, #e4e9ee 0%, #dde3e9 100%); }
.avatar-gradient-2 { background: linear-gradient(135deg, #ebeef2 0%, #e4e9ee 100%); }
.avatar-gradient-3 { background: linear-gradient(135deg, #dde3e9 0%, #d3dbe2 100%); }

/* Fighter avatar gradients — dark zones */
.avatar-gradient-dark-1 { background: linear-gradient(135deg, #1e2535 0%, #161c2a 100%); }
.avatar-gradient-dark-2 { background: linear-gradient(135deg, #1a2030 0%, #141825 100%); }
.avatar-gradient-dark-3 { background: linear-gradient(135deg, #1c2232 0%, #161c28 100%); }

/* ---- Skeleton loading ---- */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #ebeef2 25%, #e4e9ee 50%, #ebeef2 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-dark {
  background: linear-gradient(90deg, #222527 25%, #292c2f 50%, #222527 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

/* Text selection */
::selection {
  background-color: #ffdad8;
  color: #a90022;
}

/* ---- Search overlay ---- */
.search-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(45, 51, 56, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.search-overlay-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
.search-overlay-panel {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 101;
  width: calc(100% - 1rem);
  max-width: 640px;
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 60px rgba(45, 51, 56, 0.12), 0 4px 16px rgba(45, 51, 56, 0.06);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
}
.search-overlay-panel.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ---- Fight Modal ---- */
.fight-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(45, 51, 56, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.fight-modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
.fight-modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -47%) scale(0.975);
  z-index: 201;
  width: calc(100% - 2rem);
  max-width: 1100px;
  max-height: 94vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 32px 80px rgba(45, 51, 56, 0.16), 0 8px 24px rgba(45, 51, 56, 0.08);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  pointer-events: none;
  scrollbar-width: none;
}
.fight-modal-panel::-webkit-scrollbar { display: none; }
.fight-modal-panel.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* ---- Fight Modal — inner components ---- */

/* Top bar */
.fm2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: #191b1e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 1.5rem 1.5rem 0 0;
  flex-wrap: wrap;
}
.fm2-event-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.fm2-topbar-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.fm2-chip {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
}
.fm2-chip-red  { background: rgba(187,21,44,0.25); color: #ff8080; }
.fm2-chip-gold { background: rgba(184,134,11,0.25); color: #f0c040; }
.fm2-close-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
  margin-left: 2px;
  transition: background 0.2s ease;
}
.fm2-close-btn:hover { background: rgba(255,255,255,0.16); }

/* Arena */
.fm2-arena {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  height: 292px;
  background: #131517;
  overflow: hidden;
  position: relative;
}
.fm2-photo {
  position: relative;
  overflow: hidden;
}
.fm2-photo img {
  position: absolute;
  top: 0;
  height: 160%;
  width: auto;
  max-width: none;
  z-index: 1;
}
.fm2-photo-left  img { left: 50%; transform: translateX(-45%); }
.fm2-photo-right img { left: 50%; transform: translateX(-55%); }
.fm2-photo-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.04);
  letter-spacing: -0.05em;
  z-index: 0;
}
/* Bottom fade toward stats section */
.fm2-photo::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(to bottom,
    transparent 0%,
    transparent 25%,
    rgba(19,21,23,0.15) 45%,
    rgba(19,21,23,0.55) 65%,
    #131517 85%,
    #131517 100%
  );
  z-index: 2;
  pointer-events: none;
}
/* Inner fade toward VS column */
.fm2-photo-left::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100%;
  background: linear-gradient(to right, transparent, #131517);
  z-index: 3;
  pointer-events: none;
}
.fm2-photo-right::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100px; height: 100%;
  background: linear-gradient(to left, transparent, #131517);
  z-index: 3;
  pointer-events: none;
}
/* Outer edge ambient fade */
.fm2-photo-left  { -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.35) 0%, black 18%); mask-image: linear-gradient(to right, rgba(0,0,0,0.35) 0%, black 18%); }
.fm2-photo-right { -webkit-mask-image: linear-gradient(to left,  rgba(0,0,0,0.35) 0%, black 18%); mask-image: linear-gradient(to left,  rgba(0,0,0,0.35) 0%, black 18%); }

/* Name overlay */
.fm2-name-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 4;
  padding: 0 16px 13px;
}
.fm2-overlay-name {
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: #ffffff;
}
.fm2-overlay-nick {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bb152c;
  margin-top: 4px;
}

/* VS column */
.fm2-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 16px;
  gap: 4px;
  position: relative;
  z-index: 5;
}
.fm2-vs-text {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #bb152c;
  line-height: 1;
}
.fm2-vs-rule {
  width: 18px;
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 3px 0;
}
.fm2-vs-weight {
  font-size: 0.4375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.50);
  text-align: center;
  line-height: 1.5;
  max-width: 72px;
}

/* Stats row */
.fm2-stats {
  display: grid;
  grid-template-columns: 1fr 210px 1fr;
  padding: 14px 20px 16px;
  background: #f5f2ef;
}
.fm2-stat-col {
  display: flex;
  flex-direction: column;
}
.fm2-stat-col.right {
  align-items: flex-end;
  text-align: right;
}
.fm2-stat-record {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #2d3338;
  line-height: 1;
  min-height: 1.375rem;
}
/* Rank slot — always rendered, visibility:hidden when empty */
.fm2-stat-rank-slot {
  margin-top: 5px;
  min-height: 20px;
  display: flex;
  align-items: center;
}
.fm2-stat-col.right .fm2-stat-rank-slot { justify-content: flex-end; }
.fm2-stat-rank {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2f4f6;
  color: #596065;
  white-space: nowrap;
}
/* Champion badge — gradient gold border */
.fm2-champ-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 999px;
  color: #7a5000;
  background:
    linear-gradient(#fff8ed, #fff8ed) padding-box,
    linear-gradient(125deg, #c8920a 0%, #f5c432 40%, #e8a800 70%, #c8920a 100%) border-box;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
/* Nationality — large flag */
.fm2-stat-nat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 36px;
}
.fm2-stat-col.right .fm2-stat-nat { flex-direction: row-reverse; }
.fm2-stat-nat.empty { visibility: hidden; }
.fm2-stat-nat img {
  width: 36px; height: 25px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(45,51,56,0.14);
}
.fm2-stat-nat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #acb3b8;
}
/* Profile CTA */
.fm2-profile-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #bb152c;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  min-height: 14px;
}
.fm2-profile-cta:hover { opacity: 1; }

/* Center comparison */
.fm2-stats-center {
  position: relative;
  padding: 2px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fm2-stats-center::before,
.fm2-stats-center::after {
  content: '';
  position: absolute;
  top: 6px; bottom: 6px;
  width: 1px;
  background: rgba(172,179,184,0.14);
}
.fm2-stats-center::before { left: 0; }
.fm2-stats-center::after  { right: 0; }
.fm2-cmp-row {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  align-items: center;
  gap: 2px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(172,179,184,0.08);
}
.fm2-cmp-row:last-child { border-bottom: none; }
.fm2-cmp-lbl {
  grid-column: 2;
  font-size: 0.475rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(172,179,184,0.55);
  text-align: center;
  white-space: nowrap;
}
.fm2-cmp-val {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #acb3b8;
  white-space: nowrap;
}
.fm2-cmp-val.a { text-align: right; }
.fm2-cmp-val.b { text-align: left; }
.fm2-cmp-val.edge { color: #2d3338; }

/* Result bar */
.fm2-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #eeecea;
  border-top: 1px solid rgba(172,179,184,0.15);
  border-radius: 0 0 1.5rem 1.5rem;
  flex-wrap: wrap;
}
.fm2-res-tag {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #acb3b8;
}
.fm2-res-sep {
  width: 1px; height: 11px;
  background: rgba(172,179,184,0.3);
  flex-shrink: 0;
}
.fm2-res-winner {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #bb152c;
}
.fm2-res-method {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2d3338;
}
.fm2-res-detail {
  font-size: 0.625rem;
  font-weight: 600;
  color: #acb3b8;
}
.fm2-result.is-upcoming .fm2-res-winner {
  color: #596065;
  font-size: 0.6875rem;
  font-weight: 600;
}

/* ---- Global Responsive ---- */

/* Use dvh on mobile for reliable viewport height */
@supports (height: 100dvh) {
  .fight-modal-panel { max-height: 94dvh; }
}

/* Nav: always show search icon */
.nav-search-always { display: inline-flex !important; }

/* Nav: hide download button text on very small screens */
@media (max-width: 374px) {
  .nav-download-btn { display: none !important; }
}
@media (min-width: 375px) and (max-width: 639px) {
  .nav-download-btn {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    font-size: 0.5625rem !important;
  }
}

/* Hero stats responsive */
.hero-stats {
  flex-wrap: wrap;
}
@media (max-width: 479px) {
  .hero-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1rem !important;
    align-items: start !important;
  }
  .hero-stats > div {
    padding-right: 0 !important;
    margin-right: 0 !important;
    border-right: none !important;
  }
}
@media (min-width: 480px) and (max-width: 639px) {
  .hero-stats > div {
    padding-right: 1rem !important;
    margin-right: 1rem !important;
  }
  .hero-stats .stat-value {
    font-size: 1.375rem !important;
  }
}

/* Footer responsive */
@media (max-width: 639px) {
  .footer-links {
    gap: 1rem 1.5rem !important;
  }
}

/* ---- Fight Modal — Mobile ---- */
@media (max-width: 560px) {
  .fight-modal-panel {
    width: calc(100% - 1rem);
    border-radius: 1.25rem;
  }
  .fm2-arena {
    grid-template-columns: 1fr 68px 1fr;
    height: 200px;
  }
  .fm2-overlay-name { font-size: 1.05rem; }
  .fm2-vs-text { font-size: 1.375rem; }
  .fm2-stats {
    grid-template-columns: 1fr 1fr;
    padding: 14px 16px;
    gap: 12px;
  }
  .fm2-stats-center {
    order: 3;
    grid-column: span 2;
    border-top: 1px solid rgba(172,179,184,0.10);
    padding: 10px 0 0;
  }
  .fm2-stats-center::before,
  .fm2-stats-center::after { display: none; }
  .fm2-cmp-row { grid-template-columns: 1fr 56px 1fr; }
}

@media (max-width: 400px) {
  .fm2-arena { height: 170px; }
  .fm2-arena { grid-template-columns: 1fr 54px 1fr; }
  .fm2-overlay-name { font-size: 0.9rem; }
  .fm2-name-overlay { padding: 0 10px 10px; }
  .fm2-vs-text { font-size: 1.125rem; }
  .fm2-vs-weight { font-size: 0.375rem; max-width: 52px; }
  .fm2-topbar { padding: 7px 10px; }
  .fm2-chip { font-size: 0.5rem; padding: 2px 6px; }
  .fm2-result { padding: 8px 12px; gap: 6px; }
  .fm2-res-winner { font-size: 0.75rem; }
}

/* ── i18n ─────────────────────────────────────────────────────── */
html.i18n-pending [data-i18n],
html.i18n-pending [data-i18n-placeholder] { opacity: 0; }

/* Language switcher pill */
.lang-pill {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.11);
  color: rgba(255,255,255,0.72);
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.lang-pill:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
}

/* Language dropdown */
.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 200;
  background: #1e2124;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  padding: 5px;
  min-width: 145px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.lang-dropdown-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.lang-dropdown-item.active { color: #fff; }
.lang-dropdown-item .lang-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #bb152c; margin-left: auto; flex-shrink: 0;
}
