:root{
  --bg0:#0a0e1a;
  --bg1:#0d111d;
  --panel:#14182a;
  --panel2:#181c2e;
  --card:#1a1f35;
  --card2:#161b2f;
  --stroke:rgba(255,255,255,.08);
  --stroke2:rgba(255,255,255,.05);
  --text:#e8edf7;
  --muted:rgba(232,237,247,.65);
  --muted2:rgba(232,237,247,.45);
  --accent:#46a0ff;
  --accent2:#357ae8;
  --glow:rgba(70,160,255,.18);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(120% 60% at 50% 10%, rgba(138,79,255,.12), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 100%;
  background-attachment: fixed;
  overflow:hidden;
  min-width: 360px;
}

body.no-scroll{
  overflow:hidden !important;
  position:fixed;
  width:100%;
}

a{color:inherit;text-decoration:none}

/* Layout */
.app{
  height:100vh;
  display:flex;
  flex-direction:column;
}

.shell{
  flex:1;
  display:flex;
  overflow:hidden;
}

/* Sidebar */
.sidebar{
  min-width:300px;
  padding:18px 12px;
  background: linear-gradient(360deg, #101a30, #0c1223);
  border-right:1px solid var(--stroke2);
  transition: transform 0.3s ease;
}

.sidebar .brand{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:24px;
  padding-bottom:18px;
  border-bottom:1px solid rgba(255,255,255,.06);
}

.sidebar-close{
  display:none;
  position:absolute;
  right:10px;
  top:10px;
  width:32px;
  height:32px;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.1);
  background:rgba(255,255,255,.05);
  color:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  align-items:center;
  justify-content:center;
}

.brand .word{
  font-weight:800;
  letter-spacing:.6px;
  font-size:22px;
}

.brand .tag{
  font-weight:800;
  font-size:14px;
  padding:4px 8px;
  border-radius:4px;
  background: rgba(70,160,255,.15);
  border:1px solid rgba(70,160,255,.25);
  color:#a9d0ff;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:8px;
  overflow-y:auto;
  overflow-x:hidden;
  max-height:calc(100vh - 110px);
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.15) transparent;
}

.nav::-webkit-scrollbar{
  width:6px;
}

.nav::-webkit-scrollbar-track{
  background:transparent;
}

.nav::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.15);
  border-radius:3px;
}

.nav::-webkit-scrollbar-thumb:hover{
  background:rgba(255,255,255,.25);
}

.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 14px;
  border-radius:4px;
  color:rgba(234,240,255,.7);
  border:1px solid transparent;
  font-size:15px;
  font-weight:500;
  transition: all 0.2s ease;
  position:relative;
}

.nav-icon{
  width:20px;
  height:20px;
  flex-shrink:0;
  opacity:.8;
  display:flex;
  align-items:center;
  justify-content:center;
}

img.nav-icon{
  object-fit:contain;
  border-radius:4px;
}

i.nav-icon{
  font-size:18px;
}

.nav-arrow{
  width:16px;
  height:16px;
  margin-left:auto;
  opacity:.4;
  display:flex;
  align-items:center;
  justify-content:center;
}

i.nav-arrow{
  font-size:12px;
}

.nav-item:hover{
  background: rgba(255,255,255,.06);
  color:var(--text);
}

.nav-item:hover .nav-icon,
.nav-item:hover .nav-arrow{
  opacity:1;
}

.nav-item.active{
  background: rgba(70,160,255,.15);
  color:#fff;
  font-weight:600;
}

.nav-item.active .nav-icon{
  opacity:1;
  color:#46a0ff;
}

.nav-divider{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:8px 0;
}

/* Content */
.main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar{
  min-height:72px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 18px;
  border-bottom:1px solid rgba(255,255,255,.05);
  background: linear-gradient(270deg, #101a30, #0c1223);
  /* backdrop-filter: blur(16px); */
  position:sticky;
  top:0;
  z-index:20;
}

.menu-toggle{
  display:none;
}

.topbar-brand{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}

.brand-word{
  font-size:20px;
  font-weight:800;
  letter-spacing:.5px;
  color:#fff;
}

.brand-tag{
  padding:4px 10px;
  border-radius:6px;
  background:#357ae8;
  color:#fff;
  font-size:13px;
  font-weight:800;
}

.search-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  background:transparent;
  border:none;
  color:rgba(255,255,255,.9);
  cursor:pointer;
  transition:all 0.2s;
  border-radius:4px;
  margin-left:auto;
}

