/* ================================== */
/*         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 5rem; } /* <-- Increased horizontal padding for desktop */
.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); }

/* ================================== */
/*    MATCH INFORMATION PAGE STYLES   */
/* ================================== */
.match-details-container { max-width: 900px; margin: 15px auto; padding: 1rem; }
#match-header { margin-bottom: 10px; min-height: 48px; }
#match-header h1 { font-size: clamp(1.5rem, 3vw, 2rem); text-align: center; }
#match-description { color: var(--text-primary); font-size: 1rem; line-height: 1.6; margin: 1rem 0 2rem 0; text-align: center; min-height: 54px; }
.countdown { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 1.2rem; margin-bottom: 20px; font-weight: bold; color: var(--accent-hover); text-align: center; }
.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; margin-bottom:1rem;}
.back-button-styled:hover { background-color: var(--bg-secondary); color: var(--text-primary); border-color: #dc2626; }
.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; border-bottom: 1px solid var(--border-color); 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: #dc2626; 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 { background-color: #1a1a1a; border-color: var(--accent-primary); transform: translateY(-2px); }
.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: #dc2626; 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;}
.viewers-count { color:#dc2626cc;}
.open-arrow { display: inline-flex; align-items: center; color: var(--text-secondary); opacity: 0.6; transition: all 0.2s ease; }
.stream-row:hover .open-arrow { opacity: 1; color: var(--accent-hover); }
.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 LOADER STYLES */
.skeleton { background-color: var(--bg-secondary); color: transparent; border-radius: 6px; user-select: none; position: relative; overflow: hidden; display: inline-block; }
.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, 0.6, 1); }
@keyframes shimmer { 100% { left: 150%; } }
h1 .skeleton { height: 36px; width: 70%; margin-bottom: 5px; }
p .skeleton { height: 18px; width: 90%; margin-bottom: 8px; }
p .skeleton.w-60 { width: 60%; }
.skeleton-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.skeleton-button { width: 120px; height: 38px; background-color: var(--bg-secondary); border-radius: 0.5rem; }
.skeleton-summary { width: 200px; height: 22px; background-color: var(--bg-secondary); border-radius: 4px; }
.stream-source.is-loading { border-color: transparent; box-shadow: none; 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; }

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) { /* Added new breakpoint for tablets */
  .fullpage { padding: 0 2rem; }
}

@media (max-width: 768px) {
  .site-logo { display: none; }
  .site-header { padding: 8px 12px; }
  .header-btn { padding: 6px 10px; font-size: 13px; }
  #match-header h1 { font-size: 1.3rem; }
  #match-description { font-size: 0.9rem; }
  .stream-row {align-items: flex-start; gap: 10px; }
  .fullpage { padding: 0 1rem; } /* Adjusted padding for smaller tablets */
}
@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; }

}

/* ================================== */
/*    NEW STYLES FOR LAYOUT & WIDGET  */
/* ================================== */
.content-wrapper {
  display: flex;
  align-items: flex-start;
  
  max-width: 1400px; /* Increased max-width for new padding */
  margin: 0 auto;
}

.match-details-container {
  flex-grow: 1;
}

/* ================================== */
/*    CUSTOM DISCORD WIDGET STYLES    */
/* ================================== */
.discord-sidebar {
  width: 350px;
  flex-shrink: 0;
  height: auto;
  position: sticky;
  top: 80px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

#discord-widget-container {
  color: var(--text-primary);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.discord-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.discord-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.discord-header h3 span {
  color: var(--accent-red);
}

.discord-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.discord-btn {
  background-color: #5865F2;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.discord-btn:hover {
  background-color: #4752c4;
}

.members-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  min-height: 300px;
}

.members-list li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 12px;
  position: relative;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #23a559; /* Discord's online green */
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.member-name {
  font-weight: 500;
}

/* New styles for the "and more..." link */
.more-members-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    
    
    font-size: 0.95rem;
}

.more-members-link a {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 700;
}

.more-members-link a:hover {
    text-decoration: underline;
}

/* Skeleton loader for Discord widget */
.member-skeleton { display: flex; align-items: center; margin-bottom: 12px; }
.avatar-skeleton { width: 32px; height: 32px; border-radius: 50%; margin-right: 12px; background-color: var(--border-color); }
.name-skeleton { width: 120px; height: 16px; border-radius: 4px; background-color: var(--border-color); }

/* ================================== */
/*  RESPONSIVE ADJUSTMENTS FOR WIDGET */
/* ================================== */
@media (max-width: 1300px) {
  .content-wrapper {
    flex-direction: column;
    align-items: center;
  }
  .discord-sidebar {
    position: static;
    width: 100%;
    max-width: 900px;
    margin-top: 1.5rem;
  }
}
