/* Criollos en MLB — base styles */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Venezuelan flag palette
   --vzla-yellow: top stripe
   --vzla-blue:   middle stripe
   --vzla-red:    bottom stripe (accent / active state) */
:root {
  --vzla-yellow: #fdda24;
  --vzla-blue:   #0b1d3a;
  --vzla-blue-2: #16294a;
  --vzla-blue-3: #1a2f5a;
  --vzla-red:    #cf142b;
  --vzla-red-2:  #a8101f;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--vzla-blue);
  color: #f5f5f5;
  line-height: 1.5;
}

/* ---------- Header ---------- */
.site-header {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--vzla-yellow);
  color: var(--vzla-blue);
  border-bottom: 6px solid var(--vzla-red);
}

.site-header h1 {
  font-size: 2rem;
}

.tagline {
  margin-top: 0.5rem;
  font-style: italic;
}

#lang-toggle {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--vzla-blue);
  background: transparent;
  color: var(--vzla-blue);
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

#lang-toggle:hover {
  background: var(--vzla-blue);
  color: var(--vzla-yellow);
}

/* ---------- Stats bar ---------- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  background: var(--vzla-blue-3);
  font-weight: bold;
}

/* live "last updated" indicator — subtle, with a green pulsing dot */
.updated-at {
  font-weight: normal;
  font-size: 0.8rem;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.updated-at::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #36d399;
  box-shadow: 0 0 0 0 rgba(54, 211, 153, 0.7);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0.7); }
  70%  { box-shadow: 0 0 0 7px rgba(54, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0); }
}

/* ---------- Search bar ---------- */
.search-bar {
  display: flex;
  justify-content: center;
  padding: 1rem 1rem 0;
  background: var(--vzla-blue-2);
}

#search-input {
  width: 100%;
  max-width: 420px;
  padding: 0.6rem 1rem;
  border: 2px solid var(--vzla-yellow);
  background: var(--vzla-blue);
  color: #fff;
  font-size: 0.95rem;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#search-input:focus {
  border-color: var(--vzla-red);
  box-shadow: 0 0 0 3px rgba(207, 20, 43, 0.25);
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--vzla-blue-2);
  border-top: 1px solid #2a3f6a;
  border-bottom: 1px solid #2a3f6a;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--vzla-yellow);
  background: transparent;
  color: var(--vzla-yellow);
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.filter-btn:hover {
  background: var(--vzla-yellow);
  color: var(--vzla-blue);
}

.filter-btn.active {
  background: var(--vzla-red);
  border-color: var(--vzla-red);
  color: #fff;
}

.filter-btn.active:hover {
  background: var(--vzla-red-2);
  border-color: var(--vzla-red-2);
}

/* ---------- Player grid ---------- */
#player-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  font-style: italic;
  opacity: 0.7;
}

.error {
  grid-column: 1 / -1;
  text-align: center;
  color: #ff6b6b;
}

/* ---------- Player card ---------- */
.player-card {
  background: var(--vzla-blue-2);
  border: 1px solid #2a3f6a;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.player-card:hover {
  transform: translateY(-3px);
  border-color: var(--vzla-yellow);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.player-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--vzla-blue);
  align-self: center;
  border: 3px solid var(--vzla-yellow);
}

.player-name {
  font-size: 1.1rem;
  margin-top: 0.4rem;
  color: var(--vzla-yellow);
}

.player-meta {
  font-size: 0.9rem;
  font-weight: bold;
  opacity: 0.9;
}

.player-team {
  font-size: 0.95rem;
}

.league-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
  background: var(--vzla-yellow);
  color: var(--vzla-blue);
  border-radius: 4px;
  vertical-align: middle;
}

/* MLB players get the red tag — highlights "the bigs" */
.league-tag.mlb {
  background: var(--vzla-red);
  color: #fff;
}

.player-bio,
.player-physical {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Stats line — the highlight of the card */
.player-stats {
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--vzla-yellow);
  background: rgba(11, 29, 58, 0.55);
  border: 1px solid rgba(253, 218, 36, 0.25);
  border-radius: 6px;
  letter-spacing: 0.02em;
}

/* Second stats line for hitters (HR / RBI) — slightly different shade */
.player-stats-power {
  margin-top: 0.3rem;
  background: rgba(207, 20, 43, 0.18);
  border-color: rgba(207, 20, 43, 0.4);
  color: #fff;
}

.player-stats.no-stats {
  color: #fff;
  background: transparent;
  border-color: transparent;
  font-weight: normal;
  font-style: italic;
  font-size: 0.8rem;
  opacity: 0.5;
  padding: 0.3rem;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
  opacity: 0.7;
  border-top: 4px solid var(--vzla-red);
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 480px) {
  .site-header h1 {
    font-size: 1.5rem;
  }
  .stats-bar {
    gap: 1rem;
    font-size: 0.9rem;
  }
  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}
