/* css/gamecard.css */

/* live indicator */

.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  margin-bottom: 2px;
  border-radius: 50%;
  background-color: #14305e;
  animation: pulse 2.5s infinite;
  vertical-align: middle;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.3;
  }
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}

/* Horizontal scroller for small cards */
.gamecard-scroll {
  display: flex;
  gap: 0rem;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: thin;
  height: 115px;
}

.gamecard-scroll::-webkit-scrollbar {
  height: 6px;
}

.gamecard-scroll::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 3px;
}

/* game card */

.game-card {
  background: #fff;
  border-color: var(--color-grey-light);
  border-style: solid;
  border-width: 1px;
  border-radius: 8px;
  padding: 0.5rem;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
}

.game-card.large {
  margin: 0.5rem;
}

/* Grid for large cards */
.gamecard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0rem;
}

.gamecard-grid .game-card.large {
  flex: 1 1 calc(33% - 1rem); /* 3 per row on desktop */
  max-width: 350px;
}

.game-card .game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0rem;
  font-size: 0.7rem;
  font-weight: bold;
  color: var(--color-grey-dark);
}

.game-card .game-teams {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-card .game-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-card .game-team img {
  height: 24px;
  margin-right: 0.5rem;
}

.game-card .team-name {
  font-weight: 600;
}

.game-card .team-score {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Small variant */
.game-card.small {
  width: 200px;
  min-width: 200px;
  margin: 0.5rem 0.2rem;
  position: relative;
  overflow: hidden;
}

/* Compact boxscore for small cards */
.boxscore.small {
  font-size: 0.7rem;
  margin-top: 0rem;
}

.boxscore.small th,
.boxscore.small td {
  padding: 2px 4px;
}

.boxscore.small .boxscore-logo {
  width: 20px;
  height: 20px;
}

.boxscore.small .boxscore-name {
  font-size: 0.7rem;
  font-weight: 600;
  padding-left: 0.3em;
}

.boxscore.small .boxscore-total,
.boxscore.small .total-col {
  font-size: 0.7rem;
  font-weight: 700;
  width: 28px;
}

.game-card.small.clickable {
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.game-card.small.clickable:hover {
  background-color: #fafafa; /* subtle tint */
  border-color: var(--color-grey); /* slightly darker border */
}

/* Small boxscore header */

.small-boxscore th {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 4px 6px;
  text-align: center;
  color: var(--color-grey-dark);
}

.small-boxscore .game-status-cell {
  text-align: left; /* align "Live" nicely with team logos */
  font-weight: 600;
}

.small-boxscore {
  width: 100%;
  border-collapse: collapse;
}

.small-boxscore td {
  vertical-align: middle;
}

.small-boxscore td.team-logo {
  width: 32px;
  text-align: center;
}

.small-boxscore td.team-logo img {
  height: 24px;
}

.small-boxscore td.team-name {
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.small-boxscore td.team-score {
  text-align: right;
  font-weight: bold;
  font-size: 1rem;
  width: 30px;
}

.game-status.small-status {
  text-align: center;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: var(--color-grey-dark);
}

.game-card.small .team-score {
  font-size: 1rem;
}

/* Large variant */
.game-card.large {
  width: 320px;
}

.game-card.large .game-extra {
  margin-top: 0rem;
  font-size: 0.9rem;
}

.game-extra-title {
  margin: 0rem;
}

/* Large card CTA */
.game-footer {
  margin-top: 0.5rem;
  text-align: center;
}

.cta-link {
  display: inline-block;
  width: 100%;
  padding: 0.5rem 0rem;
  background: var(--color-light-blue);
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.cta-link:hover {
  background: var(--color-dark-blue);
}

/* Small card overlay */
.game-teams-wrapper {
  position: relative;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 8px; /* match card radius */
}

.game-card.small:hover .card-overlay {
  opacity: 1;
}

.overlay-link {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--color-light-blue);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.overlay-link:hover {
  background: var(--color-dark-blue);
}

.game-card.small .game-status {
  margin-bottom: 0.7rem;
}

.boxscore {
  width: 100%;
  border-collapse: collapse;
  margin: 0em 0;
  font-size: 0.9em;
}

.boxscore th {
  font-weight: 500;
  text-align: center;
  padding: 4px 6px;
}

.boxscore td {
  text-align: center;
  padding: 6px;
}

.boxscore-secondary {
  color: var(--color-grey);
}

.boxscore-logo {
  width: 36px;
  height: 36px;
}

.boxscore-name {
  text-align: left !important;
  font-size: 1.1em;
  font-weight: 600;
  padding-left: 0.5em;
}

.boxscore-total,
.total-col {
  font-size: 1.2em;
  font-weight: 700;
  width: 40px;
}

/* game event slider */

.game-event-slider {
  position: relative;
  overflow: hidden;
  margin: 0.5em 0;
}

.game-event-track {
  display: flex;
  transition: transform 0.3s ease;
  width: 100%;
  padding: 0 0rem;
  box-sizing: border-box;
  gap: 0rem;
}

.game-event-item {
  position: relative;
  width: 100%;
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 0em;
  padding: 0.5em 1.7em;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: var(--color-white);
  box-sizing: border-box;
}

.game-event-title {
  font-weight: bold;
}

.game-event-additional {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-event-headshot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
}

.game-event-teamlogo {
  width: 40px;
  height: 40px;
  margin-right: 8px;
}

.game-event-neutral {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: contain;
  margin-right: 8px;
}

.game-event-info {
  flex: 1;
  justify-content: center;
  font-size: 0.9em;
  flex-direction: column;
  display: flex;
  min-height: 64px;
}

.game-event-meta.period-time {
  font-size: 0.75em;
  color: #666;
  margin-bottom: 2px;
  align-self: flex-start;
}

.game-event-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  opacity: 0.85;
  font-size: 0.9em;
}

.game-event-item {
  min-height: 56px;
  box-sizing: border-box;
}

.game-event-info.no-goals {
  text-align: center;
  color: #777;
}

.game-event-info.no-goals .game-event-scorer,
.game-event-info.no-goals .game-event-meta {
  visibility: hidden; /* reserve space but don't show text */
}

.game-event-item .game-event-info:only-child {
  text-align: center;
  color: #777;
}

.game-event-prev,
.game-event-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 12px;
  height: 100%;
  padding: 10px;
  cursor: pointer;
  font-size: 1.2em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition:
    background 0.2s,
    color 0.2s;
}

.game-event-prev {
  left: 0px;
}
.game-event-next {
  right: 0px;
}

.game-event-prev:disabled,
.game-event-next:disabled {
  opacity: 0.4;
  cursor: default;
}

.game-event-prev:hover:not(:disabled),
.game-event-next:hover:not(:disabled) {
  background-color: var(--color-off-white);
}

.flash-new {
  animation: flashHighlight 1.5s ease-out;
}

@keyframes flashHighlight {
  0% {
    background-color: #fff7a0;
  } /* soft yellow highlight */
  50% {
    background-color: #fffde5;
  }
  100% {
    background-color: transparent;
  }
}

/* date picker */

.date-picker {
  display: flex;
  align-items: center;
  height: 115px;
  font-family: "League Spartan", sans-serif;
}

#date-picker-scoreboard {
  border-right: 1px solid var(--color-grey-light);
  margin-right: 5px;
}

#date-picker-results {
  justify-content: center;
  width: 200px;
  margin: auto;
}

.date-picker button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 20px;
  padding: 0 1em;
  font-size: 1.5em;
  font-weight: bold;
  border: none;
  background: transparent;
  color: #222;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}

.date-picker button:hover:not(:disabled) {
  background: var(--color-off-white);
}

.date-picker button:disabled {
  opacity: 0.4;
  cursor: default;
}

.date-display {
  text-align: center;
  line-height: 1.2;
  padding: 0.5em 1em;
  flex: 1;
}

.date-day {
  font-size: 0.9em;
  font-weight: bold;
  color: #555;
  text-transform: uppercase;
}

.date-num {
  white-space: nowrap;
  font-size: 1.4em;
  font-weight: bold;
  color: #000;
}

.scoreboard-bar {
  display: flex;
  align-items: center;
  gap: 0em;
  border-bottom: 1px solid var(--color-grey-light);
}

/* Skeleton placeholder cards */
.game-card.skeleton {
  background: #fff;
  border: 1px solid var(--color-grey-light);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: pulseSkeleton 1.5s infinite ease-in-out;
}

@keyframes pulseSkeleton {
  0% {
    background-color: #f6f6f6;
  }
  50% {
    background-color: #ececec;
  }
  100% {
    background-color: #f6f6f6;
  }
}

.skeleton-line {
  background: #ddd;
}

.skeleton-fadeout {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* date picker skeleton */

.date-picker-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 115px;
  width: 200px;
  background: #f6f6f6;
  border-radius: 8px;
  animation: pulseSkeleton 1.5s infinite ease-in-out;
  flex-direction: column;
  font-family: "League Spartan", sans-serif;
}

.date-picker-skeleton .skeleton-line {
  background: #ddd;
  border-radius: 4px;
  margin: 4px 0;
  height: 12px;
}

.date-picker-skeleton .skeleton-day {
  width: 60%;
}

.date-picker-skeleton .skeleton-date {
  width: 80%;
}

@media (max-width: 768px) {
  .date-picker {
  }

  .date-display {
    padding: 0.1em 0.1em;
  }

  .odds-btn {
    min-width: 160px;
  }

  .date-day {
    display: none;
  }

  .date-num {
    font-size: 1rem;
  }

  .date-picker button {
    width: 10px;
    padding: 0 1em;
    font-size: 1em;
  }
}
