/**
 * Match Center - Premium Match Detail Styles
 * Uses premium.css design tokens. No hardcoded colors.
 */

/* ========== CONTAINER ========== */
.match-center-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* ========== HERO TEAM LOGOS ========== */
.mc-hero .mc-team-logo,
.mc-hero .team-logo-header {
  width: 80px;
  height: 80px;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}

.mc-hero .team-placeholder {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto var(--space-2);
}

/* ========== STATS TABLE (premium-table compatible) ========== */
.mc-stats-table {
  width: 100%;
  margin-bottom: var(--space-4);
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.mc-stats-table th {
  background: var(--bg-tertiary);
  font-weight: var(--font-semibold);
  border-bottom: 2px solid var(--bg-elevated);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}

.mc-stats-table td {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  border-bottom: 1px solid var(--bg-tertiary);
}

.mc-stats-table .stat-label {
  text-align: left;
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.mc-stats-table .stat-home {
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
}

.mc-stats-table .stat-away {
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
}

/* ========== PLAYER TABLE ========== */
.mc-player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.mc-player-table th {
  background: var(--bg-tertiary);
  font-weight: var(--font-semibold);
  border-bottom: 2px solid var(--bg-elevated);
  padding: var(--space-3) var(--space-4);
}

.mc-player-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--bg-tertiary);
}

.mc-player-table .player-name-cell {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

/* ========== PLAYER PHOTO ========== */
.mc-player-photo-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.mc-player-photo {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-tertiary);
}

.mc-player-photo-placeholder {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  color: var(--text-muted);
}

.mc-player-photo-placeholder.d-none {
  display: none !important;
}

.mc-player-photo.hide-on-error {
  display: block;
}

.mc-player-photo.hide-on-error.mc-hidden {
  display: none !important;
}

.mc-hidden {
  display: none !important;
}

/* ========== PLAYER INFO CELL ========== */
.mc-player-info-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.mc-player-info-cell:hover {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mc-player-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* ========== RATING BADGES ========== */
.mc-rating-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.mc-rating-high {
  background: var(--success-bg);
  color: var(--success);
}

.mc-rating-medium {
  background: var(--warning-bg);
  color: var(--warning);
}

.mc-rating-low {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ========== PLAYER BADGES (goals, assists, cards) ========== */
.mc-player-badges {
  display: inline-flex;
  gap: var(--space-1);
  margin-left: var(--space-2);
  font-size: var(--text-base);
}

.mc-player-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ========== MISSING / N/A STATS ========== */
.mc-missing-partial {
  color: var(--warning);
  background: var(--warning-bg);
  font-weight: var(--font-semibold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-block;
  min-width: 36px;
  text-align: center;
}

.mc-zero-stat {
  color: var(--text-muted);
  font-weight: var(--font-medium);
}

.mc-missing-column {
  color: var(--danger);
  background: var(--danger-bg);
  font-weight: var(--font-bold);
}

.mc-missing-column .mc-missing-badge {
  margin-left: var(--space-2);
  font-size: var(--text-xs);
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
}

.mc-stat-na {
  color: var(--danger);
  font-weight: var(--font-semibold);
  cursor: help;
}

/* ========== SECTION TITLE ========== */
.mc-section-title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--accent-primary);
}

/* ========== PERIOD TOGGLE ========== */
.mc-period-toggle {
  display: inline-flex;
  gap: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  margin-bottom: var(--space-3);
}

.mc-period-toggle button {
  padding: var(--space-2) var(--space-4);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mc-period-toggle button:hover {
  color: var(--text-primary);
}

.mc-period-toggle button.active {
  background: var(--accent-primary);
  color: white;
}

/* Hero period toggle (on dark gradient) */
.mc-hero .mc-period-toggle {
  background: rgba(255, 255, 255, 0.15);
}

.mc-hero .mc-period-toggle button {
  color: rgba(255, 255, 255, 0.8);
}

.mc-hero .mc-period-toggle button:hover {
  color: white;
}

.mc-hero .mc-period-toggle button.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* ========== NO DATA MESSAGE ========== */
.mc-no-data {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--bg-tertiary);
}

/* ========== INTELLIGENCE GRID (Overview) ========== */
.mc-intelligence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.mc-intelligence-item {
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
}

.mc-intelligence-item:nth-child(2) {
  border-left-color: var(--danger);
}

.mc-intelligence-item:nth-child(3) {
  border-left-color: var(--success);
}

.mc-intelligence-item:nth-child(4) {
  border-left-color: var(--warning);
}

.mc-intelligence-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc-intelligence-value {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-primary);
}

