/* =========================================================
   ✅ CPL STANDINGS FINAL STABLE VERSION
========================================================= */

/* ================= WRAPPER ================= */
.cpl-standings-wrapper {
  direction: ltr;
  text-align: left;
  max-width: 1000px;
  margin: 25px auto;
  font-family: Arial, sans-serif;
}

/* ================= TABS ================= */
.cpl-standings-tabs-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.cpl-standings-tab-btn {
  background: #1a1a1a;
  color: #ccc;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.cpl-standings-tab-btn:hover {
  background: #2a2a2a;
  color: #fff;
}

.cpl-standings-tab-btn.active {
  background: #ffd700;
  color: #000;
  box-shadow: 0 0 6px rgba(255,215,0,0.5);
}

/* ================= GROUP VISIBILITY ================= */
/* ✅ مهم جدا: نلغي display:none خالص */
.cpl-group-box {
  margin-bottom: 25px;
}

/* ================= TITLE ================= */
.cpl-group-title {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #222;
}

/* ================= TABLE ================= */
.cpl-standings-table {
  width: 100%;
  border-collapse: collapse;
  background: #101010;
  border-radius: 12px;
  overflow: hidden;
}

/* HEADER */
.cpl-standings-table thead th {
  background: #151515;
  color: #bbb;
  padding: 10px 6px;
  font-size: 11px;
  text-align: center;
  font-weight: 800;
}

/* CELLS */
.cpl-standings-table tbody td {
  background: #111;
  color: #ddd;
  padding: 10px 6px;
  font-size: 13px;
  text-align: center;
  border-bottom: 1px solid #1e1e1e;
  transition: 0.2s;
}

/* ================= TEAM ================= */
.cpl-col-team {
  text-align: left !important;
}

.cpl-team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cpl-team-name {
  color: #fff;
  font-weight: 700;
}

/* ================= FLAGS ================= */
.cpl-flag {
  width: 26px;
  height: 18px;
  border-radius: 4px;
}

/* ================= QUALIFICATION ================= */
.cpl-row-top2 td {
  background: rgba(0, 200, 80, 0.15);
}

.cpl-row-best3 td {
  background: rgba(255, 215, 0, 0.12);
}

/* LEFT STRIP */
.cpl-row-top2 td:first-child {
  box-shadow: inset 4px 0 0 #22c55e;
}

.cpl-row-best3 td:first-child {
  box-shadow: inset 4px 0 0 #ffd700;
}

/* ================= POINTS ================= */
.cpl-standings-table th:last-child {
  background: #2a2400;
  color: #ffd700;
}

.cpl-standings-table td:last-child {
  color: #ffd700;
  font-weight: 900;
}

/* ================= USER TEAM ================= */
.cpl-my-team td {
  background: rgba(0,140,255,0.2);
  box-shadow: inset 4px 0 0 #0094ff;
}

.cpl-my-team .cpl-team-name {
  color: #4cc9ff !important;
  font-weight: 900;
}

/* ================= HOVER ================= */
.cpl-standings-table tbody tr:hover td {
  background: rgba(255,255,255,0.06);
}

/* ================= LEGEND ================= */
.cpl-legend {
  margin-bottom: 15px;
  font-size: 13px;
  color: #555;
}

/* ================= MOBILE ================= */
@media (max-width:768px){

  .cpl-standings-tabs-bar {
    overflow-x: auto;
    white-space: nowrap;
  }

  .cpl-standings-tab-btn {
    flex: 0 0 auto;
  }

  .cpl-standings-table td,
  .cpl-standings-table th {
    font-size: 11px;
    padding: 6px;
  }

  .cpl-flag {
    width: 22px;
    height: 16px;
  }

}
/* ===== FIX STANDINGS TABLE SIZE ===== */

.cpl-standings-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* الأعمدة كلها ثابتة */
.cpl-standings-table th,
.cpl-standings-table td {
    text-align: center;
    width: 55px;
    padding: 10px 6px;
}

/* عمود الترتيب */
.cpl-standings-table th:first-child,
.cpl-standings-table td:first-child {
    width: 40px;
}

/* عمود الفريق */
.cpl-standings-table .cpl-col-team {
    width: 260px !important;
    text-align: left !important;
}

/* محتوى الفريق */
.cpl-team-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* منع كسر النص */
.cpl-standings-table th,
.cpl-standings-table td {
    white-space: nowrap;
}
.cpl-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cpl-table-wrap table {
    min-width: 600px; /* مهم */
}
.cpl-table-wrap::-webkit-scrollbar {
    height: 6px;
}

.cpl-table-wrap::-webkit-scrollbar-thumb {
    background: #ffd800;
    border-radius: 10px;
}