/* X-Stream Elite - Unified Styles (from provided HTML templates) */

/* --- CORE VARIABLES --- */
:root {
  --primary: #ff9900;
  --bg-body: #000000;
  --bg-surface: #121212;
  --bg-hover: #1f1f1f;
  --text-main: #ffffff;
  --text-sec: #a0a0a0;
  --border: #222222;
  --shadow: 0 4px 20px rgba(0,0,0,0.6);
  --header-h: 64px;
  --sidebar-w: 260px;
  --radius: 8px;
  --font-main: 'Inter', sans-serif;
  --font-head: 'Oswald', sans-serif;
}

[data-theme="light"] {
  --bg-body: #f4f4f4;
  --bg-surface: #ffffff;
  --bg-hover: #ebebeb;
  --text-main: #1a1a1a;
  --text-sec: #666666;
  --border: #e0e0e0;
  --shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* --- GLOBAL RESET --- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }
html, body { height: 100%; }
body {
  margin: 0; padding: 0;
  background: var(--bg-body); color: var(--text-main);
  font-family: var(--font-main);
  padding-top: var(--header-h);
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
img { display: block; max-width: 100%; }

/* --- HEADER --- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.brand-area { display: flex; align-items: center; gap: 10px; }
.logo { font-family: var(--font-head); font-size: 24px; letter-spacing: -0.5px; text-transform: uppercase; }
.logo span { color: var(--primary); }

.search-container { flex: 1; max-width: 500px; margin: 0 20px; position: relative; }
.search-container form { position: relative; }
.search-input {
  width: 100%; background: var(--bg-body); border: 1px solid var(--border);
  color: var(--text-main); padding: 10px 40px 10px 15px; border-radius: 50px;
  font-size: 14px; transition: all 0.3s ease;
}
.search-input:focus { border-color: var(--primary); }
.search-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--text-sec); }

.action-area { display: flex; align-items: center; gap: 15px; }
.icon-btn { padding: 8px; border-radius: 50%; display: flex; align-items: center; }
.icon-btn:hover { background: var(--bg-hover); color: var(--primary); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.lang-select { background: var(--bg-hover); color: var(--text-main); border: none; padding: 6px 12px; border-radius: 6px; font-weight: 600; text-transform: uppercase; }
.menu-trigger { display: none; flex-direction: column; gap: 5px; width: 30px; }
.menu-trigger span { width: 100%; height: 2px; background: var(--text-main); transition: 0.3s; }
.menu-trigger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-trigger.active span:nth-child(2) { opacity: 0; }
.menu-trigger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- LAYOUT & SIDEBAR --- */
.layout { display: flex; min-height: calc(100vh - var(--header-h)); }
.sidebar {
  width: var(--sidebar-w); background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto; padding: 20px 0; flex-shrink: 0;
  transition: 0.3s;
}
.nav-link { display: flex; align-items: center; gap: 12px; padding: 14px 24px; color: var(--text-sec); font-weight: 500; font-size: 15px; border-right: 3px solid transparent; }
.nav-link:hover, .nav-link.active { background: var(--bg-hover); color: var(--primary); border-right-color: var(--primary); }
.nav-section { padding: 15px 24px 5px; font-size: 11px; text-transform: uppercase; color: var(--text-sec); opacity: 0.7; font-weight: 700; }

/* Overlay (mobile menu) */
.overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); z-index: 998;
  opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(3px);
}
.overlay.active { opacity: 1; visibility: visible; }

/* --- MAIN (HOME + SEARCH) --- */
.main { flex: 1; padding: 30px; }
.section-header { margin-bottom: 25px; display: flex; align-items: center; justify-content: space-between; }
.section-header h2 { margin: 0; font-family: var(--font-head); font-size: 24px; }