.search-toggle:hover{
  background: rgba(255, 255, 255, .06);
}

.search-toggle:active{
  background: rgba(70, 160, 255, .15);
}

.search-toggle i,
.search-toggle svg{
  width:24px;
  height: 18px;
  font-size:18px;
}

.topbar-search{
  flex:1;
  max-width:600px;
  display:flex;
  align-items:center;
  gap:12px;
  padding: 10px 16px;
  margin-left:auto;
  background:rgba(255,255,255,.04);
  border-radius:4px;
  transition: all 0.2s;
}

.topbar-search:focus-within{
  background:rgba(255,255,255,.06);
  border-color:rgba(70,160,255,.3);
}

.topbar-search i,
.topbar-search svg{
  width:20px;
  height:20px;
  opacity:.5;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}

.topbar-search input{
  flex:1;
  background:transparent;
  border:none;
  outline:none;
  color:#fff;
  font-size:15px;
}

.topbar-search input::placeholder{
  color:rgba(255,255,255,.4);
}

/* Search Overlay - only for mobile */
.search-overlay{
  position:fixed;
  top:0;
  left:0;
  right:0;
  background: linear-gradient(270deg, #101a30, #0c1223);
  border-bottom:1px solid rgba(255,255,255,.05);
  z-index:100;
  display:none;
  opacity:0;
  transition:opacity 0.2s;
}

.search-overlay.active{
  display:block;
  opacity:1;
}

.search-overlay-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 18px;
  min-height:71px;
}

.search-overlay-input{
  flex:1;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 16px;
  background:rgba(255,255,255,.04);
  border-radius:4px;
}

.search-overlay-input i,
.search-overlay-input svg{
  width:20px;
  height:20px;
  opacity:.5;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}

.search-overlay-input input{
  flex:1;
  background:transparent;
  border:none;
  outline:none;
  color:#fff;
  font-size:16px;
}

.search-overlay-input input::placeholder{
  color:rgba(255,255,255,.4);
}

.search-cancel{
  background:transparent;
  border:none;
  color:rgba(255,255,255,.9);
  font-size:16px;
  cursor:pointer;
  padding:8px 12px;
  white-space:nowrap;
}

.search-cancel:active{
  opacity:0.7;
}


.actions{
  display:flex;align-items:center;gap:10px;
}

.icon-btn{
  width:40px;height:40px;
  display:grid;place-items:center;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(8,12,22,.45);
  cursor:pointer;
}
.icon-btn:hover{border-color:rgba(255,255,255,.14); background: rgba(8,12,22,.65)}
.icon-btn svg{width:18px;height:18px;opacity:.75}

.avatar{
  width:40px;height:40px;border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: radial-gradient(circle at 30% 30%, rgba(70,160,255,.25), rgba(255,255,255,.06));
}

/* Scroll area */
.page{
  flex:1;
  overflow:auto;
  padding:18px 18px 26px;
}

.page::-webkit-scrollbar{width:10px}
.page::-webkit-scrollbar-thumb{background:rgba(255,255,255,.08); border-radius:10px}
.page::-webkit-scrollbar-track{background:transparent}

.h1{
  font-size:22px;
  font-weight:800;
  margin:6px 0 14px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap:18px;
}

/* @media (max-width: 1600px){
  .grid{grid-template-columns: repeat(4, 1fr)}
} */

@media (max-width: 1200px){
  .grid{ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

.card{
  aspect-ratio: 2 / 1;
  min-height:140px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(26,31,53,.9);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  transition: all .2s ease;
  position:relative;
  overflow:hidden;
}

.card:hover{
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(70,160,255,.2);
  box-shadow: 0 8px 30px rgba(0,0,0,.4), 0 0 0 1px rgba(70,160,255,.15);
  background: rgba(30,36,58,.95);
}

.card img{
  max-height:100%;
  max-width:100%;
  width:auto;
  height:auto;
  z-index:1;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.35));
  object-fit:contain;
}

.footer-text{
  margin-top:18px;
  color:var(--muted);
  line-height:1.45;
  font-size:13px;
  max-width:980px;
}

