/**
 * Maç satırı - tablo formatı
 * Tek tablo, ince lig şeritleri, az padding
 */

.livescore-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted, rgba(255,255,255,0.6));
}
.livescore-loading .ms-icon { font-size: 32px; }

.standings-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted, rgba(255,255,255,0.6));
}
.standings-loading .ms-icon { font-size: 28px; }

/* Ana tablo - tek container */
.livescore-table {
  overflow: hidden;
}

.livescore-table:empty {
  display: none;
}

/* Lig şeridi - ince */
.league-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-panel);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  border-top: 1px solid var(--border-color);
}

.livescore-table > .league-block:first-child > .league-strip {
  border-top: none;
}

.league-strip:hover {
  background: var(--bg-card-hover);
}

.league-strip .league-flag {
  width: 18px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

.league-strip-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.league-strip-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-strip-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0 2px;
}

.league-strip-iy {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.league-strip .league-standings-link {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-green);
  text-decoration: none;
  white-space: nowrap;
}

.league-strip .league-standings-link:hover {
  text-decoration: underline;
}

.league-strip .league-toggle {
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: transform 0.3s;
}

.league-block.collapsed .league-strip .league-toggle {
  transform: rotate(180deg);
}

.league-block.collapsed .league-matches {
  display: none;
}

