/* Copa AMVI — visual identity on top of Bootstrap 5. */

:root {
  --amvi-green: #0e7a3e;
  --amvi-green-dark: #0a4f2b;
  --amvi-gold: #f4c430;
  --amvi-ink: #14231b;
  --bs-primary: var(--amvi-green);
  --bs-primary-rgb: 14, 122, 62;
  --bs-link-color: var(--amvi-green);
  --bs-link-hover-color: var(--amvi-green-dark);
  --bs-body-bg: #f3f6f4;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* --- Navbar ------------------------------------------------------------ */

.amvi-navbar {
  background: linear-gradient(90deg, var(--amvi-green-dark), var(--amvi-green));
  box-shadow: 0 2px 12px rgb(0 0 0 / 15%);
}

.amvi-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.amvi-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--amvi-gold);
  color: var(--amvi-ink);
  font-size: 1.1rem;
}

.amvi-navbar .nav-link.active {
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--amvi-gold);
}

/* --- Buttons ----------------------------------------------------------- */

.btn-primary {
  --bs-btn-bg: var(--amvi-green);
  --bs-btn-border-color: var(--amvi-green);
  --bs-btn-hover-bg: var(--amvi-green-dark);
  --bs-btn-hover-border-color: var(--amvi-green-dark);
  --bs-btn-active-bg: var(--amvi-green-dark);
  --bs-btn-disabled-bg: var(--amvi-green);
  --bs-btn-disabled-border-color: var(--amvi-green);
}

.btn-outline-primary {
  --bs-btn-color: var(--amvi-green);
  --bs-btn-border-color: var(--amvi-green);
  --bs-btn-hover-bg: var(--amvi-green);
  --bs-btn-hover-border-color: var(--amvi-green);
  --bs-btn-active-bg: var(--amvi-green);
  --bs-btn-active-border-color: var(--amvi-green);
}

/* --- Cards & page header ----------------------------------------------- */

.card {
  border: 0;
  border-radius: .9rem;
  box-shadow: 0 1px 3px rgb(20 35 27 / 8%), 0 4px 16px rgb(20 35 27 / 5%);
}

.page-header h1 { font-weight: 800; }

.section-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

/* --- Team badge (crest or coloured initials) --------------------------- */

.team-badge {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--size, 2.25rem);
  height: var(--size, 2.25rem);
  border-radius: 50%;
  font-size: calc(var(--size, 2.25rem) * .32);
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 35%), 0 1px 3px rgb(0 0 0 / 20%);
  overflow: hidden;
}

.team-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* --- Status pills ------------------------------------------------------ */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

.status-pill.is-live { background: #fde2e1; color: #b42318; }
.status-pill.is-finished { background: #e7ece9; color: #344054; }
.status-pill.is-scheduled { background: #e3f1e8; color: var(--amvi-green-dark); }
.status-pill.is-off { background: #fff4d6; color: #8a5a00; }

.live-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: currentColor;
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* --- Fixture cards (match list) ---------------------------------------- */

.fixture {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
}

.fixture-team {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  font-weight: 600;
}

.fixture-team.is-home { justify-content: flex-end; text-align: right; }
.fixture-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fixture-score {
  min-width: 4.5rem;
  padding: .3rem .7rem;
  border-radius: .5rem;
  background: var(--amvi-ink);
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.fixture-score.is-pending {
  background: transparent;
  color: var(--bs-secondary-color);
  font-weight: 600;
}

.fixture-card {
  transition: transform .12s ease, box-shadow .12s ease;
}

.fixture-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgb(20 35 27 / 10%), 0 8px 24px rgb(20 35 27 / 8%);
}

/* --- Scoreboard (match sheet) ------------------------------------------ */

.scoreboard {
  background: linear-gradient(135deg, var(--amvi-green-dark), var(--amvi-green) 60%, #13924c);
  color: #fff;
  overflow: hidden;
}

.scoreboard .meta { color: rgb(255 255 255 / 75%); font-size: .875rem; }

.scoreboard-score {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.scoreboard-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  text-align: center;
}

/* --- Event type picker -------------------------------------------------- */

.event-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: .5rem;
}

.event-picker .btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .6rem .4rem;
  font-size: .8rem;
  line-height: 1.15;
}

.event-picker .btn .icon { font-size: 1.4rem; }

/* --- Timeline ----------------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 3.5rem 2.25rem 1fr auto;
  align-items: start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-left: 4px solid var(--team-color, var(--bs-border-color));
}

.timeline-item + .timeline-item { border-top: 1px solid var(--bs-border-color-translucent); }

.timeline-minute {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timeline-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bs-tertiary-bg);
  font-size: 1.1rem;
}

@media (max-width: 575.98px) {
  .timeline-item {
    grid-template-columns: 2.75rem 1.75rem 1fr auto;
    gap: .5rem;
    padding: .75rem;
  }
  .timeline-icon { width: 1.75rem; height: 1.75rem; font-size: .95rem; }
}

.timeline-item.is-canceled { opacity: .55; }
.timeline-item.is-canceled .timeline-title { text-decoration: line-through; }

/* --- Lineup editor ------------------------------------------------------- */

.lineup-row.is-starter { background: #e9f6ee; }
.lineup-row.is-substitute { background: #f6f8f7; }

.lineup-counter {
  position: sticky;
  top: .75rem;
  z-index: 10;
}

.lineup-counter .count { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lineup-counter .is-ok { color: var(--amvi-green); }
.lineup-counter .is-bad { color: #b42318; }

/* --- Login --------------------------------------------------------------- */

.auth-hero {
  background: linear-gradient(160deg, var(--amvi-green-dark), var(--amvi-green));
  color: #fff;
}

/* --- Footer -------------------------------------------------------------- */

.amvi-footer { color: var(--bs-secondary-color); font-size: .8rem; }
