/* =====================================================
   ZS Football Consulting — Depth Chart
   ===================================================== */

:root {
  --accent: #003399;       /* Zayas Football Consulting royal blue */
  --accent-light: #3569b4;
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0f2f8;
  --text-muted: rgba(240, 242, 248, 0.55);
  --field-green: #2a6e2a;
  --field-green-alt: #266626;
  --field-line: rgba(255, 255, 255, 0.85);
  --slot-bg: rgba(15, 17, 23, 0.82);
  --slot-hover: rgba(0, 51, 153, 0.22);
  --card-bg: #1e2235;
  --radius: 8px;
  --transition: 180ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.logo-placeholder {
  height: 52px;
  width: 52px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Main ---- */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
}

/* ---- Field wrapper ---- */
.field-wrapper {
  position: relative;
  width: 100%;
  max-width: 820px;
}

.field-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

/* ---- Positions overlay ---- */
.positions-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.position-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: all;
  width: 115px;
}

.pos-label {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #000;
  text-transform: uppercase;
  margin-bottom: 3px;
  text-shadow: none;
  line-height: 1;
}

.player-list {
  list-style: none;
  background: var(--slot-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 3px 0;
  backdrop-filter: blur(6px);
}

.player-list li {
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.25;
}

.player-list li:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.player-link {
  display: block;
  padding: 3px 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.player-link:hover {
  background: var(--slot-hover);
  color: #a8bfff;
}

.rank-1 .player-link {
  color: #EFC319;
  font-weight: 700;
}

/* ---- Hover card ---- */
.player-card {
  position: fixed;
  z-index: 1000;
  display: none;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid rgba(0, 51, 153, 0.45);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  width: 200px;
  overflow: hidden;
  pointer-events: none;
}

.player-card.visible {
  display: flex;
  pointer-events: all;
}

/* Photo block — full width at top of card */
.card-photo-wrap {
  width: 100%;
  height: 160px;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.card-photo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 800;
  color: rgba(255,255,255,0.35);
  letter-spacing: -2px;
}

.card-info {
  padding: 10px 12px 12px;
}

.card-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
}

.card-position-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.card-meta span {
  display: block;
}

/* ---- Video modal ---- */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.video-modal.open {
  display: flex;
}

.video-modal-inner {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.video-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.video-modal-close:hover {
  background: rgba(255,255,255,0.2);
}

.video-modal-player {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
}

.video-modal-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-modal-name {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #111;
}

.card-yt-link {
  display: block;
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 7px 10px;
  border-radius: 5px;
  text-decoration: none;
  letter-spacing: 0.03em;
  pointer-events: all;
  transition: background var(--transition);
}

.card-yt-link:hover {
  background: var(--accent-light);
}

/* ---- Footer ---- */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.btn-evaluate {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition);
}

.btn-evaluate:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--text);
}

/* ---- Mobile list (hidden on desktop) ---- */
.mobile-list {
  display: none;
  width: 100%;
  max-width: 480px;
  margin-top: 24px;
}

.mobile-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.mobile-group-header {
  background: var(--surface);
  padding: 11px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.mobile-group-header:hover {
  background: #222639;
}

.mobile-group-header .pos-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
}

.mobile-group-header .chevron {
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: transform var(--transition);
}

.mobile-group.open .chevron {
  transform: rotate(180deg);
}

.mobile-group-body {
  display: none;
  background: var(--bg);
}

.mobile-group.open .mobile-group-body {
  display: block;
}

.mobile-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}

.mobile-player-row:hover {
  background: var(--surface);
}

.mobile-rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 16px;
  flex-shrink: 0;
}

.mobile-rank.rank-1 {
  color: #EFC319;
}

.mobile-player-info {
  flex: 1;
  min-width: 0;
}

.mobile-player-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-player-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-play-icon {
  color: var(--accent-light);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* =====================================================
   Responsive — switch to mobile list below 640px
   ===================================================== */
@media (max-width: 640px) {
  header {
    padding: 10px 16px;
  }

  .header-text h1 {
    font-size: 1.1rem;
  }

  .header-text p {
    display: none;
  }

  main {
    padding: 16px 12px 32px;
  }

  .field-wrapper {
    max-width: 100%;
  }

  /* On mobile, hide all players except rank-1 in each slot */
  .player-list li:not(.rank-1) {
    display: none;
  }

  .position-slot {
    width: 80px;
  }

  .pos-label {
    font-size: 0.7rem;
  }

  /* Show mobile list below field */
  .mobile-list {
    display: block;
  }

  footer {
    padding: 16px;
    gap: 16px;
  }

  .btn-evaluate {
    width: 100%;
    text-align: center;
  }
}
