/* teams-config.css — Teams direct-edit */

:root {
  --panel-2: #1b1b1b;
  --ring: #ffffff22;
  --green: #86efac;
  --green-border: #60d394;
  --green-text: #064e3b;
}

body {
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  background: #111;
  color: #eee;
}

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
}

/* Control card */
.card {
  border: 1px solid #2225;
  border-radius: 16px;
  background: #121212;
  color: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
}

/* Control card title — single line, truncate with ellipsis */
.control-card {
  overflow: hidden;
}

.control-title {
  display: block;
  font-weight: 700;
  font-size: clamp(1.4rem, 2vw + 0.6rem, 2rem);
  line-height: 1.1;
  margin: 0;
  padding: 0;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.control-meter {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Export/Import: fill the whole card width */
.control-card .controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.control-card .controls-row > .btn {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
  justify-self: stretch;
  align-self: stretch;
}
.control-card .controls-row > .btn:last-child {
  margin-right: 0 !important;
}

/* Reduce space BETWEEN the two button rows */
.control-card .controls-row + .nav-line {
  margin-top: 0rem !important; /* same as gap: 0.5rem; */
}

/* ===== Control-card nav line (Settings / Scoreboard / Animations) ===== */
.nav-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

/* Compact, button-shaped controls that always fit the three-column row */
.nav-line .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px; /* compact so all 3 fit cleanly */
  padding: 0 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  min-width: 0; /* allow shrinking inside grid cell */
}

/* Color mapping per ID */
#goSettings {
  background: #ffeb3b; /* yellow */
  color: #111;
  border-color: rgba(0, 0, 0, 0.15);
}
#goScoreboard {
  background: #ffffff; /* white */
  color: #111;
  border-color: #d1d5db;
}
#goAnimations {
  background: #dc2626; /* red */
  color: #fff;
  border-color: transparent;
}
#goAnimations:hover {
  filter: brightness(1.05);
}

/* Pull hint text upward and center it in remaining space */
.control-instructions {
  text-align: center;
  margin-top: 0.4rem !important; /* was effectively ~1rem+ */
  margin-bottom: 0.3rem !important; /* optional, just keeps it off the border */
  line-height: 1.3;
}

/* If you want perfect vertical centering */
/* .control-card {
  justify-content: space-between;
} */

/* Team cards */
.team-card {
  position: relative;
  background: #1b1b1b;
  border: 1px solid #2f2f2f;
  border-radius: 14px;
  padding: 0.75rem;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 0.5rem;
  overflow: hidden;
}
.team-card:hover {
  box-shadow: 0 0 0 3px var(--ring) inset;
}

/* Name (editable) */
.team-name {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
  text-align: center;
}
.team-name:focus {
  border-color: #ffffff44;
  outline: none;
  background: #00000014;
  text-overflow: clip;
}
.team-name::placeholder {
  color: currentColor;
  opacity: 0.7;
}

/* Primary + Slot on one row */
.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Color pill */
.color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 0.5rem;
  background: #0006;
  border: 1px solid #ffffff26;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
}
.color-wrap:focus-within {
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}
.color-label {
  font-size: 0.9rem;
  opacity: 0.9;
  pointer-events: none;
  color: inherit;
}
.color-primary {
  appearance: auto;
  width: 28px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Slot pill */
.slot-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.5rem;
  height: 36px;
  background: #0006;
  border: 1px solid #ffffff26;
  border-radius: 8px;
  flex: 0 0 auto;
  cursor: pointer;
  color: inherit;
}
.slot-display {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.slot-value {
  font-weight: 600;
}
.slot-wrap .slot-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  appearance: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: #111;
}
.slot-wrap .slot-select option {
  color: #111;
}
.slot-wrap:focus-within {
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}

/* Logo */
.logo-wrap {
  position: relative;
}

/* Subtle dim overlay for the logo area */
.logo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px; /* match logo corner radius */
  background: color-mix(in srgb, currentColor 8%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-out;
}

.team-logo-preview {
  width: 100%;
  height: clamp(110px, 16vh, 150px);
  object-fit: contain;
  display: block; /* kills baseline gap → fixes extra bottom */
  box-sizing: border-box; /* includes border in the 100% width → fixes right edge */
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  border: 2px solid transparent; /* reserve space for hover border */
}

