/* ========= SPORTS PORTAL — TEAMS, PLAYERS, STANDINGS ========= */

/* Common */
.sp-flag { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; vertical-align: middle; }
.sp-country-flag { width: 64px; height: 64px; object-fit: contain; }
.sp-sep { color: #555; margin: 0 2px; }
.sp-loading { color: #aaa; text-align: center; padding: 40px; font-size: 16px; }
.sp-empty { color: #777; text-align: center; padding: 30px; font-style: italic; }

/* League Tabs */
.sp-league-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 2px solid #1a1a2e;
}
.sp-ltab {
  padding: 10px 20px; background: #1a1a2e; color: #ccc;
  border: 1px solid #2a2a4e; border-radius: 8px; cursor: pointer;
  font-size: 14px; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.sp-ltab:hover { background: #2a2a4e; color: #fff; }
.sp-ltab.active { background: #e63946; color: #fff; border-color: #e63946; }

/* Teams Grid */
.sp-teams-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.sp-team-card {
  background: #1a1a2e; border: 1px solid #2a2a4e; border-radius: 12px;
  padding: 20px 16px; text-align: center; cursor: pointer;
  transition: all 0.25s; display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.sp-team-card:hover {
  transform: translateY(-4px); box-shadow: 0 8px 24px rgba(230,57,70,0.15);
  border-color: #e63946; background: #1f1f3a;
}
.sp-tc-badge img { width: 64px; height: 64px; object-fit: contain; }
.sp-tc-placeholder {
  width: 64px; height: 64px; background: #e63946; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
}
.sp-tc-name { font-weight: 600; font-size: 15px; color: #fff; }
.sp-tc-country {
  font-size: 12px; color: #aaa;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}

/* Detail Panel */
.sp-detail-panel {
  background: #111128; border: 1px solid #2a2a4e;
  border-radius: 16px; padding: 24px; margin-top: 24px;
}
.sp-back {
  background: none; border: 1px solid #555; color: #e63946;
  padding: 8px 16px; border-radius: 6px; cursor: pointer;
  font-size: 14px; margin-bottom: 16px; transition: background 0.2s;
}
.sp-back:hover { background: #1a1a2e; }

/* Banner */
.sp-banner img {
  width: 100%; max-height: 180px; object-fit: cover;
  border-radius: 10px; margin-bottom: 16px;
}

/* Team Header */
.sp-team-header {
  display: flex; gap: 20px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.sp-th-badge img { width: 96px; height: 96px; object-fit: contain; }
.sp-th-info { flex: 1; }
.sp-th-info h2 { color: #fff; font-size: 28px; margin: 0 0 8px; }
.sp-th-meta {
  color: #aaa; font-size: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.sp-th-league { color: #e63946; font-size: 14px; margin-top: 6px; }
.sp-th-jersey img { width: 80px; height: auto; object-fit: contain; }

/* Social Links */
.sp-socials { display: flex; gap: 10px; margin-top: 10px; }
.sp-socials a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #aaa !important;
  transition: all 0.2s; text-decoration: none; font-size: 14px;
}
.sp-socials a:hover { background: #e63946; color: #fff !important; }

/* Form Guide */
.sp-form-guide { display: flex; gap: 4px; margin-top: 8px; }
.sp-form-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.sp-form-w { background: #2d6a4f; }
.sp-form-d { background: #666; }
.sp-form-l { background: #c1121f; }

/* Tabs */
.sp-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
  border-bottom: 2px solid #1a1a2e; padding-bottom: 12px;
  overflow-x: auto;
}
.sp-tab {
  padding: 8px 16px; background: #1a1a2e; color: #ccc;
  border: none; border-radius: 6px; cursor: pointer;
  font-size: 13px; white-space: nowrap; transition: all 0.2s;
}
.sp-tab:hover { color: #fff; }
.sp-tab.active { background: #e63946; color: #fff; }

/* ========= SQUAD ========= */
.sp-squad-section { margin-bottom: 24px; }
.sp-squad-title {
  color: #e63946; font-size: 16px; font-weight: 700;
  margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid #2a2a4e;
}
.sp-squad-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.sp-player-card {
  background: #1a1a2e; border: 1px solid #2a2a4e; border-radius: 10px;
  padding: 12px; text-align: center; cursor: pointer;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.sp-player-card:hover {
  transform: translateY(-3px); box-shadow: 0 6px 20px rgba(230,57,70,0.15);
  border-color: #e63946;
}
.sp-pc-img { position: relative; margin-bottom: 8px; }
.sp-pc-img img {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; object-position: top;
  background: #0a0a1e;
}
.sp-pc-placeholder {
  width: 80px; height: 80px; background: #e63946; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff; margin: 0 auto;
}
.sp-pc-num {
  position: absolute; top: 0; right: calc(50% - 50px);
  background: #e63946; color: #fff; font-size: 11px;
  font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.sp-pc-name { font-weight: 600; font-size: 14px; color: #fff; margin-bottom: 4px; }
.sp-pc-meta { font-size: 12px; color: #aaa; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.sp-pc-pos { font-size: 11px; color: #e63946; margin-top: 4px; font-weight: 600; }

/* ========= PLAYER DETAIL OVERLAY ========= */
.sp-player-overlay {
  background: #0d0d20; border: 1px solid #2a2a4e;
  border-radius: 16px; padding: 24px; margin-top: 20px;
}
.sp-player-fanart img {
  width: 100%; max-height: 250px; object-fit: cover;
  border-radius: 12px; margin-bottom: 16px;
}
.sp-player-header {
  display: flex; gap: 20px; align-items: flex-start;
  margin-bottom: 20px; flex-wrap: wrap;
}
.sp-ph-img img {
  width: 140px; height: 140px; object-fit: cover;
  object-position: top; border-radius: 12px; background: #1a1a2e;
}
.sp-ph-info { flex: 1; }
.sp-ph-info h2 { color: #fff; font-size: 26px; margin: 0 0 6px; }
.sp-ph-number {
  display: inline-block; background: #e63946; color: #fff;
  font-size: 18px; font-weight: 800; padding: 4px 12px;
  border-radius: 6px; margin-left: 8px; vertical-align: middle;
}
.sp-ph-meta {
  color: #aaa; font-size: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 8px 0;
}
.sp-ph-stats {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px;
}
.sp-stat {
  background: #1a1a2e; border: 1px solid #2a2a4e; border-radius: 8px;
  padding: 10px 16px; text-align: center; min-width: 80px;
}
.sp-stat-label { display: block; font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.sp-stat-val { display: block; font-size: 15px; font-weight: 700; color: #fff; margin-top: 4px; }

.sp-player-bio { margin-top: 20px; }
.sp-player-bio h3 { color: #e63946; font-size: 16px; margin: 0 0 10px; }
.sp-player-bio p { color: #bbb; line-height: 1.7; font-size: 14px; white-space: pre-line; }

/* ========= EVENTS LIST ========= */
.sp-events-list { display: flex; flex-direction: column; gap: 8px; }
.sp-evt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: #1a1a2e; border-radius: 8px;
  flex-wrap: wrap; border-left: 3px solid #555; transition: background 0.2s;
}
.sp-evt-row:hover { background: #1f1f3a; }
.sp-evt-win { border-left-color: #2d6a4f; }
.sp-evt-loss { border-left-color: #c1121f; }
.sp-evt-draw { border-left-color: #666; }
.sp-evt-upcoming { border-left-color: #2196f3; }

.sp-evt-date { color: #888; font-size: 13px; min-width: 100px; }
.sp-evt-match {
  display: flex; align-items: center; gap: 8px; flex: 1;
  color: #fff; font-size: 14px;
}
.sp-evt-team {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; transition: color 0.2s;
}
.sp-evt-team:hover { color: #e63946; }
.sp-evt-badge { width: 20px; height: 20px; object-fit: contain; }
.sp-evt-score { color: #e63946; font-weight: 800; font-size: 15px; min-width: 50px; text-align: center; }
.sp-evt-vs { color: #666; font-weight: 600; }
.sp-evt-result {
  padding: 3px 10px; border-radius: 4px; font-weight: 700; font-size: 13px; color: #fff;
}
.sp-evt-league { color: #777; font-size: 12px; }
.sp-evt-venue { color: #666; font-size: 12px; }
.sp-evt-video {
  color: #e63946; font-size: 12px; font-weight: 600;
  text-decoration: none; transition: color 0.2s;
}
.sp-evt-video:hover { color: #ff6b7a; }

/* ========= STANDINGS TABLE ========= */
.sp-standings { width: 100%; overflow-x: auto; }
.sp-st-header {
  display: flex; padding: 12px 16px; background: #e63946;
  border-radius: 8px 8px 0 0; font-weight: 700; color: #fff; font-size: 13px;
}
.sp-st-row {
  display: flex; padding: 12px 16px; background: #1a1a2e;
  border-bottom: 1px solid #2a2a4e; cursor: pointer;
  transition: background 0.2s; align-items: center; font-size: 13px;
}
.sp-st-row:hover { background: #1f1f3a; }
.sp-st-row:last-child { border-radius: 0 0 8px 8px; }
.sp-st-highlight { background: rgba(230,57,70,0.1); border-left: 3px solid #e63946; }
.sp-st-pos { width: 35px; font-weight: 700; color: #e63946; flex-shrink: 0; }
.sp-st-team {
  flex: 1; color: #fff; display: flex; align-items: center; gap: 8px;
  min-width: 120px; font-weight: 600;
}
.sp-st-badge { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.sp-st-num { width: 35px; text-align: center; color: #aaa; flex-shrink: 0; }
.sp-st-pts { color: #fff !important; font-weight: 700 !important; }
.sp-st-form { display: flex; gap: 3px; min-width: 80px; flex-shrink: 0; }

/* ========= ABOUT ========= */
.sp-about-text { color: #bbb; line-height: 1.7; font-size: 14px; white-space: pre-line; }

/* ========= RANKINGS ========= */
.sp-rank-title { color: #fff; font-size: 20px; margin: 0 0 16px; }
.sp-rankings { width: 100%; }
.sp-rk-header {
  display: flex; padding: 12px 16px; background: #e63946;
  border-radius: 8px 8px 0 0; font-weight: 700; color: #fff; font-size: 14px;
}
.sp-rk-row {
  display: flex; padding: 14px 16px; background: #1a1a2e;
  border-bottom: 1px solid #2a2a4e; cursor: pointer;
  transition: background 0.2s; align-items: center;
}
.sp-rk-row:hover { background: #1f1f3a; }
.sp-rk-row:last-child { border-radius: 0 0 8px 8px; }
.sp-rk-pos { width: 40px; font-weight: 700; color: #e63946; }
.sp-rk-name { flex: 1; color: #fff; display: flex; align-items: center; gap: 8px; }
.sp-rk-country { width: 120px; color: #aaa; }
.sp-rk-pts { width: 80px; text-align: right; color: #fff; font-weight: 600; }

/* ========= MATCH DETAIL OVERLAY ========= */
.sp-match-clickable { cursor: pointer; }
.sp-match-clickable:hover { background: rgba(255,255,255,0.03); }

.sp-team-link { cursor: pointer; transition: color 0.2s; }
.sp-team-link:hover { color: #e63946 !important; text-decoration: underline; }

.sp-match-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(4px);
}
.sp-match-panel {
  background: #111128; border: 1px solid #2a2a4e;
  border-radius: 16px; padding: 28px; max-width: 600px;
  width: 100%; max-height: 90vh; overflow-y: auto; position: relative;
}
.sp-match-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: #aaa;
  font-size: 28px; cursor: pointer; line-height: 1;
  padding: 0; transition: color 0.2s;
}
.sp-match-close:hover { color: #e63946; }

.sp-mp-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid #2a2a4e;
}
.sp-mp-team { text-align: center; flex: 1; }
.sp-mp-badge { width: 64px; height: 64px; object-fit: contain; margin-bottom: 8px; }
.sp-mp-team-name { color: #fff; font-weight: 700; font-size: 16px; }
.sp-mp-team-link { cursor: pointer; transition: color 0.2s; }
.sp-mp-team-link:hover { color: #e63946; }

.sp-mp-score-center { text-align: center; flex-shrink: 0; }
.sp-mp-score {
  font-size: 32px; font-weight: 900; color: #e63946;
  margin-bottom: 8px; letter-spacing: 2px;
}
.sp-mp-vs { color: #666; font-size: 24px; }

.sp-mp-info { margin-bottom: 20px; }
.sp-mp-info-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #1a1a2e;
}
.sp-mp-info-label { color: #888; font-size: 13px; }
.sp-mp-info-val { color: #fff; font-size: 13px; font-weight: 600; }

.sp-mp-video-btn {
  display: block; text-align: center; background: #e63946;
  color: #fff !important; padding: 12px 24px; border-radius: 8px;
  font-weight: 700; text-decoration: none; margin-bottom: 16px;
  transition: background 0.2s;
}
.sp-mp-video-btn:hover { background: #c1121f; }

.sp-mp-team-links {
  display: flex; gap: 12px; justify-content: center; margin-top: 16px;
}
.sp-mp-btn {
  padding: 10px 20px; border-radius: 8px; font-weight: 600;
  font-size: 13px; text-decoration: none; transition: all 0.2s;
  text-align: center;
}
.sp-mp-btn { background: #e63946; color: #fff !important; }
.sp-mp-btn:hover { background: #c1121f; }
.sp-mp-btn-outline {
  background: transparent !important; color: #e63946 !important;
  border: 1px solid #e63946;
}
.sp-mp-btn-outline:hover { background: rgba(230,57,70,0.1) !important; }

/* ========= RESPONSIVE ========= */
@media (max-width: 768px) {
  .sp-teams-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .sp-team-card { padding: 14px 10px; }
  .sp-tc-badge img, .sp-country-flag { width: 48px; height: 48px; }
  .sp-th-info h2 { font-size: 22px; }
  .sp-team-header { flex-direction: column; text-align: center; }
  .sp-league-tabs { gap: 4px; }
  .sp-ltab { padding: 8px 12px; font-size: 12px; }
  .sp-squad-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .sp-player-card { padding: 10px 8px; }
  .sp-pc-img img { width: 60px; height: 60px; }
  .sp-ph-img img { width: 100px; height: 100px; }
  .sp-rk-country { display: none; }
  .sp-rk-row, .sp-rk-header { font-size: 13px; }
  .sp-evt-row { flex-direction: column; gap: 4px; text-align: center; }
  .sp-evt-match { flex-wrap: wrap; justify-content: center; }
  .sp-st-num:nth-child(n+7) { display: none; }
  .sp-st-form { display: none; }
  .sp-mp-header { flex-direction: column; gap: 12px; }
  .sp-mp-badge { width: 48px; height: 48px; }
  .sp-mp-score { font-size: 24px; }
  .sp-mp-team-links { flex-direction: column; }
  .sp-match-panel { padding: 20px 16px; }
  .sp-ph-stats { gap: 8px; }
  .sp-stat { padding: 8px 12px; min-width: 70px; }
  .sp-player-header { flex-direction: column; align-items: center; text-align: center; }
}
