/* ============================================
   CricFlix v3 - Main Stylesheet
   Black/Red theme - Better than CricHD
   ============================================ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --red:       #cc0000;
  --red-dark:  #990000;
  --red-light: #ff3333;
  --black:     #0d0d0d;
  --dark:      #1a1a1a;
  --dark2:     #222222;
  --dark3:     #2d2d2d;
  --border:    #333333;
  --text:      #f0f0f0;
  --muted:     #999999;
  --green:     #00cc44;
  --shadow:    0 2px 8px rgba(0,0,0,0.5);
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--red-light); }

/* ── TOP BAR ── */
.top-bar {
  background: var(--red-dark);
  padding: 4px 0;
  font-size: 0.75rem;
}
.top-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-live {
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  display: inline-block;
}
.top-tagline { color: rgba(255,255,255,0.8); }

/* ── NAVBAR ── */
.navbar {
  background: var(--dark);
  border-bottom: 2px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.logo-icon { font-size: 1.4rem; }
.logo-flix { color: var(--red); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}
.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 9px;
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--red);
  color: #fff;
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: auto;
}
.nav-search {
  display: flex;
  gap: 4px;
}
.nav-search input {
  background: var(--dark2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  width: 180px;
  font-family: inherit;
}
.nav-search input:focus { outline: none; border-color: var(--red); }
.nav-search button {
  background: var(--red);
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* ── PAGE WRAP ── */
.page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

/* ── CONTENT LAYOUT ── */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  margin-top: 16px;
}

/* ── SECTION HEADERS ── */
.section-header {
  background: var(--dark2);
  border-left: 4px solid var(--red);
  padding: 10px 16px;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1px;
}
.section-header.red {
  background: var(--red-dark);
  border-left-color: #fff;
}

/* ── LIVE SECTION ── */
.live-section { margin-bottom: 16px; }
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
}
.live-card {
  background: var(--dark2);
  padding: 14px 16px;
  position: relative;
  transition: background 0.15s;
  border-bottom: 2px solid var(--red);
}
.live-card:hover { background: var(--dark3); }
.live-card-sport {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.live-card-teams {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.3;
}
.live-card-tour {
  font-size: 0.78rem;
  color: var(--muted);
}
.live-card-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  animation: pulse 1.5s infinite;
}

/* ── MATCHES LIST ── */
.matches-section { margin-bottom: 16px; }
.matches-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); }

.match-row {
  display: grid;
  grid-template-columns: 90px 32px 1fr auto 24px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--dark2);
  transition: background 0.12s;
  color: var(--text);
}
.match-row:hover { background: var(--dark3); }
.match-row.is-live { border-left: 3px solid var(--red); }

