/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Music League self-hosted typefaces */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/BricolageGrotesque-Regular-608ef152.ttf") format("truetype");
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/BricolageGrotesque-SemiBold-605513ab.ttf") format("truetype");
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/BricolageGrotesque-Bold-f1cf33b7.ttf") format("truetype");
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/BricolageGrotesque-ExtraBold-970c4da6.ttf") format("truetype");
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/Figtree-Regular-bcf63794.ttf") format("truetype");
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/Figtree-Medium-0047481d.ttf") format("truetype");
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/Figtree-SemiBold-1a089dd7.ttf") format("truetype");
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/Figtree-Bold-7bfaea42.ttf") format("truetype");
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/Figtree-ExtraBold-4c28ec64.ttf") format("truetype");
}

/* Music League Custom Styles */
body {
  font-family: 'Figtree', sans-serif;
  font-size: 0.8em;
  font-weight: 400;
}

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

input[type="search"].is-loading::-webkit-search-cancel-button {
  display: none;
}

/* Hide native number input spinners */
input[type="number"].no-spinner::-webkit-outer-spin-button,
input[type="number"].no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].no-spinner {
  -moz-appearance: textfield;
}

/* Nitro display ads (issue #491): keep the 160px-wide desktop side rails from
   overlapping the centered max-w-7xl content. Only applies at the rail breakpoint
   (>= 992px) and only when ads are active (body.has-nitro-ads). */
@media (min-width: 992px) {
  body.has-nitro-ads main {
    padding-left: 180px;
    padding-right: 180px;
  }
  /* The public/home layout has no <main>; pad the body directly. The side rails
     are position:fixed (out of flow), so this only shifts page content, not the
     rails themselves. */
  body.has-nitro-ads.nitro-public {
    padding-left: 180px;
    padding-right: 180px;
  }
}

/* Lift the feedback button above the bottom-sticky anchor ad on phones so the
   two don't overlap. The anchor only renders at <=575px (see nitro_ads_controller),
   so the offset is scoped to that width. Keyed off body.nitro-anchor-visible —
   a class the controller toggles from the anchor's *live* DOM presence — not the
   static body.has-nitro-ads. That way closing the anchor drops the button back to
   the bottom instead of leaving a gap (ML-80). */
@media (max-width: 575px) {
  body.nitro-anchor-visible [data-controller~="feedback-widget"] {
    bottom: 4.5rem;
  }

  /* Reserve space below the footer for the bottom-sticky anchor ad so the last
     footer content isn't hidden behind it — only while the anchor is actually
     showing, for the same reason as the button above. */
  body.nitro-anchor-visible footer {
    padding-bottom: 4rem;
  }
}

/* Hide horizontal scrollbar while keeping scroll (tab rows on mobile) */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Center when content fits, fall back to scrollable start when it overflows
   (plain justify-center clips and strands the leading tab on a scroll row) */
.justify-safe-center {
  justify-content: safe center;
}

/* Center the native datetime-local control value text and chevron.
   Chrome/Blink lays the calendar-picker-indicator out of vertical center
   against the text baseline by default — see Docs/QA_SCHEDULE_PACING_ISSUES_427_428.md bug F. */
input[type="datetime-local"] {
  display: inline-flex;
  align-items: center;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  margin-left: auto;
  align-self: center;
}

/* Dotted border separator */
.border-dotted-bottom {
  border-bottom: 5px dotted #F0F0F0;
}

/* Card styles */
.guide-card {
  height: 100%;
  align-items: center;
}

/* Link hover states – exclude elements that set their own text color (e.g. buttons) */
a:not([class*="text-"]) {
  color: #9E00C4;
}

a:not([class*="text-"]):hover {
  color: #7702b7;
}

footer a {
  color: inherit;
  display: block;
  text-decoration: none;
}

footer a:hover {
  color: #9E00C4;
  text-decoration: underline;
}

/* Custom checkbox styles for gray background auth forms */
.checkbox-custom {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.125rem;
  background-color: white;
  cursor: pointer;
}

.checkbox-custom:checked {
  background-color: #9e00c4;
  border-color: #9e00c4;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.checkbox-custom:focus-visible {
  outline: 2px solid #9e00c4;
  outline-offset: 2px;
}