.league-matches {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Maç satırı - az padding */
.livescore .ms-row {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px 5px;
  padding: 0;
  min-height: 10px;
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.ms-row:hover {
  background: var(--bg-card-hover);
}

/* Rozetler */
.ms-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.ms-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 3px;
}

.ms-badge-sus {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.ms-badge-inj {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

/* Sütunlar */
.ms-time {
  flex: 0 0 36px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ms-status {
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ms-status.live {
  color: var(--accent-red);
  animation: pulse-live 1.5s ease-in-out infinite;
}
.ms-status-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  vertical-align: middle;
}
.ms-status-ball img {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.ms-status-ball-spin {
  animation: ms-ball-spin 1.5s linear infinite;
}
@keyframes ms-ball-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ms-status.ht {
  color: var(--accent-gold);
}

.ms-status.ft {
  color: var(--text-muted);
}

.ms-status.ns {
  color: transparent;
}

.ms-detail-icon {
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.15);
  color: #0d9488;
  font-size: 0.65rem;
  font-weight: 700;
}

.ms-detail-icon:hover {
  background: rgba(20, 184, 166, 0.25);
  color: #0f766e;
}

.ms-home {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-home.winner {
  font-weight: 700;
}

/* Lig / genel: ev sahibi kart + isim + logo (logo skora en yakın) */
.livescore .ms-row:not(.ms-row-index) .ms-home {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.livescore .ms-row:not(.ms-row-index) .ms-away {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.livescore .ms-row:not(.ms-row-index) .ms-home .ms-team-name,
.livescore .ms-row:not(.ms-row-index) .ms-away .ms-team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ana sayfa: ev sahibi kart + isim + logo; deplasman: logo + isim + kart */
.ms-row-index .ms-home,
.ms-row-index .ms-away {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ms-row-index .ms-home {
  flex-direction: row;
  justify-content: flex-end;
}

.ms-row-index .ms-away {
  flex-direction: row;
  justify-content: flex-start;
}

.ms-row-index .ms-home .ms-name,
.ms-row-index .ms-away .ms-name {
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-row-index .ms-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
}

.ms-card-icons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.ms-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: help;
  position: relative;
}
.ms-card-icon.ms-card-yellow { color: #eab308; }
.ms-card-icon.ms-card-red { color: #ef4444; }
.ms-card-icon-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ms-card-icon svg { flex-shrink: 0; vertical-align: middle; }
.ms-card-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 7px;
  font-weight: 700;
  color: #0f1115;
  line-height: 1;
  pointer-events: none;
}
.ms-card-tooltip-popup {
  position: fixed;
  z-index: 9999;
  max-width: 240px;
  padding: 8px 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #fff;
  background: rgba(15, 17, 21, 0.96);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  white-space: normal;
  pointer-events: none;
}

.ms-score-wrap {
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ms-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.ms-tips-ok {
  color: var(--accent-green);
  font-size: 0.8rem;
}

.ms-away {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-away.winner {
  font-weight: 700;
}

.ms-ht {
  flex: 0 0 36px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.ms-star-btn {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.ms-star-btn:hover {
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
}

.ms-star-btn.tracked {
  color: var(--accent-gold);
}

.ms-star-btn svg {
  width: 16px;
  height: 16px;
  filter: grayscale(1) opacity(0.6);
}

.ms-star-btn.tracked svg {
  filter: none;
}

/* Web push — maç satırı bildirim düğmesi */
.ms-follow-bell-btn {
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(148, 163, 184, 0.85);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.ms-follow-bell-btn:hover {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.ms-follow-bell-btn .ms-icon {
  font-size: 18px;
}
.ms-follow-bell-btn.ms-follow-bell-active {
  color: #22c55e;
}

/* ===== Canlı sayfa Desktop (769px+) - Profesyonel widget tasarımı ===== */
@media (min-width: 769px) {
  .canli-desktop-view .livescore-table {
    background: var(--bg-primary);
    overflow: hidden;
  }

  .canli-desktop-view .livescore-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.5);
  }

  .canli-desktop-view .livescore-h-time { flex: 0 0 42px; }
  .canli-desktop-view .livescore-h-status { flex: 0 0 36px; }
  .canli-desktop-view .livescore-h-home { flex: 1 1 0; text-align: right; }
  .canli-desktop-view .livescore-h-score { flex: 0 0 72px; text-align: center; }
  .canli-desktop-view .livescore-h-away { flex: 1 1 0; text-align: left; }
  .canli-desktop-view .livescore-h-ht { flex: 0 0 40px; text-align: center; }

  .canli-desktop-view .league-block {
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .canli-desktop-view .league-block:last-child {
    border-bottom: none;
  }

  .canli-desktop-view .league-strip {
    padding: 8px 12px;
    background: transparent;
    border-top: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .canli-desktop-view .livescore-table > .league-block:first-child > .league-strip {
    border-top: none;
  }

  .canli-desktop-view .league-strip:hover {
    background: transparent;
  }

  .canli-desktop-view .league-strip .league-flag {
    width: 20px;
    height: 16px;
    border-radius: 3px;
  }

  .canli-desktop-view .league-strip-name {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .canli-desktop-view .league-strip-iy {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.04em;
  }

  .canli-desktop-view .league-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-red);
    flex-shrink: 0;
    animation: pulse-live 1.5s ease-in-out infinite;
  }

  .canli-desktop-view .league-strip .league-toggle {
    font-size: 18px;
    color: rgba(255,255,255,0.5);
  }

  .canli-desktop-view .league-matches {
    background: transparent;
  }

  .canli-desktop-view .ms-row {
    padding: 8px 12px;
    min-height: 40px;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    align-items: center;
  }

  .canli-desktop-view .ms-row:last-child {
    border-bottom: none;
  }

  .canli-desktop-view .ms-row:hover {
    background: rgba(34,197,94,0.06);
  }

  .canli-desktop-view .ms-row.match-row-live:hover {
    background: rgba(239,68,68,0.04);
  }

  .canli-desktop-view .ms-time {
    flex: 0 0 42px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
  }

  .canli-desktop-view .ms-status {
    flex: 0 0 36px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
  }

  .canli-desktop-view .ms-status.live {
    color: var(--accent-red);
    background: rgba(239,68,68,0.12);
    padding: 3px 6px;
    border-radius: 4px;
  }

  .canli-desktop-view .ms-status.ht {
    color: var(--accent-gold);
    background: rgba(245,158,11,0.12);
    padding: 3px 6px;
    border-radius: 4px;
  }

  .canli-desktop-view .ms-status.ft {
    color: rgba(255,255,255,0.5);
  }

  .canli-desktop-view .ms-team-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin: 0 4px;
  }

  .canli-desktop-view .ms-icon-yellow {
    font-size: 0.65rem;
    font-weight: 700;
    color: #eab308;
    min-width: 14px;
    text-align: center;
    background: rgba(234,179,8,0.2);
    padding: 1px 4px;
    border-radius: 3px;
  }

  .canli-desktop-view .ms-icon-red {
    font-size: 0.65rem;
    font-weight: 700;
    color: #ef4444;
    min-width: 14px;
    text-align: center;
    background: rgba(239,68,68,0.2);
    padding: 1px 4px;
    border-radius: 3px;
  }

  .canli-desktop-view .ms-home,
  .canli-desktop-view .ms-away {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    min-width: 0;
  }

  .canli-desktop-view .ms-home {
    flex-direction: row;
    justify-content: flex-end;
    gap: 4px;
  }

  .canli-desktop-view .ms-home .ms-team-name {
    flex: 0 1 auto;
    min-width: 0;
    text-align: right;
  }

  .canli-desktop-view .ms-away {
    flex-direction: row;
    justify-content: flex-start;
  }

  .canli-desktop-view .ms-home .ms-team-icons,
  .canli-desktop-view .ms-home .ms-card-icons {
    margin-right: 0;
    margin-left: 0;
  }

  .canli-desktop-view .ms-away .ms-team-icons,
  .canli-desktop-view .ms-away .ms-card-icons {
    margin-left: 6px;
  }

  .canli-desktop-view .ms-team-logo {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
  }

  .canli-desktop-view .ms-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .canli-desktop-view .ms-away .ms-team-name {
    text-align: left;
  }

  .canli-desktop-view .ms-home.winner .ms-team-name,
  .canli-desktop-view .ms-away.winner .ms-team-name {
    font-weight: 700;
  }

  .canli-desktop-view .ms-score-wrap {
    flex: 0 0 72px;
  }

  .canli-desktop-view .ms-score {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    min-width: 48px;
    display: inline-block;
    text-align: center;
  }

  .canli-desktop-view .ms-row.match-row-live .ms-score {
    color: var(--text-primary);
    background: rgba(34,197,94,0.08);
  }

  .canli-desktop-view .ms-ht {
    flex: 0 0 40px;
    min-width: 40px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
  }

  .canli-desktop-view .canli-desktop-loading,
  .canli-desktop-view .canli-desktop-error {
    padding: 48px 24px;
    border-radius: 12px;
    font-size: 0.92rem;
  }

  .canli-desktop-view .livescore-empty {
    padding: 48px 24px !important;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
  }

}

/* Küçük ekranlarda */
@media (max-width: 640px) {
  .home-matches-header {
    display: none !important;
  }

  .livescore .ms-row {
    gap: 6px 5px;
    padding: 0;
    min-height: 10px;
  }

  .ms-time { flex: 0 0 32px; font-size: 0.7rem; }
  .ms-status { flex: 0 0 24px; font-size: 0.6rem; }
  .ms-detail-icon { flex: 0 0 20px; }
  .ms-score-wrap { flex: 0 0 52px; }
  .ms-home, .ms-away { font-size: 0.75rem; }
  .ms-score { font-size: 0.78rem; }
  .ms-ht { flex: 0 0 28px; font-size: 0.65rem; }
  .ms-star-btn { flex: 0 0 28px; }

  .league-strip {
    padding: 5px 10px;
  }

  .league-strip-name {
    font-size: 0.72rem;
  }
}
