/* Phong cách Spotify: nền #121212, xanh lá #1DB954 */
:root{
  --bg:#121212; --bg2:#181818; --bg3:#242424; --hover:#2a2a2a;
  --line:rgba(255,255,255,.08);
  --text:#ffffff; --muted:#b3b3b3;
  --green:#1DB954; --green-hi:#1ED760;
  --radius:10px;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg); color:var(--text);
  font-family:"Be Vietnam Pro",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  min-height:100vh; padding-bottom:76px;
  -webkit-font-smoothing:antialiased;
}
.hidden{display:none !important;}
button{font-family:inherit;}

/* ===== Header (gọn, không sticky) ===== */
.app-header{
  background:linear-gradient(180deg,#1e1e1e 0%,rgba(18,18,18,.4) 100%);
  padding:14px 16px 6px;
}
.brand{font-size:20px; font-weight:800; letter-spacing:-.5px;}
.brand .dot{color:var(--green);}
.stats{font-size:11px; color:var(--muted); margin-top:3px; font-weight:500;}

/* ===== Toolbar (sticky duy nhất) ===== */
.toolbar{position:sticky; top:0; z-index:19; background:rgba(18,18,18,.96); backdrop-filter:blur(12px); padding:10px 16px 10px;}
.search-wrap{position:relative;}
.search-icon{position:absolute; left:14px; top:50%; transform:translateY(-50%); opacity:.7; font-size:15px;}
#search{
  width:100%; padding:11px 14px 11px 42px; border-radius:999px;
  border:none; background:var(--bg3); color:var(--text); font-size:14px; font-weight:500; outline:none;
}
#search::placeholder{color:#8a8a8a;}
#search:focus{background:#2e2e2e;}
.tabrow{display:flex; gap:8px; margin-top:10px; overflow-x:auto; scrollbar-width:none; align-items:center;}
.tabrow::-webkit-scrollbar{display:none;}
.tabs{display:flex; gap:8px; padding-bottom:2px; scrollbar-width:none; flex:0 0 auto;}
.tabs::-webkit-scrollbar{display:none;}
.tab{
  flex:0 0 auto; padding:8px 16px; border-radius:999px; border:none;
  background:var(--bg3); color:var(--text); font-size:13px; font-weight:600; cursor:pointer;
  transition:background .15s;
}
.tab.active{background:var(--green); color:#000;}
.filters{display:flex; gap:8px; flex:0 0 auto;}
.chip{
  padding:7px 14px; border-radius:999px; border:none;
  background:var(--bg3); color:var(--text); font-size:12px; font-weight:600; cursor:pointer;
}
.chip.active{background:var(--text); color:#000;}

/* ===== Track list (kiểu Spotify) ===== */
.episode-list{padding:8px 8px 24px; display:flex; flex-direction:column; gap:2px; max-width:760px; margin:0 auto;}
.ep{
  display:flex; gap:12px; align-items:center;
  padding:10px; border-radius:8px; cursor:pointer;
  transition:background .12s ease; min-height:80px;
}
.ep:hover{background:var(--hover);}
.ep:active{background:#333;}
.ep.played .ep-title{color:var(--muted);}
.ep-thumb{position:relative; flex:0 0 60px; width:60px; height:60px; border-radius:6px; overflow:hidden; background:#000; box-shadow:0 4px 12px rgba(0,0,0,.4);}
.ep-thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.ep-badge{
  position:absolute; left:4px; bottom:4px; background:rgba(0,0,0,.82); color:#fff;
  font-size:9px; font-weight:800; letter-spacing:.4px; padding:2px 5px; border-radius:4px;
}
.ep-badge.shorts{background:var(--green); color:#000;}
.ep-info{flex:1; min-width:0;}
.ep-title{font-size:15px; font-weight:600; line-height:1.35; letter-spacing:-.1px; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
.ep.now-playing .ep-title{color:var(--green);}
.ep-meta{font-size:12px; color:var(--muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.ep-channel{font-weight:600;}
.ep-right{flex:0 0 auto; display:flex; align-items:center; gap:10px;}
.ep-dur{font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums;}
.ep-check{font-size:15px;}
/* Equalizer cho tập đang phát */
.eq{display:none; align-items:flex-end; gap:2.5px; height:16px;}
.ep.now-playing .eq{display:flex;}
.ep.now-playing .ep-dur{display:none;}
.eq span{width:3px; background:var(--green); border-radius:2px; animation:eq .9s ease-in-out infinite;}
.eq span:nth-child(1){height:60%; animation-delay:0s;}
.eq span:nth-child(2){height:100%; animation-delay:.25s;}
.eq span:nth-child(3){height:40%; animation-delay:.5s;}
@keyframes eq{0%,100%{transform:scaleY(.4);}50%{transform:scaleY(1);}}
.empty{text-align:center; color:var(--muted); padding:60px 20px; font-size:14px; font-weight:500;}

/* ===== Mini player (kiểu Spotify mobile) ===== */
.mini-player{
  position:fixed; left:0; right:0; bottom:0; z-index:30;
  display:flex; align-items:center; gap:10px;
  background:linear-gradient(180deg,#2b2b2b,#1c1c1c);
  border-top:1px solid var(--line);
  padding:8px 12px calc(8px + env(safe-area-inset-bottom));
  cursor:pointer; max-width:760px; margin:0 auto;
}
.mini-progress{position:absolute; top:0; left:0; height:2px; background:var(--green); width:0%; transition:width .5s linear;}
.mini-player img{width:48px; height:48px; object-fit:cover; border-radius:6px; background:#000;}
.mini-info{flex:1; min-width:0;}
.mini-title{font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.mini-meta{font-size:11px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.mini-btn{
  background:var(--text); color:#000; border:none; border-radius:50%;
  width:38px; height:38px; font-size:14px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.mini-close{background:none; border:none; color:var(--muted); font-size:16px; cursor:pointer; padding:8px;}

/* ===== Now Playing (full player) ===== */
.sheet{
  position:fixed; inset:0; z-index:40;
  background:linear-gradient(180deg,#3a3a3a 0%,#1a1a1a 45%,#121212 100%);
  display:flex; flex-direction:column; overflow-y:auto;
  animation:slideUp .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideUp{from{transform:translateY(60px); opacity:.3;} to{transform:none; opacity:1;}}
.sheet-top{display:flex; align-items:center; justify-content:space-between; padding:14px 16px 0;}
.sheet-top .np-label{font-size:11px; font-weight:700; letter-spacing:2px; color:var(--muted); text-transform:uppercase;}
.sheet-collapse{background:none; border:none; color:var(--muted); font-size:24px; cursor:pointer; padding:4px 8px;}
.player-video{width:min(78vw,330px); margin:18px auto 0; aspect-ratio:1/1; background:#000; border-radius:10px; overflow:hidden; box-shadow:0 16px 48px rgba(0,0,0,.55);}
.player-video iframe{width:100%; height:100%; border:0;}
.player-body{padding:20px 24px 48px; max-width:520px; margin:0 auto; width:100%;}
.pl-channel{font-size:12px; font-weight:700; color:var(--green); text-transform:uppercase; letter-spacing:1px;}
.pl-title{font-size:19px; font-weight:700; margin:8px 0 4px; line-height:1.35; letter-spacing:-.2px;}
.pl-date{font-size:12px; color:var(--muted);}
.progress-wrap{margin-top:18px;}
#progress{
  -webkit-appearance:none; appearance:none; width:100%; height:4px; border-radius:2px; cursor:pointer;
  background:linear-gradient(90deg, var(--green) var(--p,0%), #4d4d4d var(--p,0%));
  outline:none;
}
#progress::-webkit-slider-thumb{
  -webkit-appearance:none; width:13px; height:13px; border-radius:50%;
  background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.5); cursor:pointer;
}
#progress::-moz-range-thumb{width:13px; height:13px; border:none; border-radius:50%; background:#fff; cursor:pointer;}
.time-row{display:flex; justify-content:space-between; font-size:11px; color:var(--muted); margin-top:6px; font-variant-numeric:tabular-nums;}
.controls{display:flex; align-items:center; justify-content:center; gap:26px; margin-top:18px;}
.ctl-btn{background:none; border:none; color:var(--text); font-size:24px; cursor:pointer; padding:8px; display:flex; align-items:center; justify-content:center;}
.ctl-btn.big{
  background:var(--green); color:#000; border-radius:50%;
  width:66px; height:66px; font-size:24px;
  box-shadow:0 8px 24px rgba(29,185,84,.35);
  transition:transform .1s;
}
.ctl-btn.big:active{transform:scale(.94); background:var(--green-hi);}
.ctl-btn.speed{font-size:13px; font-weight:800; color:var(--muted); border:1.5px solid #4d4d4d; border-radius:999px; padding:7px 13px;}
.ctl-btn.speed:hover{color:var(--text); border-color:var(--text);}
.ctl-btn .sub{font-size:10px; font-weight:800; margin-left:1px;}
.controls-2{display:flex; align-items:center; justify-content:center; gap:14px; margin-top:16px;}
.chip-btn{
  background:var(--bg3); border:none; color:var(--text);
  border-radius:999px; padding:9px 16px; font-size:12px; font-weight:700; cursor:pointer;
  display:flex; align-items:center; gap:6px;
}
.chip-btn.done{background:var(--green); color:#000;}
.yt-link{display:block; text-align:center; margin-top:22px; color:var(--muted); font-size:13px; font-weight:600; text-decoration:none;}
.yt-link:hover{color:var(--text);}

/* Sleep menu */
.sleep-menu{
  position:fixed; z-index:50; left:50%; bottom:110px; transform:translateX(-50%);
  background:#282828; border-radius:14px; min-width:220px;
  box-shadow:0 16px 48px rgba(0,0,0,.7); overflow:hidden;
  animation:pop .18s ease;
}
@keyframes pop{from{transform:translateX(-50%) scale(.95); opacity:0;} to{transform:translateX(-50%) scale(1); opacity:1;}}
.sleep-menu button{background:none; border:none; border-bottom:1px solid var(--line); color:var(--text); padding:14px; font-size:14px; font-weight:600; cursor:pointer; width:100%; text-align:left;}
.sleep-menu button:last-child{border-bottom:none;}
.sleep-menu button:hover{background:#333;}

@media (min-width:700px){
  .player-video{width:min(40vw,380px);}
  .ep{padding:10px 14px;}
}

/* ===== Channel cover (kiểu artist header Spotify) ===== */
.channel-cover{
  display:flex; align-items:center; gap:14px;
  margin:12px 16px 4px; padding:16px;
  background:linear-gradient(135deg,#2a2a2a,#1b1b1b);
  border-radius:12px; max-width:728px;
}
@media (min-width:760px){ .channel-cover{margin-left:auto; margin-right:auto;} }
.cc-avatar{
  flex:0 0 64px; width:64px; height:64px; border-radius:50%;
  background:linear-gradient(135deg,var(--green),#0d7a35);
  display:flex; align-items:center; justify-content:center;
  font-size:28px; font-weight:800; color:#000;
  box-shadow:0 8px 20px rgba(0,0,0,.45);
}
.cc-info{flex:1; min-width:0;}
.cc-name{font-size:17px; font-weight:800; letter-spacing:-.3px;}
.cc-sub{font-size:12px; color:var(--muted); margin-top:3px; font-weight:500;}
.cc-play{
  flex:0 0 auto; width:52px; height:52px; border-radius:50%; border:none;
  background:var(--green); color:#000; font-size:18px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 20px rgba(29,185,84,.35);
  transition:transform .1s;
}
.cc-play:active{transform:scale(.92);}

/* ===== Now Playing: nền mờ từ ảnh bìa ===== */
.sheet{position:fixed; inset:0; z-index:40; background:#121212; overflow:hidden;}
.np-bg{position:absolute; inset:-40px; z-index:0; pointer-events:none;}
.np-bg img{width:100%; height:100%; object-fit:cover; filter:blur(70px) brightness(.42) saturate(1.2); transform:scale(1.1);}
.sheet-top, .player-video, .player-body{position:relative; z-index:1;}
.sheet{
  display:flex; flex-direction:column; overflow-y:auto;
  animation:slideUp .28s cubic-bezier(.2,.9,.3,1);
}

/* ===== Tiếp theo (Up Next) ===== */
.upnext{margin-top:20px;}
.upnext-title{font-size:13px; font-weight:800; letter-spacing:.4px; margin-bottom:6px;}
.up-item{
  display:flex; gap:10px; align-items:center; padding:8px 6px; border-radius:8px; cursor:pointer;
}
.up-item:hover{background:rgba(255,255,255,.06);}
.up-item img{width:44px; height:44px; border-radius:5px; object-fit:cover; background:#000; flex:0 0 auto;}
.up-item .t{flex:1; min-width:0; font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.up-item .d{font-size:11px; color:var(--muted); flex:0 0 auto;}

/* ===== Skeleton loading ===== */
.skel{
  display:flex; gap:12px; align-items:center; padding:10px; min-height:80px;
}
.skel .s-thumb{flex:0 0 60px; width:60px; height:60px; border-radius:6px;}
.skel .s-lines{flex:1;}
.skel .s-line{height:12px; border-radius:6px; margin:7px 0;}
.skel .s-line.short{width:45%;}
.skel .s-thumb, .skel .s-line{
  background:linear-gradient(90deg,#1e1e1e 25%,#2b2b2b 50%,#1e1e1e 75%);
  background-size:200% 100%; animation:shimmer 1.3s infinite;
}
@keyframes shimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}

/* ===== Desktop kiểu Zing MP3/NCT (màn hình lớn) ===== */
.sidebar, .queuebar{display:none;}
#homeSections{display:none;}

@media (min-width:1024px){
  body{padding-bottom:92px;}
  .layout{
    display:grid; grid-template-columns:248px minmax(0,1fr) 320px;
    height:100vh; max-width:1720px; margin:0 auto;
  }
  /* Sidebar trái */
  .sidebar{
    display:flex; flex-direction:column; gap:4px;
    background:#0c0c0c; border-right:1px solid var(--line);
    padding:22px 14px; overflow-y:auto;
  }
  .sidebar .brand{font-size:21px; padding:0 10px 14px;}
  .nav{display:flex; flex-direction:column; gap:2px;}
  .nav-item{
    display:flex; align-items:center; gap:12px; width:100%;
    background:none; border:none; color:var(--muted);
    font-size:14px; font-weight:600; text-align:left;
    padding:11px 12px; border-radius:8px; cursor:pointer;
    transition:background .12s, color .12s;
  }
  .nav-item:hover{background:var(--hover); color:var(--text);}
  .nav-item.active{background:#2e2e2e; color:var(--text);}
  .side-title{
    font-size:11px; font-weight:800; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--muted); margin:20px 10px 8px;
  }
  .side-chan{
    display:flex; align-items:center; gap:10px; width:100%;
    background:none; border:none; color:var(--text);
    padding:8px 10px; border-radius:8px; cursor:pointer; text-align:left;
  }
  .side-chan:hover{background:var(--hover);}
  .side-chan.active{background:#2e2e2e;}
  .side-chan .av{
    flex:0 0 38px; width:38px; height:38px; border-radius:50%;
    background:linear-gradient(135deg,var(--green),#0d7a35);
    display:flex; align-items:center; justify-content:center;
    font-size:16px; font-weight:800; color:#000;
  }
  .side-chan .nm{flex:1; min-width:0; font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .side-chan .ct{font-size:11px; color:var(--muted);}

  /* Cột giữa */
  .maincol{overflow-y:auto; padding:0 28px 40px; scrollbar-width:thin;}
  .app-header{background:none; padding:22px 0 4px;}
  .app-header .brand{display:none;}
  .app-header .stats{font-size:12px; margin-top:0;}
  .toolbar{margin:0 -28px; padding:12px 28px;}
  .episode-list{max-width:980px;}

  /* Home sections */
  #homeSections{display:block; max-width:980px; margin:0 auto;}
  .sec-head{display:flex; align-items:center; justify-content:space-between; margin:26px 0 14px;}
  .sec-head h3{font-size:20px; font-weight:800; letter-spacing:-.3px; margin:0;}
  .link-btn{background:none; border:none; color:var(--green); font-size:12px; font-weight:700; cursor:pointer; padding:6px 10px; border-radius:999px;}
  .link-btn:hover{background:rgba(29,185,84,.12);}
  .card-row{display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:16px;}
  .chan-card{
    position:relative; background:linear-gradient(135deg,#2b2b2b,#191919);
    border-radius:12px; padding:20px; cursor:pointer; overflow:hidden;
    transition:background .15s, transform .15s;
  }
  .chan-card:hover{background:linear-gradient(135deg,#333,#1f1f1f);}
  .chan-card .av{
    width:64px; height:64px; border-radius:50%;
    background:linear-gradient(135deg,var(--green),#0d7a35);
    display:flex; align-items:center; justify-content:center;
    font-size:26px; font-weight:800; color:#000; margin-bottom:14px;
    box-shadow:0 8px 20px rgba(0,0,0,.4);
  }
  .chan-card .nm{font-size:15px; font-weight:700;}
  .chan-card .ct{font-size:12px; color:var(--muted); margin-top:4px;}
  .chan-card .play{
    position:absolute; right:16px; bottom:16px; width:48px; height:48px; border-radius:50%;
    background:var(--green); color:#000; border:none; font-size:17px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    opacity:0; transform:translateY(8px); transition:opacity .18s, transform .18s;
    box-shadow:0 8px 20px rgba(0,0,0,.45);
  }
  .chan-card:hover .play{opacity:1; transform:none;}
  .card-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:18px 16px;}
  .sg-card{background:var(--bg2); border-radius:10px; padding:12px; cursor:pointer; transition:background .15s;}
  .sg-card:hover{background:var(--hover);}
  .sg-card .th{position:relative; border-radius:8px; overflow:hidden; aspect-ratio:16/10; background:#000; margin-bottom:10px;}
  .sg-card .th img{width:100%; height:100%; object-fit:cover; display:block;}
  .sg-card .ti{font-size:13px; font-weight:600; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
  .sg-card .ch{font-size:11px; color:var(--muted); margin-top:4px;}

  /* Sidebar phải: hàng chờ */
  .queuebar{
    display:flex; flex-direction:column;
    background:#0c0c0c; border-left:1px solid var(--line);
    overflow:hidden;
  }
  .q-tabs{display:flex; gap:4px; padding:16px 14px 10px;}
  .q-tab{
    flex:1; padding:9px; border-radius:999px; border:none; cursor:pointer;
    background:transparent; color:var(--muted); font-size:13px; font-weight:700;
  }
  .q-tab.active{background:var(--bg3); color:var(--text);}
  #queueNext, #queueRecent{overflow-y:auto; padding:0 8px 20px; scrollbar-width:thin;}
  .q-item{
    display:flex; gap:10px; align-items:center; padding:8px; border-radius:8px; cursor:pointer;
  }
  .q-item:hover{background:var(--hover);}
  .q-item img{width:48px; height:48px; border-radius:6px; object-fit:cover; background:#000; flex:0 0 auto;}
  .q-item .t{flex:1; min-width:0;}
  .q-item .ti{font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .q-item .ch{font-size:11px; color:var(--muted); margin-top:2px;}
  .q-item .d{font-size:11px; color:var(--muted); flex:0 0 auto;}
  .q-empty{color:var(--muted); font-size:12px; text-align:center; padding:30px 10px;}

  /* Mini player full-width kiểu desktop */
  .mini-player{max-width:none;}
}
