/*
 * FHPB Site-Specific Styles
 * Ladder-specific and application-unique styles
 * (Common styles moved to base.css, components.css, pages.css)
 */

/* Ladder band 0 - moved to base.css as band-5 for consistency */

.ladder-rank {
  width: 2.5rem;
  font-weight: 600;
}

/* PWA helper toasts (install + iOS A2HS hint)
   Bootstrap defaults are a bit translucent; bump contrast for readability. */
#fhpb-pwa-toast-container .toast {
  --bs-toast-bg: rgba(33, 37, 41, 0.98);
  --bs-toast-color: #fff;
  --bs-toast-border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.35);
}

#fhpb-pwa-toast-container .toast-header {
  background-color: rgba(33, 37, 41, 0.98);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

#fhpb-pwa-toast-container .btn-close {
  filter: invert(1) grayscale(1);
}


.ladder-momentum {
  /* min-width: 3.5rem; with numbers approach */ 
  font-size: 1.4rem;       /* a bit larger so icons are readable at a glance */
  line-height: 1;          /* remove extra vertical space */
  vertical-align: middle;  /* aligns nicely with text */
  padding: .55rem .9rem;
}

.ladder-band-header {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  background-color: var(--bg-light) !important;
  color: #0d3b66;
}

.ladder-standing-row.current-user-row {
  background-color: #fff8e1 !important;
  border-left: 4px solid #ffc107;
  font-weight: 500;
}

/* Ensure non-current-user rows have proper backgrounds */
.ladder-standing-row:not(.current-user-row):not(.ladder-header-row) {
  background-color: transparent;
}

.trophy-card {
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.trophy-card .card-body {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.trophy-rarity-badge {
  background-color: #343a40;
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}

.trophy-art-shell {
  border-radius: 0.75rem;
  overflow: hidden;
  width: 100%;
  max-width: 140px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trophy-art-shell img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.trophy-art-placeholder {
  background-color: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 0.75rem;
  color: #6c757d;
  font-size: 0.9rem;
  padding: 1.25rem;
  text-align: center;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trophy-meta-badges {
  text-align: center;
}

.trophy-meta-badges .badge {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trophy-meta-badges .badge-limited {
  background-color: transparent;
  border: 1px solid #adb5bd;
  border-radius: 999px;
  color: #495057;
  padding: 0.35rem 0.6rem;
}

.trophy-placeholder-image {
  max-width: 220px;
}

.season-header-link {
  display: flex;
  width: 100%;
  border-radius: inherit;
  transition: background-color 0.2s ease;
}

.season-header-link:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.season-trophy-room {
  min-height: 160px;
}

.season-trophy-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.trophy-room-item {
  flex: 0 1 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 160px;
}

.trophy-room-trigger {
  position: relative;
  background: none;
  border: none;
  padding: 0;
  margin: 0 auto;
  cursor: pointer;
  width: 100%;
  max-width: 140px;
  display: block;
  font: inherit;
  color: inherit;
}

.trophy-room-trigger:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 4px;
}

.trophy-room-shell {
  width: 100%;
  background-color: #fff;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
  padding: 0.75rem;
  margin: 0;
}

.trophy-room-shell img {
  border-radius: 0.5rem;
}

.trophy-room-overlay {
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  padding: 1rem;
  text-align: center;
}

.trophy-room-trigger:hover .trophy-room-overlay,
.trophy-room-trigger:focus .trophy-room-overlay,
.trophy-room-trigger:active .trophy-room-overlay {
  opacity: 1;
  pointer-events: auto;
}

.trophy-room-overlay-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.trophy-room-overlay-text {
  font-size: 0.85rem;
  line-height: 1.35;
  margin: 0;
}

.trophy-room-name {
  width: 100%;
  margin: 0.5rem auto 0;
  font-weight: 600;
  color: #343a40;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.25;
  min-height: 2.5rem;
  word-wrap: break-word;
}

/* Back button and trophy page offset styles moved to components.css and pages.css */

.vote-style-form {
  display: inline-block;
  padding: 0.5em;
}

.vote-style-form .btn {
  display: inline;
}

.faq-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.faq-category {
  background-color: #343a4008;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

.faq-question {
  background-color: #e0e0e0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

.faq-answer {
  background-color: #343a4008;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.btn-wide {
  min-width: 12rem;
}

.card-flat {
  border: none;
  background-color: inherit;
  box-shadow: none;
}

.card-flat .card-header,
.card-flat-header {
  border: none;
  background-color: inherit;
  padding-left: 0;
  padding-right: 0;
}

.embed-clean {
  border: 0;
}

.list-circle {
  list-style-type: circle;
}

.navbar-compact {
  border-radius: 0;
  padding-top: 0.25em;
  padding-bottom: 0.25em;
}

.menu-icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  padding-right: 0.5em;
}

.nav-inline {
  display: inline;
}

.btn-borderless {
  border: none;
}

.card-offset-top {
  padding-top: 12vh;
}

.maxw-420 {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.hero-register {
  font-size: 1.5em;
}

.hero-cta {
  font-size: larger;
}

/* flip triangle icons for negative momentum */
.rot-180 {
  transform: rotate(180deg);
  display: inline-block; /* required so transform takes effect on the inline <i> */
}

/* Global toast placement: center horizontally and ~33% down the viewport */
#globalToastContainer {
  position: fixed;
  top: 33vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1090;
  padding: 1rem;
  width: auto;
}

#globalToastContainer .toast + .toast {
  margin-top: 0.75rem;
}

@media (max-width: 576px) {
  #globalToastContainer {
    width: min(100%, 90vw);
  }

  #globalToastContainer .toast {
    width: 100%;
  }
}

/* ===== App-style Home + Feature Pages ===== */
.app-home {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-hero {
  position: relative;
}

.app-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 2rem 2.25rem;
  background: linear-gradient(135deg, #f6ffe1 0%, #e6ffad 50%, #ffe76d 100%);
  border: 1px solid rgba(40, 143, 57, 0.18);
  box-shadow: var(--shadow-lg);
}

.app-hero-card::after {
  content: '';
  position: absolute;
  inset: -40% 20% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle at center, rgba(13, 110, 253, 0.25), transparent 65%);
  opacity: 0.65;
  pointer-events: none;
}

.app-hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(13, 59, 102, 0.7);
}

.app-hero-title {
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  font-weight: 700;
  margin: 0.5rem 0 0.4rem;
  color: #0d3b66;
}

.app-hero-subtitle {
  margin: 0 0 0.75rem;
  color: #314e6b;
  font-size: 1.05rem;
}

.app-hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(13, 59, 102, 0.15);
  font-size: 0.9rem;
}

