/* Bluejay - College Basketball NBA Prospect Tracker */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #1c2128;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent-primary: #58a6ff;
  --accent-secondary: #7ee787;
  --accent-gold: #f0b429;
  --accent-orange: #f78166;
  --accent-purple: #a371f7;
  --border-color: #30363d;
  --live-red: #f85149;
  --final-green: #3fb950;
  --scheduled-blue: #58a6ff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  letter-spacing: 2px;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  font-family: 'Barlow', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color);
}

.date-picker-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.date-picker {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.date-picker::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.date-nav {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-nav:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.today-btn {
  background: var(--accent-primary);
  border: none;
  color: var(--bg-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}

.today-btn:hover {
  background: var(--accent-secondary);
}

/* Main Content */
.main-content {
  padding-bottom: 40px;
}

.scoreboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.scoreboard-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.legend {
  display: flex;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.live {
  background: var(--live-red);
  animation: pulse 2s infinite;
}

.status-dot.final {
  background: var(--final-green);
}

.status-dot.scheduled {
  background: var(--scheduled-blue);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-spinner.small {
  width: 24px;
  height: 24px;
  border-width: 3px;
  margin-bottom: 0;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-prospects {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-secondary);
}

/* No Games */
.no-games {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.no-games-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.no-games h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.no-games p {
  color: var(--text-secondary);
}

/* Games Container */
.games-container {
  display: grid;
  gap: 16px;
}

/* Game Card */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}

.game-card:hover {
  border-color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}


.game-status {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-status.live {
  background: linear-gradient(90deg, var(--live-red), #da3633);
  color: white;
  animation: pulse-bg 2s infinite;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.game-status.final {
  background: var(--bg-tertiary);
  color: var(--final-green);
}

.game-status.scheduled {
  background: var(--bg-tertiary);
  color: var(--scheduled-blue);
}

.game-teams {
  padding: 16px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.team-row:first-child {
  border-bottom: 1px solid var(--border-color);
}

.team-row.winner .team-name {
  color: var(--accent-secondary);
}

.team-row.winner .team-score {
  color: var(--accent-secondary);
}

.team-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.team-logo-placeholder {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.team-logo-small {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.team-name {
  font-weight: 600;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 1px;
  min-width: 60px;
  text-align: right;
}

.team-score.live {
  color: var(--accent-primary);
}

.prospect-badge {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  cursor: help;
}

.prospect-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  white-space: pre-line;
  min-width: 180px;
  max-width: 280px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
  margin-bottom: 8px;
  pointer-events: none;
  line-height: 1.5;
}

.prospect-badge:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Expand Button */
.expand-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: none;
  border-top: 1px solid var(--border-color);
  color: var(--accent-gold);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.expand-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

.expand-icon {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

/* Prospects Section - Compact */
.prospects-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 12px;
}

.prospects-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-prospects {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid var(--border-color);
}

.team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.team-header h4 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  flex: 1;
}

.preview-label {
  background: var(--accent-purple);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Future game prospect cards */
.prospect-card.future {
  border-style: dashed;
  border-color: var(--accent-purple);
}

.prospect-stats.season-avg .stat-label {
  color: var(--accent-purple);
}

.prospects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Prospect Card - Compact Design */
.prospect-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.prospect-photo {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.prospect-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-color);
}

.prospect-photo .no-photo {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.jersey-number {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
}

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

.prospect-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.position {
  background: var(--accent-purple);
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.7rem;
}

.draft-rank {
  color: var(--accent-gold);
  font-weight: 600;
}

.prospect-meta {
  display: none; /* Hide on compact view */
}

.prospect-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.prospect-status.active,
.prospect-status.starter {
  background: var(--final-green);
  color: var(--bg-primary);
}

.prospect-status.bench {
  background: var(--scheduled-blue);
  color: var(--bg-primary);
}

.prospect-status.dnp {
  background: var(--text-muted);
  color: var(--bg-primary);
}

/* Compact Stats - Inline */
.prospect-stats {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.stat-row {
  display: contents;
}

.stat-row.secondary {
  display: none; /* Hide secondary stats in compact view */
}

.stat {
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  text-align: center;
  min-width: 42px;
}

.stat-value {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1;
  margin-top: 2px;
}

.no-prospects-msg {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-style: italic;
}

.no-stats-msg {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

/* Error */
.error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--live-red);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--live-red);
  text-align: center;
}

/* Footer */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .logo {
    font-size: 2rem;
  }
  
  .logo-subtitle {
    display: none;
  }
  
  .date-picker-container {
    width: 100%;
    justify-content: center;
  }
  
  .scoreboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .team-name {
    font-size: 0.95rem;
  }
  
  .team-score {
    font-size: 1.6rem;
  }
  
  /* Compact prospect cards for mobile */
  .prospect-card {
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
  }
  
  .prospect-photo {
    width: 40px;
    height: 40px;
  }
  
  .prospect-info {
    flex: 1;
    min-width: 100px;
  }
  
  .prospect-name {
    font-size: 0.85rem;
  }
  
  .prospect-details {
    font-size: 0.7rem;
  }
  
  .prospect-status {
    order: 3;
    padding: 3px 6px;
    font-size: 0.6rem;
  }
  
  .prospect-stats {
    order: 4;
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
  }
  
  .stat {
    flex: 1;
    min-width: 0;
    padding: 4px 2px;
  }
  
  .stat-value {
    font-size: 1rem;
  }
  
  .stat-label {
    font-size: 0.5rem;
  }
}

/* Even more compact for very small screens */
@media (max-width: 400px) {
  .prospect-photo {
    width: 36px;
    height: 36px;
  }
  
  .jersey-number {
    font-size: 0.5rem;
    padding: 1px 3px;
  }
  
  .prospect-name {
    font-size: 0.8rem;
  }
  
  .position {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
  
  .draft-rank {
    font-size: 0.65rem;
  }
}

@media (min-width: 992px) {
  /* On larger screens, show both teams side by side */
  .prospects-grid {
    flex-direction: row;
    gap: 16px;
  }
  
  .team-prospects {
    flex: 1;
  }
}
