/* ================================== */
/* === COMPLETE CATEGORY STYLESHEET === */
/* ================================== */

/* THEME & CORE VARIABLES (FROM HOMEPAGE) */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #161b22;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --accent-primary: #2f81f7;
  --accent-hover: #58a6ff;
  --border-color: #262626;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --placeholder-bg: #262626;
  --shimmer-color: rgba(255, 255, 255, 0.1);
  --accent-red: #e50914;
}

/* GENERAL & TYPOGRAPHY (FROM HOMEPAGE) */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* HEADER & NAVIGATION BUTTONS (FROM HOMEPAGE) */
.header-btn {
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
  cursor: pointer;
}
.header-btn:hover {
  background-color: #2a2a0a;
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}
.header-btn-discord:hover {
  background-color: #6a75f5;
  border-color: #6a75f5;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}
.header-search {
  flex-grow: 1;
  max-width: 400px;
}
.header-search input {
  width: 100%;
  transition: border-color 0.2s;
}
.header-search input:focus {
  border-color: var(--accent-primary);
}


/* MATCH CARD STYLES (FROM HOMEPAGE FOR PARITY) */
.match-card {
  flex-shrink: 0;
  width: 200px; /* Set a fixed width like on the homepage */
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  contain: content;
  text-decoration: none;
  color: inherit;
}
.match-card:hover {
  transform: translateY(-4px);
  will-change: transform;
}
.match-poster {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background-color: var(--placeholder-bg);
  display: block;
  aspect-ratio: 200 / 120;
}
.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #DC2626;
  color: #fff;
  padding: 2px 6px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: bold;
  z-index: 2; /* Ensure it's above the poster */
}
.status-badge.live {
  animation: pulse-red 1.5s infinite;
}
.status-badge.date {
  background: rgba(0,0,0,0.7);
}

/* NEW POPULAR BADGE STYLE */
.popular-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ea580c; /* Orange color like homepage viewers badge */
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  opacity: 0.95;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 2; /* Ensure it's above the poster */
}
.match-card:hover .popular-badge {
  transform: translateY(-2px) scale(1.1);
  opacity: 1;
}
.popular-badge svg {
  width: 16px;
  height: 16px;
}

.match-info {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-secondary);
}
.match-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--text-primary);
  height: 40px;
  line-height: 20px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}
.match-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
}
.match-category {
  text-transform: capitalize;
}

/* SEARCH OVERLAY STYLES (FROM HOMEPAGE) */
#search-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.6);display:none;justify-content:center;align-items:flex-start;padding-top:60px;z-index:9999;backdrop-filter:blur(4px)}
.search-overlay-content{background:var(--bg-secondary);width:95%;max-width:700px;border-radius:12px;padding:20px;box-shadow:0 8px 24px var(--shadow-color);position:relative;border:1px solid var(--border-color)}
#search-overlay input{background:var(--bg-primary);color:var(--text-primary);width:100%;padding:14px 18px;font-size:16px;border:2px solid var(--accent-primary);border-radius:10px;outline:none;margin-bottom:20px}
#search-overlay input:focus{border-color:var(--accent-hover);box-shadow:0 0 8px rgba(47,129,247,0.3)}
#search-close{position:absolute;top:1px;right:6px;font-size:30px;background:transparent;border:none;cursor:pointer;color:var(--text-secondary)}
#overlay-search-results{max-height:70vh;overflow-y:auto;display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.search-result-item{flex:0 0 200px}
.search-result-item .match-card:hover{transform:none}


/* ================================== */
/* === CATEGORY PAGE SPECIFIC STYLES === */
/* ================================== */

#category-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  
  text-align: center;
  color: var(--text-primary);
  text-transform: capitalize;
}

/* === NEW FILTER BAR STYLES === */
.filter-bar {
  position: sticky;
  top: 59px;
  z-index: 999;
 
  padding: 12px 20px;
  
  transition: box-shadow 0.2s;
}
.filter-bar.is-expanded {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.filter-toggle-btn::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath d='M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
    display: none;
    filter: invert(85%);
	margin-top:3px;
}