/* Player page */
.player-body{
  height:100%;
  overflow:auto;
  padding:22px;
}
.player-wrap{
  max-width:1200px;
  margin:0 auto;
}
.backlink{
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  margin-bottom:14px;
}
.backlink:hover{color:var(--text)}
.player-card{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(10,16,32,.55);
  box-shadow: 0 18px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  overflow:hidden;
}

@media (max-width: 768px){
  .grid{grid-template-columns: repeat(2, 1fr)}
}

@media (max-width: 480px){
  .grid{grid-template-columns: repeat(1, 1fr)}
}

/* Mobile menu toggle */

.mobile-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.7);
  z-index:998;
  backdrop-filter:blur(4px);
  opacity:0;
  pointer-events:none;
  transition: opacity 0.3s ease;
  visibility:hidden;
}

@media (min-width: 981px){
  .mobile-overlay{
    display:none !important;
  }
}

/* Pagination */
.pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  margin:32px 0;
  flex-wrap:wrap;
}

.pagination-btn{
  padding:10px 18px;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(10,16,32,.55);
  color:rgba(234,240,255,.75);
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:all 0.2s;
}

.pagination-btn:hover{
  background:rgba(70,160,255,.15);
  border-color:rgba(70,160,255,.25);
  color:#fff;
}

.pagination-pages{
  display:flex;
  gap:6px;
  align-items:center;
}

.pagination-page{
  min-width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(10,16,32,.55);
  color:rgba(234,240,255,.65);
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:all 0.2s;
}

.pagination-page:hover{
  background:rgba(70,160,255,.12);
  border-color:rgba(70,160,255,.2);
  color:#fff;
}

.pagination-page.active{
  background:linear-gradient(180deg, rgba(70,160,255,.25), rgba(70,160,255,.15));
  border-color:rgba(70,160,255,.35);
  color:#fff;
  font-weight:700;
}

.pagination-dots{
  color:rgba(234,240,255,.35);
  padding:0 6px;
  font-weight:700;
}

/* Channel page */
.player-wrapper{
  width:100%;
  padding-top:40%;
  position:relative;
  background-color:#000;
}
.player-iframe{
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:100%;
  border:0;
}
.channel-info{
  padding:18px 18px 26px;
}
.channel-categories{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}
.category-tag{
  padding:8px 12px;
  border-radius:4px;
  background:rgba(8,12,22,.55);
  border:1px solid rgba(255,255,255,.08);
  color:rgba(234,240,255,.8);
  font-size:13px;
  font-weight:500;
  text-decoration:none;
  transition:all 0.2s;
}
.category-tag:hover{
  background:rgba(70,160,255,.15);
  border-color:rgba(70,160,255,.3);
  color:#fff;
}

/* Mobile */
@media (max-width: 980px){
  body{overflow:auto}
  .app{padding:0;height:auto}
  .shell{border-radius:0; min-height:100vh; position:relative}

  .sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    z-index:999;
    transform:translateX(-100%);
    width:280px;
  }

  .sidebar.active{
    transform:translateX(0);
  }

  .mobile-overlay{
    display:block;
    visibility:visible;
  }

  .mobile-overlay.active{
    opacity:1;
    pointer-events:auto;
    visibility:visible;
  }

  .sidebar-close{
    display:none;
  }

  .menu-toggle{
    display:flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    background:transparent;
    border:none;
    color:rgba(255,255,255,.9);
    cursor:pointer;
    transition:all 0.2s;
    border-radius:4px;
  }

  .menu-toggle:active{
    background: rgba(70, 160, 255, .15);
  }

  .menu-toggle:hover{
    background: rgba(255, 255, 255, .06);
  }

  .menu-toggle i,
  .menu-toggle svg{
    width: 24px;
    height: 22px;
    font-size: 24px;
  }

  .topbar-search{
    display:none;
  }

  .search-toggle{
    display:flex;
  }

  .grid{gap:12px}
  .card{min-height:100px}
  .card{padding:12px}

  .player-wrapper{
    padding-top:75%;
  }
}

/* Message Info */
.message-info {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 20px;
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
    border: 1px solid var(--stroke);
    position: relative;
    padding: 18px 20px;
    border-radius: 8px;
}
.message-info__title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.message-info__content {
  font-size: 15px;
}
.message-info a {
  color: var(--accent);
  text-decoration: underline;
}
.message-info a:hover {
  color: var(--accent2);
}