/* Video Grid */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.card { position: relative; cursor: pointer; transition: transform 0.2s; }
.card:hover { transform: translateY(-4px); }
.card-thumb { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #222; box-shadow: var(--shadow); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity 0.3s; }
.badge { position: absolute; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; z-index: 2; }
.badge-time { bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); color: #fff; }
.badge-hd { top: 8px; left: 8px; background: var(--primary); color: #000; text-transform: uppercase; }
.card-info { margin-top: 12px; display: flex; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-hover); flex-shrink: 0; }
.meta h3 { margin: 0 0 5px; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text-main); }
.meta p { margin: 0; font-size: 13px; color: var(--text-sec); display: flex; align-items: center; gap: 5px; }

/* --- CATEGORY --- */
.cat-hero {
  background: linear-gradient(90deg, rgba(255, 153, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; margin-bottom: 30px;
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px;
}
.cat-info h1 { font-family: var(--font-head); font-size: 36px; margin: 0 0 5px; line-height: 1; text-transform: uppercase; }
.cat-info p { color: var(--text-sec); margin: 0; font-size: 14px; }
.cat-info span { color: var(--primary); font-weight: 700; }
.filter-bar { display: flex; gap: 15px; align-items: center; }
.sort-select {
  background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border);
  padding: 10px 20px; border-radius: 50px; font-size: 14px; cursor: pointer;
  outline: none; transition: 0.2s; -webkit-appearance: none;
}
.sort-select:hover, .sort-select:focus { border-color: var(--primary); }

/* --- WATCH PAGE --- */
.main-watch {
  flex: 1; padding: 30px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
}
.player-wrapper {
  width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); position: relative; z-index: 10;
}
.player-wrapper iframe, .player-wrapper img, .player-wrapper video {
  width: 100%; height: 100%; object-fit: cover; border: 0;
}
.video-meta { margin-top: 20px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.video-title { font-family: var(--font-head); font-size: 24px; margin: 0 0 10px; line-height: 1.2; }
.video-stats-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.stats-text { color: var(--text-sec); font-size: 14px; }
.actions-row { display: flex; gap: 10px; }
.action-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-hover); padding: 8px 16px; border-radius: 50px;
  font-size: 13px; font-weight: 600; transition: 0.2s;
}
.action-pill:hover, .action-pill.active { background: var(--border); color: var(--primary); }
.action-pill svg { width: 18px; height: 18px; fill: currentColor; }

/* Comments */
.comments-section { margin-top: 30px; }
.comment-input-area { display: flex; gap: 15px; margin-bottom: 25px; align-items: flex-start; }
.comment-input {
  flex: 1; background: transparent; border: none; border-bottom: 1px solid var(--border);
  color: var(--text-main); padding: 10px 0; font-size: 14px; transition: border-color 0.3s;
}
.comment-input:focus { border-color: var(--primary); }
.btn-post {
  background: var(--bg-hover); color: var(--text-sec);
  padding: 8px 16px; border-radius: 4px; font-weight: 600; font-size: 12px;
  text-transform: uppercase; transition: 0.2s;
}
.btn-post:hover { background: var(--primary); color: #000; }

.comment-item { display: flex; gap: 12px; margin-bottom: 20px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.c-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-hover); flex-shrink: 0; }
.c-body h4 { font-size: 13px; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.c-body span { font-weight: 400; color: var(--text-sec); font-size: 11px; }
.c-body p { font-size: 14px; margin: 0; line-height: 1.4; color: var(--text-main); }

/* Related */
.related-col { display: flex; flex-direction: column; gap: 15px; }
.related-card { display: flex; gap: 10px; cursor: pointer; transition: 0.2s; }
.related-card:hover .r-thumb img { opacity: 0.8; }
.r-thumb {
  width: 160px; height: 90px; border-radius: var(--radius);
  overflow: hidden; background: #222; flex-shrink: 0; position: relative;
}
.r-thumb img { width: 100%; height: 100%; object-fit: cover; }
.r-time {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,0.8); color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 2px;
}
.r-info h3 {
  margin: 0 0 5px; font-size: 14px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.r-info p { margin: 0; font-size: 12px; color: var(--text-sec); }

/* --- STATIC PAGE --- */
.page-main { display: flex; justify-content: center; }
.page-wrapper { max-width: 800px; width: 100%; }
.page-title {
  font-family: var(--font-head); font-size: 36px; margin: 0 0 10px;
  color: var(--text-main); text-transform: uppercase; letter-spacing: -0.5px;
}
.page-meta {
  font-size: 13px; color: var(--text-sec); margin-bottom: 30px;
  border-bottom: 1px solid var(--border); padding-bottom: 20px;
}
.content-body { font-size: 16px; line-height: 1.7; color: var(--text-sec); }
.content-body h2 { color: var(--text-main); font-family: var(--font-head); font-size: 22px; margin: 40px 0 15px; }
.content-body h3 { color: var(--text-main); font-size: 18px; margin: 25px 0 10px; }
.content-body p { margin-bottom: 20px; }
.content-body ul { margin-bottom: 20px; padding-left: 20px; }
.content-body li { margin-bottom: 10px; list-style: disc; }
.content-body a { color: var(--primary); text-decoration: underline; }

.hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

/* Contact Form */
.contact-form {
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 30px; border-radius: var(--radius); margin-top: 40px;
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.form-control {
  width: 100%; background: var(--bg-body); border: 1px solid var(--border);
  color: var(--text-main); padding: 12px 15px; border-radius: 6px;
  font-family: inherit; font-size: 14px; transition: 0.3s;
}
.form-control:focus { border-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 120px; }

.btn-submit, .btn-loadmore {
  background: var(--primary); color: #000;
  padding: 12px 30px; border-radius: 6px; font-weight: 700;
  text-transform: uppercase; font-size: 14px; display: inline-block;
  transition: 0.2s;
}
.btn-submit:hover, .btn-loadmore:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255,153,0,0.3); }

