/* ============================================
   v2/css/competitions.css
   استایل لیست لیگ‌ها + جزئیات لیگ
   سایت اخبار استقلال — نسخه ۲
   نسخه: 2.1 — جدول تمام‌عرض بدون باکس
   ============================================ */

/* ============================================
   1) List Page
   ============================================ */
.competitions-page {
  padding: 12px;
}

.competition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.competition-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .3s, border-color .3s;
  touch-action: manipulation;
  text-decoration: none;
  color: inherit;
  display: block;
}

.competition-card:hover,
.competition-card:active {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.competition-card .comp-icon {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.competition-card .comp-name {
  font-weight: 700;
  color: var(--primary);
  font-size: .9rem;
  margin-bottom: 4px;
}

.competition-card .comp-desc {
  font-size: .65rem;
  color: var(--text-muted);
}

/* ============================================
   2) Detail Page — حذف padding اضافی
   ============================================ */
.competition-detail-page {
  padding: 0 0 20px;
}

/* ============================================
   3) Tabs
   ============================================ */
.comp-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 2px solid var(--bg);
  margin-bottom: 0;
}

.comp-tabs::-webkit-scrollbar { display: none; }

.comp-tab {
  padding: 10px 18px;
  border-radius: 25px;
  font-size: .78rem;
  font-weight: 600;
  color: #5a6a7a;
  background: var(--bg);
  border: none;
  cursor: pointer;
  transition: all .3s;
  white-space: nowrap;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.comp-tab i { font-size: .85rem; }

.comp-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(21,96,189,.25);
}

.comp-tab.active i { color: var(--gold); }

.comp-tab-content {
  display: none;
}

.comp-tab-content.active {
  display: block;
  animation: fadeIn .3s ease;
}

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

/* ============================================
   4) Source Badges
   ============================================ */
.comp-source-badges {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  flex-wrap: wrap;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.comp-source-badges .source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
}

.comp-source-badges .source-badge.api {
  background: linear-gradient(145deg, #e8f4fd, #d0e8fb);
  color: #0d5aa0;
  border: 1px solid #b8d9ff;
}

.comp-source-badges .source-badge.manual {
  background: linear-gradient(145deg, #f5f5f5, #e8ecf0);
  color: #5a6a7a;
  border: 1px solid #d0d8e0;
}

.comp-source-badges .source-badge i {
  font-size: .75rem;
}

/* ============================================
   5) Table Tab — بدون باکس، تمام‌عرض
   ============================================ */
.comp-table-wrap {
  background: #fff;
  border-radius: 0;
  padding: 0;
  border: none;
  margin: 0;
}

.comp-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  min-width: 100%;
  table-layout: auto;
}

.comp-table thead tr {
  background: var(--primary);
  color: #fff;
}

.comp-table thead th {
  padding: 10px 4px;
  font-weight: 700;
  text-align: center;
  font-size: .72rem;
  white-space: nowrap;
}

.comp-table thead th:nth-child(2) { text-align: right; padding-right: 12px; }

.comp-table tbody tr {
  background: #fff;
  border-bottom: 1px solid var(--bg);
  transition: background .2s;
}

.comp-table tbody tr:hover {
  background: var(--bg-light);
}

.comp-table tbody tr:last-child { border-bottom: none; }

.comp-table tbody tr.is-esteghlal {
  background: rgba(245, 200, 66, .15);
  border-right: 3px solid var(--gold);
}

.comp-table tbody tr.is-esteghlal:hover {
  background: rgba(245, 200, 66, .25);
}

.comp-table tbody td {
  padding: 10px 4px;
  text-align: center;
  color: var(--text-secondary);
  font-size: .78rem;
}

.comp-table tbody td:first-child {
  font-weight: 700;
  color: var(--primary);
  width: 30px;
  padding-right: 8px;
  padding-left: 8px;
}

.comp-table tbody td:nth-child(2) {
  text-align: right;
  padding-right: 8px;
  padding-left: 4px;
  min-width: 120px;
}

.comp-table tbody td.points-col {
  font-weight: 800;
  color: var(--primary);
  background: rgba(21, 96, 189, .05);
}

/* تیم سلول */
.team-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.team-cell img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 2px;
}

.team-cell strong {
  color: var(--primary);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ============================================
   6) Matches Tab
   ============================================ */
.comp-week-selector {
  margin: 12px;
  margin-bottom: 16px;
}

.comp-week-selector label {
  display: block;
  font-size: .78rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.comp-week-dropdown {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .3s;
  direction: rtl;
}

.comp-week-dropdown:focus {
  border-color: var(--gold);
}

.comp-matches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px;
}

.comp-match {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  transition: border-color .3s, transform .2s;
  cursor: pointer;
  touch-action: manipulation;
}

.comp-match:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.comp-match.live {
  border-color: var(--danger);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(231, 76, 60, .1); }
  50%      { box-shadow: 0 4px 16px rgba(231, 76, 60, .3); }
}

.comp-match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.comp-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.comp-team img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 2px;
}

.comp-team span {
  font-size: .75rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.comp-match-score {
  background: var(--bg);
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  flex-shrink: 0;
  min-width: 60px;
  text-align: center;
}

.comp-match-score.has-score {
  background: var(--primary);
  color: #fff;
}

.comp-match-date {
  text-align: center;
  font-size: .68rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.comp-match-date i {
  color: var(--gold);
}

/* ============================================
   7) Scorers Tab
   ============================================ */
.comp-scorers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}

.comp-scorer-row {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .3s;
}

.comp-scorer-row:hover { border-color: var(--gold); }

.comp-scorer-rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--primary);
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comp-scorer-row.top-1 .comp-scorer-rank {
  background: linear-gradient(145deg, #f5c842, #e0b02e);
  color: #1560bd;
  box-shadow: 0 4px 12px rgba(245,200,66,.4);
}

.comp-scorer-row.top-2 .comp-scorer-rank {
  background: linear-gradient(145deg, #c0c8d0, #9aa4b0);
  color: #fff;
}

.comp-scorer-row.top-3 .comp-scorer-rank {
  background: linear-gradient(145deg, #cd7f32, #a05a1f);
  color: #fff;
}

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

.comp-scorer-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.comp-scorer-team {
  font-size: .7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.comp-scorer-goals {
  background: var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 50px;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.comp-scorer-goals i {
  color: var(--gold);
  font-size: .75rem;
}

/* ============================================
   8) Responsive
   ============================================ */
@media (max-width: 380px) {
  .comp-table { font-size: .72rem; }
  .comp-table thead th { font-size: .65rem; padding: 8px 2px; }
  .comp-table tbody td { padding: 8px 2px; font-size: .72rem; }
  .team-cell strong { font-size: .72rem; }
  .team-cell img { width: 20px; height: 20px; }
  .comp-tab { padding: 8px 14px; font-size: .72rem; }
  .comp-source-badges .source-badge { font-size: .65rem; padding: 3px 10px; }
}