.app-hero-ladder {
  font-weight: 600;
  color: #0d3b66;
}

.app-action-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.app-action-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border-radius: 1rem;
  border: 1px solid rgba(13, 59, 102, 0.12);
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 110px;
  animation: appFadeUp 0.45s ease both;
}

.app-action-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.app-action-tile:nth-child(1) { animation-delay: 0.05s; }
.app-action-tile:nth-child(2) { animation-delay: 0.1s; }
.app-action-tile:nth-child(3) { animation-delay: 0.15s; }
.app-action-tile:nth-child(4) { animation-delay: 0.2s; }
.app-action-tile:nth-child(5) { animation-delay: 0.25s; }
.app-action-tile:nth-child(6) { animation-delay: 0.3s; }

.app-action-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-action-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #0d3b66;
  background: rgba(13, 110, 253, 0.12);
}

.app-action-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.app-action-subtitle {
  font-size: 0.9rem;
  color: #5b6b7a;
}

.app-action-plans .app-action-icon {
  background: rgba(25, 135, 84, 0.15);
  color: #198754;
}

.app-action-log .app-action-icon {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

.app-action-standings .app-action-icon {
  background: rgba(13, 110, 253, 0.15);
  color: #0d6efd;
}

.app-action-groups .app-action-icon {
  background: rgba(255, 193, 7, 0.2);
  color: #b88900;
}

.app-action-account .app-action-icon {
  background: rgba(108, 117, 125, 0.18);
  color: #6c757d;
}

.app-action-help .app-action-icon {
  background: rgba(111, 66, 193, 0.16);
  color: #6f42c1;
}

.app-home-footer {
  display: flex;
  justify-content: center;
}

.app-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.app-page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.app-page-back {
  flex: 1 0 100%;
}

.app-page-title {
  margin: 0;
  font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.1rem);
  font-weight: 700;
  color: #0d3b66;
}

.app-page-subtitle {
  margin: 0.2rem 0 0;
  color: #5b6b7a;
}

.app-ladder-card {
  border-radius: 1rem;
  border: 1px solid rgba(13, 59, 102, 0.12);
}

.app-ladder-card .card-body.app-ladder-body {
  padding: 1.25rem 1.5rem;
}

.app-ladder-form .form-select {
  font-weight: 600;
}

.app-ladder-meta {
  padding: 0.4rem 0.8rem;
  border-radius: 0.75rem;
  background: rgba(13, 59, 102, 0.05);
  border: 1px solid rgba(13, 59, 102, 0.1);
}

.standings-recalc-indicator {
  font-size: 0.78rem;
  color: #5b6b7a;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.standings-recalc-indicator .bi {
  animation: standingsRecalcSpin 1.2s linear infinite;
}

@keyframes standingsRecalcSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .standings-recalc-indicator .bi {
    animation: none;
  }
}

@keyframes appFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 576px) {
  .app-hero-card {
    padding: 1.5rem;
  }

  .app-action-tile {
    padding: 1rem 1.1rem;
  }
}