.pager { margin: 40px auto; text-align: center; }
.form-msg { margin-top: 12px; font-size: 13px; color: var(--text-sec); }

/* Honeypot field */
.hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .search-container { display: none; }

  .sidebar {
    position: fixed; top: var(--header-h); right: -100%;
    height: calc(100vh - var(--header-h)); width: 80%; max-width: 300px;
    background: var(--bg-surface); border-left: 1px solid var(--border);
    z-index: 999; border-right: none;
  }
  .sidebar.active { right: 0; box-shadow: -10px 0 30px rgba(0,0,0,0.5); }
  .menu-trigger { display: flex; }

  .main { padding: 15px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); gap: 20px; }
  .card-thumb { border-radius: 0; margin: 0 -15px; width: calc(100% + 30px); }
  .card { margin-bottom: 10px; }
  .section-header h2 { font-size: 20px; }

  .cat-hero { padding: 20px; flex-direction: column; align-items: flex-start; gap: 15px; }
  .cat-info h1 { font-size: 28px; }

  .main-watch { display: block; padding: 0; }
  .player-wrapper { width: 100%; border-radius: 0; box-shadow: none; }
  .video-meta, .comments-section, .related-col { padding-left: 20px; padding-right: 20px; }
  .video-title { font-size: 20px; }
  .related-col { margin-top: 30px; padding-bottom: 40px; }
  .r-thumb { width: 140px; height: 80px; }

  .page-title { font-size: 28px; }
  .content-body { font-size: 15px; }
  .contact-form { padding: 20px; }
}


/* v2.0 - Watch enhancements */
.video-desc{
  margin-top: 14px;
  line-height: 1.6;
  opacity: .92;
}
.video-cats{
  margin-top: 10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.video-cats .cats-label{
  opacity:.8;
  margin-right: 4px;
}
.tag{
  display:inline-block;
  padding:4px 10px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:999px;
  font-size:12px;
  opacity:.95;
}
.mini-count{
  margin-left: 6px;
  opacity:.85;
}
.posting-as{
  margin: -10px 0 12px;
  opacity:.85;
  font-size: 13px;
}
.c-meta{
  opacity:.75;
  font-weight: 400;
  font-size: 12px;
}
