/* ══════════════════════════════════════════════════════════
   SP UPGRADE v3 — ESPN-Level Features
   Bottom Nav, Ticker, Tabs, Breadcrumbs, Blog Cards, etc.
   ══════════════════════════════════════════════════════════ */

/* ── 1. FIXED BOTTOM NAVIGATION BAR ── */
.sp-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #0d1117;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 20px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sp-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #6b7280;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s;
  min-width: 56px;
}
.sp-bottom-nav a .sp-bnav-icon {
  font-size: 1.25rem;
  line-height: 1;
}
.sp-bottom-nav a.sp-bnav-active,
.sp-bottom-nav a:hover {
  color: #e41e31;
}
.sp-bottom-nav a.sp-bnav-active .sp-bnav-icon {
  color: #e41e31;
}
body {
  padding-bottom: 64px !important;
}
@media (min-width: 1025px) {
  .sp-bottom-nav { display: none; }
  body { padding-bottom: 0 !important; }
}

/* ── 2. LIVE MATCH TICKER ── */
.sp-ticker-wrap {
  background: #111827;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
  z-index: 100;
}
.sp-ticker-inner {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  padding: 0;
}
.sp-ticker-inner::-webkit-scrollbar { display: none; }
.sp-ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-right: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 180px;
}
.sp-ticker-item:hover { background: rgba(255,255,255,0.04); }
.sp-ticker-team {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #d1d5db;
  font-weight: 600;
}
.sp-ticker-team img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 2px;
}
.sp-ticker-vs {
  font-size: 0.65rem;
  color: #6b7280;
  font-weight: 700;
}
.sp-ticker-score {
  font-size: 0.72rem;
  color: #fff;
  font-weight: 700;
}
.sp-ticker-badge {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
}
.sp-ticker-badge-live {
  background: #dc2626;
  color: #fff;
  animation: pulse 2s infinite;
}
.sp-ticker-badge-ft { background: #374151; color: #9ca3af; }
.sp-ticker-badge-sch { background: #1e3a5f; color: #60a5fa; }
.sp-ticker-label {
  background: #e41e31;
  color: #fff;
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

/* ── 3. STATUS TABS (Live/Upcoming/Results) ── */
.sp-status-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.sp-status-tab {
  flex: 1;
  padding: 10px 16px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sp-status-tab:hover { color: #d1d5db; background: rgba(255,255,255,0.03); }
.sp-status-tab.sp-tab-active {
  color: #fff;
  border-bottom-color: #e41e31;
  background: rgba(228,30,49,0.08);
}
.sp-status-tab .sp-tab-count {
  font-size: 0.65rem;
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.sp-status-tab.sp-tab-active .sp-tab-count {
  background: rgba(228,30,49,0.3);
}

/* ── 4. BREADCRUMBS ── */
.sp-breadcrumbs {
  padding: 10px 16px;
  font-size: 0.78rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sp-breadcrumbs a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
}
.sp-breadcrumbs a:hover { color: #e41e31; }
.sp-breadcrumbs .sp-bc-sep { color: #4b5563; font-size: 0.7rem; }
.sp-breadcrumbs .sp-bc-current { color: #d1d5db; font-weight: 600; }

/* ── 5. TOP STORIES SECTION ── */
.sp-top-stories {
  margin: 20px 0;
  padding: 0;
}
.sp-top-stories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
}
.sp-top-stories-header h2 {
  font-size: 1.15rem !important;
  font-weight: 800;
  color: #fff !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sp-top-stories-header a {
  font-size: 0.8rem;
  color: #e41e31;
  text-decoration: none;
  font-weight: 600;
}
.sp-stories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.sp-story-card {
  display: flex;
  gap: 12px;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  transition: all 0.2s;
}
.sp-story-card:hover {
  border-color: rgba(228,30,49,0.3);
  background: #1a2035;
}
.sp-story-thumb {
  width: 110px;
  min-height: 80px;
  flex-shrink: 0;
  object-fit: cover;
}
.sp-story-body {
  padding: 10px 12px 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.sp-story-cat {
  font-size: 0.65rem;
  color: #e41e31;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sp-story-title {
  font-size: 0.88rem;
  color: #e5e7eb;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-story-meta {
  font-size: 0.7rem;
  color: #6b7280;
  display: flex;
  gap: 8px;
  align-items: center;
}
@media (min-width: 768px) {
  .sp-stories-grid { grid-template-columns: repeat(2, 1fr); }
  .sp-story-card:first-child {
    grid-column: 1 / -1;
    flex-direction: column;
  }
  .sp-story-card:first-child .sp-story-thumb {
    width: 100%;
    height: 200px;
  }
  .sp-story-card:first-child .sp-story-body {
    padding: 14px 16px;
  }
  .sp-story-card:first-child .sp-story-title {
    font-size: 1.1rem;
    -webkit-line-clamp: 3;
  }
}

/* ── 6. TOURNAMENT GROUPING ── */
.sp-tournament-group {
  margin-bottom: 16px;
}
.sp-tournament-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px 8px 0 0;
  border-left: 3px solid var(--accent, #e41e31);
  margin-bottom: 0;
}
.sp-tournament-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #d1d5db;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sp-tournament-count {
  font-size: 0.7rem;
  color: #6b7280;
}

/* ── 7. BLOG CARD LAYOUT ── */
.sp-blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0;
}
.sp-blog-card {
  display: flex;
  gap: 14px;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  transition: all 0.2s;
}
.sp-blog-card:hover {
  border-color: rgba(228,30,49,0.3);
  transform: translateY(-2px);
}
.sp-blog-card-thumb {
  width: 130px;
  min-height: 100px;
  flex-shrink: 0;
  object-fit: cover;
}
.sp-blog-card-body {
  padding: 12px 14px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sp-blog-card-cat {
  font-size: 0.68rem;
  color: #e41e31;
  font-weight: 700;
  text-transform: uppercase;
}
.sp-blog-card-title {
  font-size: 0.95rem;
  color: #e5e7eb;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-blog-card-excerpt {
  font-size: 0.8rem;
  color: #9ca3af;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-blog-card-meta {
  font-size: 0.72rem;
  color: #6b7280;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}
@media (min-width: 768px) {
  .sp-blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .sp-blog-grid { grid-template-columns: repeat(3, 1fr); }
  .sp-blog-card { flex-direction: column; }
  .sp-blog-card-thumb { width: 100%; height: 160px; }
  .sp-blog-card-body { padding: 14px; }
}

/* ── 8. MATCH DETAIL PAGE — COMPACT HEADER ── */
body.page .sp-match-header-compact {
  background: #0d1117;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 500;
}
body.page .sp-match-header-compact .sp-mhc-back {
  color: #9ca3af;
  font-size: 1.2rem;
  text-decoration: none;
}
body.page .sp-match-header-compact .sp-mhc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

/* ── 9. MATCH DETAIL TABS ── */
.sp-detail-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  background: #111827;
  border-radius: 10px 10px 0 0;
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: none;
  margin-top: 12px;
}
.sp-detail-tabs::-webkit-scrollbar { display: none; }
.sp-detail-tab {
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.sp-detail-tab:hover { color: #d1d5db; }
.sp-detail-tab.sp-dtab-active {
  color: #fff;
  border-bottom-color: #e41e31;
}
.sp-detail-panel {
  display: none;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px;
}
.sp-detail-panel.sp-dpanel-active { display: block; }

/* ── 10. SOCIAL SHARE — COLLAPSED ── */
.sp-share-collapsed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sp-share-toggle {
  background: #1a2035;
  border: 1px solid rgba(255,255,255,0.1);
  color: #9ca3af;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.sp-share-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.sp-share-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #1a2035;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px;
  z-index: 100;
  gap: 4px;
  flex-direction: column;
  min-width: 150px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.sp-share-dropdown.sp-share-open { display: flex; }
.sp-share-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #d1d5db;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s;
}
.sp-share-dropdown a:hover { background: rgba(255,255,255,0.05); }

/* ── 11. BRAND LOGO ENHANCEMENT ── */
.site-title a, .site-branding .site-title a {
  font-size: 1.5rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #e41e31, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-branding .site-description {
  font-size: 0.72rem !important;
  color: #6b7280 !important;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── 12. COOKIE BANNER — SMALLER, AUTO-DISMISS ── */
#sp-cookie-banner {
  max-height: 60px;
  padding: 8px 16px !important;
}
#sp-cookie-banner .sp-cookie-inner {
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
}
#sp-cookie-banner .sp-cookie-inner p {
  font-size: 0.78rem !important;
  margin: 0 !important;
  flex: 1;
}
#sp-cookie-banner .sp-cookie-btns {
  flex-shrink: 0;
}

/* ── 13. SKELETON LOADER FOR BLOG ── */
.sp-skeleton {
  background: linear-gradient(90deg, #111827 25%, #1a2035 50%, #111827 75%);
  background-size: 200% 100%;
  animation: sp-shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes sp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.sp-skeleton-card {
  height: 100px;
  margin-bottom: 12px;
  border-radius: 10px;
}

/* ── 14. MATCH CARD ENHANCEMENTS ── */
.sp-match-row {
  border-radius: 10px;
  margin-bottom: 8px;
}
.sp-team-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.sp-match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}
.sp-team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.sp-team-away {
  justify-content: flex-end;
  text-align: right;
}

/* Winner highlight */
.sp-winner { color: #fff !important; font-weight: 800 !important; }
.sp-winner-check { color: #22c55e; font-size: 0.75rem; margin-left: 4px; }

/* ── 15. HIDE OLD SOCIAL BAR ON MATCH PAGES ── */
body.page .sp-share-bar {
  display: none !important;
}

/* ── 16. HIDE HEADER CLUTTER ON MATCH PAGES ── */
body.page .sp-header-social,
body.page .site-description {
  display: none !important;
}