.filter-toggle-btn .arrow {
  transition: transform 0.3s ease;
}
.filter-bar.is-expanded .filter-toggle-btn .arrow {
  transform: rotate(180deg);
}
.active-filters-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.active-filter-tag{display:inline-flex;align-items:center;gap:6px;background:var(--accent-red);color:#fff;padding:4px 10px;border-radius:99px;font-size:13px;font-weight:500;text-transform:capitalize}
.remove-filter-btn{background:rgba(0,0,0,0.2);border:none;color:#fff;width:18px;height:18px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-weight:bold}
.filter-options {
  display: flex;
  gap: 15px;
  margin-top: 12px;
}
.filter-group {
  display: flex;
  gap: 10px;
}
.filter-btn, .filter-select {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.filter-btn:hover, .filter-select:hover {
  border-color: var(--text-secondary);
}
.filter-btn.active {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

/* === DATE & SECTION HEADERS === */
.section-header{font-size:1.1rem;font-weight:600;color:var(--text-primary);padding:1rem 0;margin-top:1.5rem;border-bottom:1px solid var(--border-color);margin-bottom:1rem;display:flex;align-items:center;gap:10px}
.section-header .date-day{color:var(--text-secondary);font-weight:400}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem 0;
}

/* SKELETON LOADER FOR THE GRID (FROM HOMEPAGE) */
.is-loading { background-color: var(--placeholder-bg); position: relative; overflow: hidden; border-color: var(--placeholder-bg) !important; color: transparent !important; cursor: default; pointer-events: none; }
.is-loading > * { visibility: hidden; }
.is-loading::after { content: ''; position: absolute; top: 0; left: -150%; width: 100%; height: 100%; transform: skewX(-20deg); background-image: linear-gradient(90deg, transparent, var(--shimmer-color), transparent); animation: shimmer 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1); }

.results-grid .match-card.is-loading {
  width: auto;
  aspect-ratio: 200 / 173;
}

/* ANIMATIONS (FROM HOMEPAGE) */
@keyframes pulse-red{0%,100%{opacity:1}50%{opacity:.8}}
@keyframes shimmer{100%{left:150%}}


/* RESPONSIVE MEDIA QUERIES */
@media (min-width: 1024px) {
  .fullpage { padding: 0 1.7rem; }
}

@media (max-width: 1024px) {
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .match-card { width: auto; }
}

@media (max-width: 768px) {
  .filter-bar { top: 53px; }
  
  /* UPDATED: Corrected Filter button alignment */
  .filter-toggle-btn {
    display: flex;
    width: 100%;
    align-items: center;
  }
  .filter-toggle-btn .arrow {
    margin-left: auto; /* Push arrow to the far right */
  }
  .filter-toggle-btn::before {
      display: inline-block; /* Show the icon */
  }

  .filter-options { display: none; flex-direction: column; align-items: stretch; }
  .filter-bar.is-expanded .filter-options { display: flex; }
  .filter-bar:not(.is-expanded) .active-filters-container { display: flex; }
  .filter-bar.is-expanded .active-filters-container { display: none; }

  .filter-options .filter-group:first-child {
      display: flex;
      width: 100%;
  }
  .filter-options .filter-group:first-child .filter-btn {
      flex-grow: 1;
      text-align: center;
  }
}

@media (max-width: 480px) {
  .fullpage { padding: 0 0.5rem; }
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .search-result-item { flex-basis: 150px; }
  .filter-bar { padding: 10px; }
}

@media (min-width: 769px) {
  .active-filter-tag[data-filter-key="live"],
  .active-filter-tag[data-filter-key="popular"] {
    display: none;
  }
}

@media (min-width: 1280px) {
  .results-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .match-card {
    width: auto;
  }
}