/* ========== STICKY TABS ========== */
.mc-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.mc-tabs .nav-link {
  padding: var(--space-2) var(--space-4);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mc-tabs .nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.mc-tabs .nav-link.active {
  color: var(--accent-primary);
  background: var(--accent-muted);
  border-color: var(--accent-primary);
}

/* ========== PREDICTION BAR (dynamic width) ========== */
.mc-pred-bar-fill,
.premium-pred-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.mc-pred-bar-fill {
  width: var(--bar-width, 0%);
}

.mc-pred-xg {
  border-top: 1px solid var(--bg-tertiary);
}

.mc-overview-stats {
  border-top: 1px solid var(--bg-tertiary);
}

/* ========== DEBUG CONSOLE ========== */
.mc-debug-section {
  background: var(--bg-tertiary);
  border-top: 3px dashed var(--danger);
  padding: var(--space-8) 0;
  margin-top: var(--space-8);
}

.mc-debug-section h2 {
  color: var(--danger);
  font-weight: var(--font-bold);
}

.mc-debug-section .premium-card {
  border-color: var(--bg-elevated);
}

.mc-debug-section code {
  background: var(--bg-elevated);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  font-size: var(--text-sm);
}

.mc-json-display {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* ========== EVENTS TIMELINE ========== */
.mc-events-timeline {
  max-width: 600px;
  margin: 0 auto;
}

.mc-event-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--bg-tertiary);
}

.mc-event-row:last-child {
  border-bottom: none;
}

.mc-event-home {
  flex: 1;
  text-align: right;
  min-width: 0;
}

.mc-event-away {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.mc-event-minute {
  width: 48px;
  flex-shrink: 0;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--text-muted);
}

.mc-event-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
}

.mc-event-icon--goal {
  background: var(--success-bg);
  color: var(--success);
}

.mc-event-icon--card-yellow {
  background: var(--warning-bg);
  color: var(--warning);
}

.mc-event-icon--card-red {
  background: var(--danger-bg);
  color: var(--danger);
}

.mc-event-icon--subst {
  background: var(--info-bg);
  color: var(--info);
}

/* ========== HORIZONTAL STAT BAR (possession-style) ========== */
.mc-stat-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.mc-stat-bar-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  min-width: 120px;
}

.mc-stat-bar-track {
  flex: 1;
  display: flex;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mc-stat-bar-home {
  background: var(--accent-primary);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.mc-stat-bar-away {
  background: var(--text-muted);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.mc-stat-bar-value {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  min-width: 2.5rem;
  text-align: right;
}

/* ========== PREDICTIONS LEAGUE ========== */
.pred-league-section {
  margin-top: var(--space-4);
}

.pred-league-card .card-body {
  padding: var(--space-3);
}

.pred-league-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.pred-league-flag {
  width: 24px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.pred-league-name {
  font-size: var(--text-base);
}

.pred-league-meta {
  display: block;
  font-size: var(--text-xs);
  margin-top: 2px;
}

/* ========== PREDICTIONS TEAMS ========== */
.pred-teams-section {
  margin-top: var(--space-4);
}

.pred-team-card .card-body {
  padding: var(--space-4);
}

.pred-team-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.pred-team-name {
  font-size: var(--text-base);
}

.pred-team-stats div {
  margin-bottom: 2px;
}

.pred-team-fixtures {
  font-size: var(--text-xs);
}

/* ========== PREDICTIONS MAIN ========== */
.pred-main-section {
  margin-top: var(--space-4);
}

.pred-main-card {
  padding: var(--space-4);
}

.pred-percent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.pred-percent-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 100px;
}

.pred-percent-home {
  justify-content: flex-start;
}

.pred-percent-draw {
  justify-content: center;
}

.pred-percent-away {
  justify-content: flex-end;
}

.pred-percent-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.pred-percent-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.pred-percent-value {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.pred-winner-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pred-advice {
  font-style: italic;
}

.pred-goals-row {
  font-size: var(--text-xs);
}

.pred-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

.pred-badge--win-or-draw {
  background: var(--success-bg);
  color: var(--success);
}

/* ========== PREDICTIONS COMPARISON ========== */
.pred-comparison-section {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--bg-tertiary);
}

.pred-comparison-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pred-comparison-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.pred-comparison-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  min-width: 100px;
}

.pred-comparison-bar-wrap {
  flex: 1;
  min-width: 120px;
}

.pred-comparison-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.pred-comparison-bar-home {
  background: var(--accent-primary);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.pred-comparison-bar-away {
  background: var(--success);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.pred-comparison-values {
  font-size: var(--text-xs);
  min-width: 70px;
}

/* ========== HEAD-TO-HEAD (H2H) ========== */
.h2h-section {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--bg-tertiary);
}

.h2h-card {
  padding: var(--space-3);
}

.h2h-card__meta {
  font-size: var(--text-xs);
}

.h2h-card__teams {
  font-size: var(--text-sm);
}

.h2h-card__logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.h2h-card__team {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.h2h-card__team.h2h-winner {
  font-weight: var(--font-bold);
  color: var(--success);
}

.h2h-card__team.h2h-draw {
  color: var(--text-muted);
}

.h2h-card__score {
  font-weight: var(--font-bold);
  color: var(--text-primary);
  flex-shrink: 0;
}

.h2h-card__venue {
  font-size: var(--text-xs);
}

.h2h-card-col.h2h-card--hidden {
  display: none;
}