.logo-overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  pointer-events: none;
  font-size: 1rem;
  color: currentColor;
  opacity: 0.9;
  text-align: center;
}

/* Badges */
.bytes-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.82rem;
  opacity: 0.95;
  background: #000a;
  border: 1px solid #fff2;
  border-radius: 8px;
  padding: 2px 6px;
  color: #fff;
}
.file-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: 55%;
  font-size: 0.82rem;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #000a;
  border: 1px solid #fff2;
  border-radius: 8px;
  padding: 2px 6px;
  color: #fff;
}

/* Inputs inherit contrast */
.team-card input[type="text"],
.team-card select:not(.slot-select) {
  color: inherit;
  background: transparent;
}
.team-card input::placeholder {
  color: currentColor;
  opacity: 0.7;
}

/* ===== Needs/empty visuals ===== */
/* Blank NAME: dashed + pointer */
.team-card.needs-name .team-name,
.team-card.empty .team-name {
  border: 2px dashed currentColor !important;
  cursor: pointer;
}

/* Missing LOGO: dashed + overlay hint */
.team-card.needs-logo .team-logo-preview,
.team-card.empty .team-logo-preview {
  border: 2px dashed currentColor;
}

.team-card.needs-logo .logo-overlay,
.team-card.empty .logo-overlay {
  display: grid;
}

/* Hover outlines for click targets */
.color-wrap:hover,
.slot-wrap:hover {
  outline: 2px solid currentColor;
}

/* hide dashed while hovered */
.team-card.needs-name .team-name:hover,
.team-card.empty .team-name:hover,
.team-card.needs-logo .team-logo-preview:hover,
.team-card.empty .team-logo-preview:hover {
  border-style: solid !important; /* swaps dashed → solid */
  border-width: 2px !important;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

/* Hover border for filled slots (name + logo) */
.team-card:not(.needs-name):not(.empty) .team-name:hover {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

/* Hover border + dim for filled logo slots */
.team-card:not(.needs-logo):not(.empty) .team-logo-preview:hover {
  border-color: currentColor;
}

/* Dim the whole logo area (background + logo) on hover */
.team-card:not(.needs-logo):not(.empty) .logo-wrap:hover::before {
  opacity: 1;
}

/* Normalize form-control typography so inputs match normal text */
.team-card input,
.team-card select,
.team-card textarea {
  font: inherit; /* inherit family, size, weight, line-height */
  letter-spacing: 0; /* neutralize UA tweaks */
}

/* Make team name and logo overlay visually identical */
.team-card .team-name,
.team-card .logo-overlay {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  font-family: inherit; /* explicitly inherit system-ui from <body> */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hide file/bytes pills unless the card actually has a logo */
.team-card .file-badge,
.team-card .bytes-badge {
  display: none;
}
.team-card.has-logo .file-badge,
.team-card.has-logo .bytes-badge {
  display: inline-block;
}

/* ——— Teams page button parity with Animations page ——— */

/* Base button look: same weight, padding, radius */
.btn,
.btn-equal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem; /* match Animations */
  border: 1px solid rgba(0, 0, 0, 0.18); /* subtle border like Animations */
  border-radius: 6px; /* same corner radius */
  font-weight: 700; /* bolder label */
  line-height: 1.1;
}

/* Import/Export = same light green style used on Settings / Animations */
.btn-green,
.btn--import,
.btn--export {
  background: var(--action-exportimport-bg); /* #90ee90 */
  color: var(--action-exportimport-fg); /* #000000 */
  border-color: rgba(0, 0, 0, 0.25);
}

/* subtle hover/active, same feel across pages */
.btn-green:hover,
.btn--import:hover,
.btn--export:hover {
  filter: brightness(0.98);
}

.btn-green:active,
.btn--import:active,
.btn--export:active {
  transform: translateY(1px);
}

/* White variant (if you have any on Teams, keep it consistent) */
.btn--white {
  background: #fff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

/* Keyboard focus to match Animations */
.btn:focus {
  outline: none;
  box-shadow: none;
}
.btn:focus-visible {
  outline: 2px solid var(--focus, #66afe9);
  outline-offset: 2px;
}

/* Optional: disabled state parity */
.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
