/* ================================== */
/*         THEME VARIABLES            */
/* ================================== */
: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 STYLES            */
/* ================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg-primary); color: var(--text-primary); }
.fullpage { padding: 0 1rem; }
.hidden { display: none !important; }

/* ================================== */
/*        SHARED COMPONENTS           */
/* ================================== */
.site-header { position: sticky; top: 0; left: 0; width: 100%; background: var(--bg-primary); border-bottom: 1px solid var(--border-color); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; z-index: 1000; margin-bottom: 15px; }
.header-left { display: flex; align-items: center; gap: 12px; flex-grow: 1; min-width: 0; }
.site-logo img { height: 40px; border-radius: 6px; display: block; }
.header-search { max-width: 400px; width: 100%; }
.header-search input { background: var(--bg-secondary); color: var(--text-primary); padding: 8px 12px; font-size: 14px; border: 2px solid var(--border-color); border-radius: 6px; outline: none; }
.header-search input:focus { border-color: var(--accent-primary); }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 6px; text-decoration: none; font-size: 14px; font-weight: 600; transition: all 0.2s ease-in-out; cursor: pointer; white-space: nowrap; background-color: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); }
.header-btn:hover { background-color: #2a2a2a; border-color: var(--text-secondary); transform: translateY(-1px); }
.header-btn-discord { background-color: #5865F2; color: #fff; border-color: #5865F2; }
#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(26,115,232,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: 5px; justify-content: center; }
.search-result-item { flex: 0 0 200px; background: var(--bg-secondary); border-radius: 0.5rem; overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; position: relative; }
.search-result-item:hover { transform: translateY(-4px); box-shadow: 0 6px 16px var(--shadow-color); }
.match-poster { width: 100%; height: auto; aspect-ratio: 200 / 120; object-fit: cover; }
.status-badge { position: absolute; top: 10px; left: 10px; background: #DC2626; color: #fff; padding: 2px 4px; border-radius: 9999px; font-size: 12px; font-weight: bold; }
.status-badge.date { background: rgba(0,0,0,0.7); }
.match-info { padding: 10px; }
.match-title { font-size: 15px; font-weight: bold; margin-bottom: 6px; height: 40px; line-height: 20px; overflow: hidden; }
.match-meta-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-secondary); }
.no-results { text-align: center; color: var(--text-secondary); font-size: 1.1rem; padding: 60px 20px; background-color: var(--bg-secondary); border-radius: 0.5rem; border: 1px solid var(--border-color); }

/* ================================== */
/*      WATCH PAGE SPECIFIC STYLES    */
/* ================================== */
.match-details-container { max-width: 900px; margin: 15px auto; padding: 1rem; }

/* --- Stream Player --- */
#stream-player-container { position: relative; width: 100%; aspect-ratio: 16 / 9; background-color: #000; border-radius: 8px; overflow: hidden; margin-bottom: 3rem; box-shadow: 0 8px 25px var(--shadow-color); }
#stream-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.error-message { color: #f56565; background-color: #4a2a2a; padding: 1rem; border-radius: 8px; text-align: center; }

/* --- Watch Page Header --- */
.watch-page-header { margin-bottom: 2rem; }
#watch-title { font-size: clamp(1.5rem, 3vw, 2rem); }
#watch-description { color: var(--text-primary); font-size: 1rem; line-height: 1.6; margin-top: 0.5rem; }

/* --- Stream List Section (Shared styles from Match Info) --- */


.viewers-count {color:#dc2626cc;}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;}
.section-header h2 { font-size: 1.5rem; }
.back-button-styled { background: #111; border: 1px solid var(--border-color); color: var(--text-secondary); font-size: 0.9rem; font-weight: 600; padding: 8px 14px; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.5px; }
.back-button-styled:hover { background-color: var(--bg-secondary); color: var(--text-primary); border-color: var(--accent-red); }
.back-button-styled .separator { color: var(--accent-red); }
#sources-summary { font-size: 0.9rem; color: var(--text-secondary); font-style: italic; margin-bottom: 1.5rem; padding-bottom: 1rem; min-height: 22px; }
.stream-source { background-color: var(--bg-secondary); border: 1px solid #fbbf24b3; border-radius: 0.75rem; margin-bottom: 1.5rem; padding: 1rem 1.25rem; box-shadow: 0 4px 12px var(--shadow-color); }
.stream-source.hidden-source { display: none; }
.source-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.source-name { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.source-count { font-size: 0.9rem; font-weight: 500; color: var(--accent-red); background-color: #dc26261a; padding: 4px 10px; border-radius: 9999px; }
.source-desc { display: block; margin-bottom: 1.25rem; color: var(--text-secondary); font-size: 0.9rem; }
.stream-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background-color: var(--bg-primary); border: 1px solid var(--border-color); margin: 0.5rem 0; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s ease; text-decoration: none; color: var(--text-primary); }
.stream-row:hover:not(.active) { background-color: #1a1a1a; border-color: var(--accent-primary); transform: translateY(-2px); }

/* === THIS IS THE FIX === */
/* It makes the left-side label grow to fill empty space, allowing the "Running" badge to be pushed to its right edge. */
.stream-label { display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }

.quality-tag { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 400; color: var(--accent-red); text-transform: uppercase; min-width: 35px; text-align: center; }
.quality-tag.hd { background-color: #dc262633; }
.quality-tag.sd { background-color: #26262680; color: var(--text-primary);}
.stream-meta { display: flex; align-items: center; gap: 1rem; color: var(--text-secondary); font-size: 0.9rem; }
.viewers-count, .stream-lang { display: flex; align-items: center; gap: 5px; flex-grow: 1;}
.open-arrow { display: inline-flex; align-items: center; color: var(--text-secondary); opacity: 0.6; transition: all 0.2s ease; margin-left: auto;}
.stream-row:hover .open-arrow { opacity: 1; color: var(--accent-hover); }

/* --- ACTIVE STREAM ROW STYLING --- */
.stream-row.active { background-color: #010416; border-left: 3px solid #dc2626cc; padding-left: calc(1rem - 3px); cursor: default; }
.stream-row.active .open-arrow { display: none; }
.status-running { font-size: 0.8rem; font-weight: 600; color: #dc2626cc; margin-left: auto; }

.show-all-btn { display: block; width: 100%; text-align: center; padding: 12px; margin-top: 1rem; background-color: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 0.5rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.show-all-btn:hover { background-color: #2a2a2a; border-color: var(--accent-primary); }
.skeleton { background-color: var(--bg-secondary); color: transparent; border-radius: 6px; user-select: none; position: relative; overflow: hidden; display: inline-block; width: 100%; }
.skeleton::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.6, 1); }
@keyframes shimmer { 100% { left: 150%; } }
.skeleton-summary { height: 22px; border-radius: 4px; }
.stream-source.is-loading { border-color: transparent; box-shadow: none; pointer-events: none; position: relative; min-height: 150px; }
.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; }
@media (max-width: 768px) {
  .site-logo { display: none; }
  .site-header { padding: 8px 12px; }
  .header-btn { padding: 6px 10px; font-size: 13px; }
  #watch-title { font-size: 1.3rem; }
  #watch-description { font-size: 0.9rem; }
  .stream-row {align-items: flex-start; gap: 10px; }
  .stream-meta { margin-right: auto;}
  .stream-label { width: 100%; display: block;}
  .status-running, .open-arrow { margin-left: auto; padding-left: 8px;}
}
@media (max-width: 480px) {
  .fullpage { padding: 0 0.5rem; }
  .header-search { max-width: 140px; }
  .header-left { gap: 8px; }
  .source-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .source-name { font-size: 1.25rem; }
  .match-details-container { padding: 0; }
  .stream-row { padding: 0.65rem 0.4rem; }
  .stream-source { padding: 1rem; }
  .stream-meta { font-size: 0.8rem; }
  .stream-label { font-size: 14px; }
}



