/* app/assets/stylesheets/components/configurations.css
 *
 * Collapsible sections on the season configurations page. Header is a
 * full-width button with the section title on the left and a right-justified
 * chevron, with a hairline border underneath that fills the entire row.
 */

/* Each configure section now reads as a canonical .card. The collapsible
   header is the card's header (full-width clickable button), the body
   has the .card__body padding. */
.configure-section {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.configure-section__header {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
  cursor: pointer;
  padding: 0.95rem 1.5rem;
  text-align: left;
  color: var(--ink);
}
/* Hairline divider only when the body is open. */
.configure-section:has(.configure-section__body:not([hidden])) .configure-section__header {
  border-bottom: 1px solid var(--line-2);
}

.configure-section__title {
  flex: 1 1 auto;
  font-size: 1.07rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.configure-section__chevron {
  flex: 0 0 auto;
  font-size: 1.1rem;
  color: var(--ink-3);
  margin-left: 0.5rem;
  display: inline-block;
  transition: transform 200ms ease;
  line-height: 1;
}

.configure-section__body {
  padding: 1.25rem 1.5rem 1.5rem;
  transition: max-height 200ms ease, opacity 200ms ease;
  opacity: 1;
}

.configure-section__body[hidden] { display: none; }

.configure-section__title-warning {
  margin-left: 0.4rem;
  color: var(--warning, #b54708);
  font-size: 1rem;
}

.configure-section__subtext {
  margin: 0 1.5rem 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-3);
}

.configure-section__subtext--warning {
  color: var(--warning, #b54708);
}

/* ── Click-to-edit pattern ─────────────────────────────
 *
 * `.inline-edit` wraps a static display button + a hidden input. They share
 * the exact same box dimensions so the hover highlight on the static button
 * looks identical to the input that replaces it on click.
 */
.inline-edit {
  display: inline-block;
  position: relative;
}

/* Shared box dimensions for both the display button and the input. */
.inline-edit__display,
.inline-edit__input {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  min-width: 7rem;
  text-align: left;
  box-sizing: border-box;
}

.inline-edit__display {
  display: inline-block;
  cursor: text;
  width: 100%;
}

/* Hover/focus state on the static value invites the click. */
.inline-edit__display:hover,
.inline-edit__display:focus-visible {
  background: var(--bg-2);
  border-color: var(--ink-4);
  outline: none;
}

.inline-edit__input {
  border-color: var(--ink-4);
  background: white;
  width: 100%;
}

.inline-edit__input:focus {
  outline: none;
  border-color: var(--ink-3);
}

.inline-edit__input--saving { background: rgba(239, 144, 20, 0.08); }
.inline-edit__input--saved  {
  border-color: var(--green) !important;
  transition: border-color 800ms ease;
}
.inline-edit__input--error  { border-color: var(--red) !important; }

.inline-edit__error-msg {
  display: block;
  color: var(--red);
  font-size: 0.85em;
  margin-top: 0.25rem;
}

/* Period label inline editor: stack label above value/input. */
.period-edit__label-block {
  margin-bottom: 1rem;
}

/* Slightly wider min-width for the period-label input box. */
.period-edit__label-block .inline-edit__display,
.period-edit__label-block .inline-edit__input {
  min-width: 14rem;
}

/* Standings Display section — grid of column-visibility checkboxes. Three
   per row on most viewports so a season with ~14 columns fits without
   scrolling. Compact enough to feel like a picker, not a form. */
.default-standings-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.5rem;
}

.default-standings-columns-form .form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Ranking Mode radio tile section */
.ranking-mode { margin-top: 1rem; }
.ranking-mode__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.ranking-mode__description {
  font-size: 0.85rem;
  color: var(--ink-3);
  margin: 0 0 0.75rem;
}
.ranking-mode__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ranking-mode__option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s;
}
.ranking-mode__option:hover {
  border-color: var(--ink-3);
}
.ranking-mode__option--selected {
  border-color: var(--blue, #3498db);
  background: color-mix(in srgb, var(--blue, #3498db) 5%, var(--surface));
}
.ranking-mode__option--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ranking-mode__option input[type="radio"] { margin-top: 0.15rem; }
.ranking-mode__label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ranking-mode__hint {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.ranking-mode__warning {
  font-size: 0.8rem;
  color: var(--gold, #f5c518);
}
.ranking-mode__empty {
  font-size: 0.85rem;
  color: var(--ink-3);
  font-style: italic;
}