.match-status { font-size: 0.78rem; }
.badge-live {
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  animation: pulse 1.5s infinite;
  display: inline-block;
}
.match-time { color: var(--muted); font-size: 0.8rem; }
.match-sport-icon { font-size: 1.2rem; text-align: center; }
.match-teams { font-size: 0.9rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.match-meta { font-size: 0.72rem; color: var(--muted); }
.match-channels { display: flex; gap: 4px; flex-wrap: wrap; }
.ch-tag {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.match-arrow { color: var(--muted); font-size: 1.2rem; }

/* ── CHANNELS GRID ── */
.channels-section { margin-bottom: 16px; }
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1px;
  background: var(--border);
}
.ch-card {
  background: var(--dark2);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: background 0.15s;
}
.ch-card:hover { background: var(--dark3); }
.ch-card img { width: 60px; height: 40px; object-fit: contain; }
.ch-abbr-box {
  width: 60px; height: 40px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}
.ch-card-name { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

/* ── TEAMS SECTION ── */
.teams-section { margin-bottom: 16px; }
.teams-grid { background: var(--dark2); padding: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.team-btn {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.team-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ── SEO SECTION ── */
.seo-section {
  background: var(--dark2);
  padding: 20px;
  margin-bottom: 16px;
}
.seo-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.seo-section h3 { font-size: 0.9rem; color: var(--text); margin: 14px 0 6px; }
.seo-section p { font-size: 0.83rem; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.seo-section ol { padding-left: 20px; color: var(--muted); font-size: 0.83rem; line-height: 2; margin-bottom: 10px; }

/* ── FAQ ── */
.faq-wrap { margin-top: 14px; }
.faq-item {
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 6px;
  overflow: hidden;
}
.faq-item summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--red); font-size: 1.1rem; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 8px 14px 12px; font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--border); }

/* ── AD SLOT ── */
.ad-slot {
  background: var(--dark2);
  border: 1px dashed var(--border);
  padding: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* ── RIGHT SIDEBAR ── */
.sidebar-right { display: flex; flex-direction: column; gap: 16px; }
.sidebar-box {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.sidebar-box-title {
  background: var(--dark3);
  border-bottom: 2px solid var(--red);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-channels { list-style: none; max-height: 500px; overflow-y: auto; }
.sidebar-channels::-webkit-scrollbar { width: 3px; }
.sidebar-channels::-webkit-scrollbar-thumb { background: var(--border); }
.sidebar-channels li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  transition: all 0.12s;
}
.sidebar-channels li a:hover,
.sidebar-channels li a.active {
  background: var(--dark3);
  color: var(--red-light);
}
.sidebar-channels li a img { width: 28px; height: 20px; object-fit: contain; }
.ch-abbr-sm {
  width: 28px; height: 20px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-sports {
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sidebar-sports a {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 3px;
  transition: all 0.12s;
}
.sidebar-sports a:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ── PLAYER ── */
.player-wrap {
  background: #000;
  border: 2px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}
.player-inner {
  position: relative;
  aspect-ratio: 16/9;
}
.player-inner iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}
.player-bar {
  background: var(--dark2);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.player-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-dot-sm {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}
.player-btns { display: flex; gap: 6px; align-items: center; }
.s-btn {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.s-btn:hover, .s-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.fs-btn {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}
.fs-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ── STREAM TABLE ── */
.stream-table-wrap { margin-bottom: 16px; }
.stream-table-wrap h2 {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-style: italic;
  font-weight: 400;
}
.stream-table { width: 100%; border-collapse: collapse; }
.stream-table th {
  background: var(--dark3);
  color: var(--muted);
  padding: 8px 12px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 2px solid var(--red);
}
.stream-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.83rem;
  background: var(--dark2);
}
.stream-table tr:hover td { background: var(--dark3); }
.quality-badge {
  background: var(--green);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}
.watch-btn {
  background: var(--red);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
.watch-btn:hover { background: var(--red-light); }
.watch-btn.watching { background: var(--green); color: #000; }

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red-light); }
.breadcrumb span { color: var(--text); }

/* ── MATCH INFO BAR ── */
.match-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--dark2);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  border-left: 3px solid var(--red);
}

/* ── H1 ── */
h1 {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}

/* ── CHANNELS PAGE ── */
.channels-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
}
.ch-page-card {
  background: var(--dark2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: background 0.15s;
}
.ch-page-card:hover { background: var(--dark3); }
.ch-page-card img { width: 80px; height: 50px; object-fit: contain; }
.ch-page-card-name { font-size: 0.82rem; color: var(--text); font-weight: 500; }
.ch-page-card-lang { font-size: 0.72rem; color: var(--muted); }

/* ── SCHEDULE TABLE ── */
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th {
  background: var(--dark3);
  color: var(--muted);
  padding: 8px 12px;
  text-align: left;
  font-size: 0.78rem;
  border-bottom: 2px solid var(--red);
}
.schedule-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
  background: var(--dark2);
  color: var(--text);
}
.schedule-table tr:hover td { background: var(--dark3); }

/* ── ADMIN ── */
.admin-body { background: #f5f5f5; color: #333; }
.admin-nav { background: var(--red-dark); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.admin-nav .logo { color: #fff; font-size: 1.2rem; font-weight: 700; }
.admin-content { max-width: 1200px; margin: 20px auto; padding: 0 16px; }
.admin-card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.admin-card h2 { font-size: 1rem; margin-bottom: 16px; color: #333; border-bottom: 2px solid var(--red); padding-bottom: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { background: #f5f5f5; padding: 8px 12px; text-align: left; border-bottom: 2px solid #ddd; }
.admin-table td { padding: 8px 12px; border-bottom: 1px solid #eee; }
.admin-table tr:hover td { background: #fafafa; }
.admin-btn { background: var(--red); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: 600; }
.admin-btn.green { background: #198754; }
.admin-btn.gray { background: #6c757d; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: #555; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px;
  border: 1px solid #ddd; border-radius: 4px;
  font-size: 0.85rem; font-family: inherit;
}
.form-group textarea { height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── FOOTER ── */
.site-footer {
  background: var(--dark);
  border-top: 2px solid var(--red);
  padding: 24px 16px;
  margin-top: 32px;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.footer-nav a {
  color: var(--muted);
  font-size: 0.8rem;
  transition: color 0.15s;
}
.footer-nav a:hover { color: var(--red-light); }
.footer-disclaimer { color: var(--muted); font-size: 0.75rem; line-height: 1.7; }
.footer-disclaimer p { margin-bottom: 4px; }

/* ── ANIMATIONS ── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .content-layout { grid-template-columns: 1fr 200px; }
}
@media (max-width: 800px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar-right { display: none; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--dark); border-bottom: 2px solid var(--red); padding: 8px; z-index: 99; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-search { display: none; }
  .match-row { grid-template-columns: 80px 1fr 24px; }
  .match-sport-icon, .match-channels { display: none; }
  .channels-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .live-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .page-wrap { padding: 8px; }
  h1 { font-size: 1.1rem; }
  .match-row { grid-template-columns: 70px 1fr 20px; gap: 6px; padding: 8px 10px; }
}
