/* ═══════════════════════════════════════════════════════════════
   Extended Data Styles — Ratings, xG, Injuries, Weather
   ═══════════════════════════════════════════════════════════════ */

/* Match Detail Tabs Enhancement */
.dtabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.dtabs::-webkit-scrollbar {
  height: 3px;
}

.dtabs::-webkit-scrollbar-thumb {
  background: var(--border-s);
  border-radius: 3px;
}

.dtab {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.det-panel {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* xG Container */
.xg-container {
  padding: 16px;
}

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

.stat-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.stat-badge {
  font-size: 14px;
  opacity: 0.7;
}

.xg-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.xg-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
}

.xg-label {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.xg-label.home {
  color: var(--c-home, #3b82f6);
}

.xg-label.away {
  color: var(--c-away, #ef4444);
}

.xg-bar-wrap {
  position: relative;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
}

.xg-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  transition: width 0.6s ease;
  border-radius: 6px;
}

.xg-bar.home {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.xg-bar.away {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.xg-value {
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.xg-insight {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.insight.balanced {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.insight.home-advantage {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.insight.away-advantage {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Player Ratings */
.ratings-container {
  padding: 16px;
}

.ratings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.player-rating-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.player-rating-card.highlight {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.3);
}

.player-rating-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.player-rating-badge {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.player-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-stats {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

/* Injuries */
.injuries-container {
  padding: 16px;
}

.injuries-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.injury-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
}

.injury-icon {
  font-size: 24px;
}

.injury-info {
  flex: 1;
}

.injury-player {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.injury-reason {
  font-size: 13px;
  opacity: 0.8;
}

.injury-return {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 4px;
}

/* Weather */
.weather-container {
  padding: 16px;
}

.weather-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
}

.weather-icon {
  font-size: 48px;
}

.weather-main {
  flex: 1;
}

.weather-desc {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: capitalize;
}

.weather-temp {
  font-size: 24px;
  font-weight: 700;
  color: var(--c-pri, #3b82f6);
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.weather-detail {
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 13px;
}

/* Empty/Error States */
.empty-state,
.error-state {
  padding: 48px 24px;
  text-align: center;
  opacity: 0.6;
  font-size: 14px;
  color: var(--t2);
}

.error-state {
  color: var(--red);
  opacity: 0.8;
}

.empty-state::before {
  content: '📊';
  display: block;
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.error-state::before {
  content: '⚠️';
  display: block;
  font-size: 48px;
  margin-bottom: 12px;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--t3);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Mobile Adjustments */
@media (max-width: 640px) {
  .xg-row {
    grid-template-columns: 60px 1fr;
    gap: 8px;
  }
  
  .xg-label {
    font-size: 12px;
  }
  
  .ratings-grid {
    grid-template-columns: 1fr;
  }
  
  .weather-details {
    grid-template-columns: 1fr;
  }
  
  .stat-header h3 {
    font-size: 16px;
  }
  
  .player-rating-card {
    padding: 8px;
  }
  
  .xg-container,
  .ratings-container,
  .injuries-container,
  .weather-container {
    padding: 12px;
  }
}
