:root {
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #a5b4fc;
  --clear-btn: #f43f5e;
  --clear-btn-hover: #e11d48;
  --close-red: #ef4444; 
  --text: #0f172a;             
  --muted: #64748b;
  --bg-page: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --radius: 16px;
  --nav-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body { 
  background: var(--bg-page); 
  color: var(--text); 
  padding-top: var(--nav-height); 
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.navbar {
  height: var(--nav-height);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
}
.nav-left { display: flex; align-items: center; gap: 10px; }
.logo-svg { height: 75px; width: auto; display: block; transform: translateY(6px); }

.round-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2ff;
  color: #6366f1;
  transition: all 0.2s ease;
  position: fixed; 
  top: calc(var(--nav-height) + 15px); 
  left: 20px;
  z-index: 1500; 
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.round-back-btn:hover {
  background: #6366f1;
  color: #ffffff;
}
.round-back-btn .material-symbols-outlined {
  font-size: 22px;
  font-weight: bold;
}

.menu-btn { margin-left: auto; cursor: pointer; z-index: 5001; display: flex; align-items: center; }
.menu-btn .material-symbols-outlined { font-size: 32px; color: var(--accent); transition: color 0.2s; }
.menu-btn.close-mode .material-symbols-outlined { color: var(--close-red); }

.side-menu {
  position: fixed; top: 65px; right: 15px; 
  min-width: 180px; max-width: 240px; width: auto;
  background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  border-radius: 8px; padding: 8px; opacity: 0;
  transform: translateY(-10px); pointer-events: none; transition: 0.25s; z-index: 2001;
  border: 1px solid #f1f5f9;
}
.side-menu.active { opacity: 1; transform: translateY(0); pointer-events: auto; }

.menu-link { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  padding: 8px 10px; 
  text-decoration: none; 
  color: var(--text); 
  font-weight: 600; 
  font-size: 14px; 
  border-radius: 6px; 
  transition: 0.2s; 
  cursor: pointer; 
  word-break: break-word; 
}
.menu-link:hover { background: #eef2ff; color: var(--accent); }
.menu-link .material-symbols-outlined { font-size: 20px; color: var(--accent); flex-shrink: 0; }

.lang-box { position: relative; }
.lang-menu { 
  display: none; 
  position: absolute; 
  top: 0; 
  right: 102%; 
  width: 160px; 
  max-height: 350px; 
  overflow-y: auto;
  background: #fff; 
  border-radius: 8px; 
  box-shadow: 0 5px 20px rgba(0,0,0,0.1); 
  border: 1px solid var(--border); 
  z-index: 2002; 
}
.lang-menu.active { display: block !important; }

.lang-item { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  padding: 8px 12px; 
  cursor: pointer; 
  font-size: 13px; 
  color: var(--text); 
  transition: 0.2s; 
  text-decoration: none; 
}
.lang-item:hover, .lang-item.selected { background: #eef2ff; color: var(--accent); }

.lang-item.selected {
  border-bottom: none !important;
  text-decoration: none !important;
}

.check-icon { font-size: 18px !important; color: var(--accent); visibility: hidden; flex-shrink: 0; }
.lang-item.selected .check-icon { visibility: visible; }

.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); opacity: 0; visibility: hidden; transition: 0.3s; z-index: 1999; }
.overlay.active { opacity: 1; visibility: visible; }

.container { 
  max-width: 800px; 
  margin: 40px auto; 
  padding: 0 20px; 
  flex: 1; 
  width: 100%;
  position: relative;
}

.stream-type-box { text-align: center; padding: 40px 0; }
.stream-type-box h2 { color: var(--accent); font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 800; margin-bottom: 20px; }

.stream-options { 
  display: flex !important; 
  flex-direction: row !important; 
  gap: 20px; 
  justify-content: center; 
  margin-top: 20px; 
  flex-wrap: wrap;
}
.stream-card { 
  background: var(--white); 
  border: 2px solid var(--border); 
  padding: 30px; 
  border-radius: var(--radius); 
  cursor: pointer; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 10px; 
  width: 160px; 
  transition: 0.3s; 
  font-weight: 700; 
  text-decoration: none;
  color: inherit;
}
.stream-card span:first-child { font-size: 40px; color: var(--accent); }
.stream-card:hover { border-color: var(--accent); transform: translateY(-5px); }

.filter-section { display: none; width: 100%; padding-top: 20px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; width: 100%; }
.panel { background: var(--white); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.02); min-width: 0; }
.panel-header { padding: 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 700; font-size: 14px; text-transform: uppercase; color: var(--text); user-select: none; gap: 8px; }
.panel-header span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-wrapper { display: none; border-top: 1px solid var(--border); background: #fafafa; width: 100%; }
.list-flex { display: flex; align-items: stretch; width: 100%; overflow: hidden; }

.list {
  max-height: 220px; overflow-y: auto; padding: 8px; flex: 1; min-width: 0; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
.list::-webkit-scrollbar { display: none; }

.scroll-btns { display: none; flex-direction: column; flex-shrink: 0; align-items: center; border-left: 1px solid var(--border); width: 38px; background: #fff; padding: 4px 0; gap: 4px; }
.scroll-btns.is-visible { display: flex; }
.s-btn { width: 100%; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--accent); transition: 0.2s; flex-shrink: 0; }
.s-btn:hover { background: #eef2ff; }
.s-btn .material-symbols-outlined { font-size: 20px; font-weight: bold; }
.scroll-track { flex: 1; width: 6px; background: #e2e8f0; border-radius: 10px; position: relative; overflow: hidden; }
.scroll-thumb { width: 100%; height: 40px; background: var(--accent-light); border-radius: 10px; position: absolute; top: 0; left: 0; }

.item { display: flex; align-items: center; padding: 9px; gap: 10px; cursor: pointer; border-radius: 8px; font-size: 14px; transition: 0.2s; min-width: 0; }
.item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item:hover { background: #eef2ff; }
.all-item { border-bottom: 1px dashed var(--border); margin-bottom: 5px; }
.checkbox { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 12px; background: #fff; flex-shrink: 0; }
.item.selected .checkbox { border-color: var(--accent); background: var(--accent); color: #fff; }

.search-area { margin-top: 20px; width: 100%; }
.search-input-wrapper { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.search-input-wrapper input { flex: 1; min-width: 150px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; outline: none; font-size: 15px; }
.btn-main { background: var(--accent); color: white; border: none; padding: 14px 20px; border-radius: 12px; cursor: pointer; font-weight: 700; transition: 0.2s; white-space: nowrap; }
.btn-clear { background: var(--clear-btn); color: white; border: none; padding: 14px 20px; border-radius: 12px; cursor: pointer; font-weight: 700; transition: 0.2s; white-space: nowrap; }

.channels-section { display: none; width: 100%; padding-top: 20px; }

.channel-card { 
  background: #fff; 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 15px; 
  margin-bottom: 12px; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  transition: all 0.3s ease;
  cursor: pointer;
  gap: 15px;
  direction: ltr !important;
}
.channel-card:hover { 
  background: #fdfdff;
  border-color: var(--accent-light);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.08);
}
.ch-info { flex: 1; min-width: 0; }
.ch-info h4 { font-size: 16px; margin-bottom: 4px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ch-meta span { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; }
.ch-meta span:not(:last-child)::after { content: "•"; margin-left: 6px; color: #cbd5e1; }

.tag-pricing { font-weight: 700 !important; }
.tag-FREE { color: #10b981 !important; }
.tag-PAID { color: #ef4444 !important; }
.tag-FREE-PAID { color: #a855f7 !important; }

.btn-go { text-decoration: none; background: #eef2ff; color: var(--accent); padding: 8px 20px; border-radius: 8px; font-weight: 700; font-size: 13px; transition: 0.3s; white-space: nowrap; }
.channel-card:hover .btn-go { background: var(--accent); color: #fff; }
.no-results { padding: 30px; text-align: center; color: var(--muted); font-weight: 600; }

.footer { 
  margin-top: 60px; 
  padding: 40px 20px; 
  background: #fff; 
  border-top: 1px solid #e2e8f0; 
}
.footer .f-flex-container {
  display: flex;
  justify-content: space-between; 
  align-items: flex-start;
  max-width: 1000px; 
  margin: 0 auto;
  width: 100%;
}
.footer-links { display: flex; gap: 0 40px; }
.footer-links .f-col { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { 
  text-decoration: none; 
  color: var(--text);      
  font-weight: 600; 
  font-size: 14px;         
  white-space: nowrap;     
  display: inline-block;
  width: fit-content;      
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-text { font-size: 13px; color: #94a3b8; text-align: right; line-height: 1.5; }

@media (max-width: 600px) {
  .filter-grid { grid-template-columns: 1fr; }
  .search-input-wrapper { flex-direction: column; align-items: stretch; }
  .search-input-wrapper input { width: 100%; }
  .btn-main, .btn-clear { padding: 14px 12px; font-size: 14px; text-align: center; width: 100%; }
  .round-back-btn { left: 10px; top: calc(var(--nav-height) + 10px); width: 36px; height: 36px; }
}

@media (max-width: 768px) {
  .footer { padding-bottom: 50px; }
  .footer .f-flex-container { flex-direction: column; align-items: flex-start; gap: 24px; }
  .footer-links { gap: 0 50px; width: 100%; }
  .footer-text { text-align: left; width: 100%; }
}

@media (min-width: 900px) {
  .round-back-btn { left: calc((100vw - 800px) / 2 - 60px); }
}

html[dir="rtl"]:not(.translated-ltr) body {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"]:not(.translated-ltr) .round-back-btn .material-symbols-outlined {
  transform: none; 
}

html[dir="rtl"]:not(.translated-ltr) .navbar {
  direction: ltr !important;
  display: block !important; 
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

html[dir="rtl"]:not(.translated-ltr) .nav-left {
  position: absolute !important;
  left: 15px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  direction: ltr !important;
  pointer-events: auto !important;
  z-index: 5002 !important;
}

html[dir="rtl"]:not(.translated-ltr) .menu-btn {
  position: absolute !important;
  right: 15px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  direction: ltr !important;
  pointer-events: auto !important;
  z-index: 5005 !important;
}

html[dir="rtl"]:not(.translated-ltr) .logo-svg text {
  direction: ltr !important;
  unicode-bidi: isolate;
}

html[dir="rtl"]:not(.translated-ltr) .side-menu {
  left: auto !important;
  right: 15px !important;  
}

html[dir="rtl"]:not(.translated-ltr) .lang-menu {
  left: auto !important;
  right: 102% !important; 
}

html[dir="rtl"]:not(.translated-ltr) .lang-item {
  flex-direction: row-reverse;
  justify-content: space-between;
}

html[dir="rtl"]:not(.translated-ltr) .round-back-btn {
  left: 20px !important;
  right: auto !important;
}

html[dir="rtl"]:not(.translated-ltr) .item {
  flex-direction: row;
  justify-content: flex-start;
}

@media (max-width: 900px) {
  html[dir="rtl"]:not(.translated-ltr) .round-back-btn {
    left: 10px !important;
    right: auto !important;
  }
}

html[dir="rtl"]:not(.translated-ltr) .footer .f-flex-container {
  flex-direction: row-reverse;
}

html[dir="rtl"]:not(.translated-ltr) .footer-links {
  flex-direction: row-reverse;
}

html[dir="rtl"]:not(.translated-ltr) .footer-links .f-col {
  align-items: flex-end;
}

html[dir="rtl"]:not(.translated-ltr) .footer-text {
  text-align: left;
  direction: rtl;
}

@media (max-width: 768px) {
  html[dir="rtl"]:not(.translated-ltr) .footer .f-flex-container {
    flex-direction: column;
    align-items: flex-end;
  }
  html[dir="rtl"]:not(.translated-ltr) .footer-links {
    justify-content: flex-end;
  }
  html[dir="rtl"]:not(.translated-ltr) .footer-text {
    text-align: right;
  }
}

html.translated-ltr, 
html.translated-ltr body {
  direction: ltr !important;
  text-align: left !important;
}

html.translated-rtl, 
html.translated-rtl body {
  direction: rtl !important;
  text-align: right !important;
}

.material-symbols-outlined, 
.material-icons {
  translate: no !important;
}