/* Auth input styles for white background forms */
.auth-input-white {
  display: block;
  width: 100%;
  border-radius: 0.625rem;
  background-color: white;
  padding: 0.75rem 0.875rem;
  font-size: 1rem;
  line-height: 1.5rem;
  color: #111827;
  border: 1px solid #d1d5db;
}

.auth-input-white::placeholder {
  color: #9ca3af;
}

.auth-input-white:focus {
  outline: none;
  box-shadow: 0 0 0 2px #9e00c4;
  border-color: transparent;
}

/* Auth primary + Spotify buttons (full pill, mirrors native) */
.auth-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border-radius: 9999px;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.auth-btn:hover {
  opacity: 0.9;
}

.auth-btn-primary {
  background-color: #9e00c4;
  color: #ffffff;
}

.auth-btn-spotify {
  background-color: #1db954;
  color: #ffffff;
}

/* Navigation link overrides */
nav a.text-white {
  color: white;
}

nav a.text-white:hover {
  color: rgba(255, 255, 255, 0.8);
}

a.no-underline {
  text-decoration: none;
}

/* Visibility radio card selected states */
fieldset.league-type-panel label:has(input:checked) {
  background-color: #faf0ff;
  border-color: #b94dff;
  position: relative;
  z-index: 1;
}

fieldset.league-type-panel label:has(input:checked) .label-title {
  color: #3e0050;
}

fieldset.league-type-panel label:has(input:checked) .label-desc {
  color: #6e008a;
}

/* Safe area padding for bottom nav on notched devices */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Invite toggle button states */
.invite-toggle-btn.invited {
  border-color: #22c55e;
  color: #22c55e;
  pointer-events: none;
}

/* Support article markdown typography */
.support-article {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.65;
}

.support-article > *:first-child { margin-top: 0; }
.support-article > *:last-child { margin-bottom: 0; }

.support-article h1,
.support-article h2,
.support-article h3,
.support-article h4 {
  color: #111827;
  font-weight: 600;
  line-height: 1.3;
}

.support-article h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f3f4f6;
}
.support-article h2:first-child {
  padding-top: 0;
  border-top: 0;
  margin-top: 0;
}

.support-article h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.support-article p {
  margin: 0 0 1rem;
}

.support-article ul,
.support-article ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.support-article ul { list-style: disc; }
.support-article ol { list-style: decimal; }
.support-article li { margin-bottom: 0.35rem; }
.support-article li > ul,
.support-article li > ol { margin-top: 0.35rem; margin-bottom: 0.35rem; }

.support-article strong {
  color: #111827;
  font-weight: 600;
}

.support-article a {
  color: #9e00c4;
  text-decoration: none;
}
.support-article a:hover {
  color: #7702b7;
  text-decoration: underline;
}

.support-article code {
  background-color: #f3f4f6;
  color: #1f2937;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.support-article pre {
  background-color: #111827;
  color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 0 0 1rem;
}
.support-article pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.support-article hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

.support-article blockquote {
  border-left: 3px solid #e4b8ff;
  padding: 0.25rem 0 0.25rem 1rem;
  color: #4b5563;
  margin: 0 0 1rem;
}

.support-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.support-article th,
.support-article td {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.support-article th {
  color: #111827;
  font-weight: 600;
  background-color: #f9fafb;
}

/* Real-time member join animation */
@keyframes member-join {
  0%   { opacity: 0; transform: scale(0.8); background-color: #faf0ff; }
  20%  { opacity: 1; transform: scale(1); background-color: #f3e0ff; }
  60%  { opacity: 1; background-color: #f3e0ff; }
  100% { opacity: 1; background-color: transparent; }
}
.member-new {
  animation: member-join 1.2s ease-out forwards;
}
@media (prefers-reduced-motion: reduce) {
  .member-new { animation: none; opacity: 1; }
}

/* AdSense: when Google reports no fill, hide the whole labeled ad card
   rather than leaving an empty "Sponsored" box. */
.ad-card:has(ins[data-ad-status="unfilled"]) {
  display: none;
}
