/* ============================================================
   KOSOVA TV V3300 — CLEAN PROFESSIONAL UI
   One UI layer for Desktop / Tablet / Mobile / PWA
   Playback V3237 untouched.
   ============================================================ */

:root{
  --v3300-bg:#05080d;
  --v3300-panel:#0a1017;
  --v3300-panel2:#101923;
  --v3300-line:rgba(255,255,255,.09);
  --v3300-line2:rgba(255,255,255,.14);
  --v3300-text:#f7f9fc;
  --v3300-muted:#91a0b2;
  --v3300-red:#ff2348;
  --v3300-red2:#d91538;
  --v3300-redsoft:rgba(255,35,72,.15);
}

/* ---------- GLOBAL ---------- */
html,body{background:#05080d!important}
body.player-open{overflow:hidden!important}

/* ---------- PLAYER OVERLAY ---------- */
.player-overlay{
  background:rgba(1,4,8,.88)!important;
  backdrop-filter:blur(15px)!important;
  -webkit-backdrop-filter:blur(15px)!important;
  padding:12px!important;
}

.player-shell{
  position:relative!important;
  width:min(1500px,100%)!important;
  height:100%!important;
  max-height:920px!important;
  margin:auto!important;
  overflow:hidden!important;
  border:1px solid var(--v3300-line2)!important;
  border-radius:22px!important;
  background:#060a10!important;
  box-shadow:0 32px 110px rgba(0,0,0,.58)!important;
}

.player-topbar{
  min-height:64px!important;
  flex-basis:64px!important;
  padding:0 14px!important;
  background:rgba(7,12,18,.98)!important;
  border-bottom:1px solid var(--v3300-line)!important;
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
}

.player-brand img{border-radius:13px!important}
.player-top-title strong{font-size:13px!important;max-width:36vw!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.player-top-title small{font-size:8px!important;color:var(--v3300-muted)!important}

.now-live{
  border:1px solid rgba(255,35,72,.28)!important;
  background:var(--v3300-redsoft)!important;
  color:#ff7089!important;
}

.player-top-actions{gap:7px!important}
.player-top-actions button,
.player-actions button,
.quality-control{
  border:1px solid var(--v3300-line)!important;
  background:#121a24!important;
  color:#dce3ea!important;
  border-radius:11px!important;
  transition:.16s ease!important;
}
.player-top-actions button:hover,
.player-actions button:hover{
  border-color:rgba(255,35,72,.45)!important;
  color:#fff!important;
  background:#18222e!important;
}

/* MAIN VIDEO ALWAYS KEEPS FULL WIDTH */
.player-layout{
  position:relative!important;
  display:block!important;
  min-height:0!important;
  height:calc(100% - 64px)!important;
  overflow:hidden!important;
}

.player-main{
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
}

.video-wrap{
  position:relative!important;
  flex:1 1 auto!important;
  min-height:0!important;
  background:#000!important;
  overflow:hidden!important;
}
.video-wrap video{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  background:#000!important;
}

.player-empty{background:radial-gradient(circle at center,rgba(29,39,52,.5),rgba(4,7,11,.98) 66%)!important}
.player-empty b{font-size:18px!important}
.player-empty small{color:var(--v3300-muted)!important}

.player-controlbar{
  flex:0 0 auto!important;
  padding:9px 12px!important;
  background:#091018!important;
  border-top:1px solid var(--v3300-line)!important;
}
.player-actions{gap:7px!important;overflow-x:auto!important;scrollbar-width:none!important}
.player-actions::-webkit-scrollbar{display:none!important}
.player-actions button,.quality-control{flex:0 0 auto!important;min-height:39px!important}

.epg-strip{flex:0 0 auto!important;background:#080e15!important;border-top:1px solid var(--v3300-line)!important}

/* ---------- ONE CHANNEL DRAWER: DESKTOP OVER VIDEO ---------- */
.player-drawer{
  position:absolute!important;
  z-index:90!important;
  top:12px!important;
  right:12px!important;
  bottom:12px!important;
  width:min(400px,32vw)!important;
  min-width:330px!important;
  max-width:400px!important;
  height:auto!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  border:1px solid var(--v3300-line2)!important;
  border-radius:18px!important;
  background:rgba(8,13,20,.98)!important;
  box-shadow:0 24px 80px rgba(0,0,0,.58)!important;
  backdrop-filter:blur(20px)!important;
  -webkit-backdrop-filter:blur(20px)!important;
  transform:translateX(calc(100% + 34px))!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transition:transform .22s cubic-bezier(.2,.75,.2,1),opacity .18s ease,visibility .18s ease!important;
}
.player-overlay.drawer-open .player-drawer{
  transform:translateX(0)!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
}

/* Subtle dim behind drawer */
.player-overlay.drawer-open .player-main:after{
  content:""!important;
  position:absolute!important;
  inset:0!important;
  z-index:70!important;
  pointer-events:none!important;
  background:linear-gradient(90deg,rgba(0,0,0,.04),rgba(0,0,0,.28))!important;
}
.player-overlay.drawer-open .player-drawer{z-index:95!important}

.drawer-head{
  flex:0 0 auto!important;
  min-height:64px!important;
  padding:11px 12px!important;
  border-bottom:1px solid var(--v3300-line)!important;
  background:rgba(8,13,20,.995)!important;
}
.drawer-head h3{font-size:16px!important;margin-top:2px!important}
.drawer-head .section-kicker{font-size:8px!important;letter-spacing:.18em!important;color:#ff6e86!important}
.drawer-head button{width:36px!important;height:36px!important;border-radius:11px!important;background:#121a24!important;border:1px solid var(--v3300-line)!important}

.drawer-search{
  flex:0 0 auto!important;
  padding:10px 12px!important;
  border-bottom:1px solid var(--v3300-line)!important;
  background:rgba(8,13,20,.995)!important;
}
.drawer-search input,
#drawerSearch{
  width:100%!important;
  height:43px!important;
  border:1px solid var(--v3300-line2)!important;
  border-radius:12px!important;
  background:#101923!important;
  color:#fff!important;
  outline:none!important;
  font-size:12px!important;
}
.drawer-search:focus-within input{border-color:rgba(255,35,72,.62)!important;box-shadow:0 0 0 3px rgba(255,35,72,.09)!important}

.drawer-list,
#drawerList{
  flex:1 1 auto!important;
  min-height:0!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  padding:9px!important;
  background:transparent!important;
  scrollbar-width:thin!important;
  scrollbar-color:rgba(255,255,255,.18) transparent!important;
}
.drawer-list::-webkit-scrollbar{width:5px!important}
.drawer-list::-webkit-scrollbar-thumb{background:rgba(255,255,255,.17)!important;border-radius:999px!important}

.drawer-channel{
  position:relative!important;
  display:grid!important;
  grid-template-columns:46px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  width:100%!important;
  min-height:62px!important;
  margin:0 0 7px!important;
  padding:8px 9px!important;
  border:1px solid transparent!important;
  border-radius:14px!important;
  background:#101923!important;
  color:#fff!important;
  text-align:left!important;
  transition:transform .14s ease,background .14s ease,border-color .14s ease!important;
}
.drawer-channel:hover{transform:translateY(-1px)!important;background:#151f2b!important;border-color:var(--v3300-line2)!important}
.drawer-channel.active{
  background:linear-gradient(90deg,rgba(255,35,72,.20),#121b25 72%)!important;
  border-color:rgba(255,35,72,.50)!important;
  box-shadow:inset 3px 0 0 var(--v3300-red)!important;
}
.drawer-channel img,.drawer-fallback{
  width:46px!important;height:46px!important;border-radius:11px!important;object-fit:contain!important;background:#eef1f4!important
}
.drawer-channel>span:not(.drawer-fallback){min-width:0!important;display:flex!important;flex-direction:column!important;gap:3px!important}
.drawer-channel b{font-size:12px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.drawer-channel small{font-size:9px!important;color:var(--v3300-muted)!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.drawer-channel em{
  min-width:40px!important;height:22px!important;padding:0 7px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  border:1px solid rgba(255,35,72,.28)!important;border-radius:999px!important;background:var(--v3300-redsoft)!important;color:#fff!important;font-style:normal!important;font-size:8px!important;font-weight:900!important
}

/* ---------- HOMEPAGE LIGHT POLISH ---------- */
.cinema-hero,.channel-card,.rail-card,.poster-card,.vip-banner{border-color:var(--v3300-line)!important}
.channel-card,.rail-card,.poster-card{transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease!important}
.channel-card:hover,.rail-card:hover,.poster-card:hover{transform:translateY(-3px)!important;border-color:var(--v3300-line2)!important;box-shadow:0 18px 44px rgba(0,0,0,.24)!important}

/* ---------- TABLET ---------- */
@media(max-width:1180px) and (min-width:761px){
  .player-shell{width:100%!important;border-radius:18px!important}
  .player-drawer{width:360px!important;min-width:320px!important;max-width:360px!important}
}

/* ---------- MOBILE + PWA: APP-LIKE BOTTOM SHEET ---------- */
@media(max-width:760px){
  .player-overlay{padding:0!important;background:#02050a!important}
  .player-shell{
    width:100vw!important;height:100dvh!important;min-height:100dvh!important;max-height:none!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;margin:0!important
  }
  .player-topbar{
    min-height:56px!important;flex-basis:56px!important;
    padding:0 10px!important
  }
  .player-layout{height:calc(100dvh - 56px)!important}
  .player-top-title strong{font-size:12px!important;max-width:42vw!important}
  .player-top-title small{display:none!important}
  .player-top-actions{gap:4px!important}
  .player-top-actions button{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important}

  .video-wrap{flex:1 1 auto!important}
  .video-wrap video{width:100%!important;height:100%!important;object-fit:contain!important}

  .player-controlbar{padding:7px 8px calc(7px + env(safe-area-inset-bottom))!important}
  .player-actions{gap:6px!important}
  .player-actions button,.quality-control{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;border-radius:10px!important}
  .quality-control{width:68px!important}
  .player-actions button span{display:none!important}

  .player-drawer{
    top:auto!important;
    left:7px!important;
    right:7px!important;
    bottom:7px!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:min(78dvh,720px)!important;
    border-radius:23px!important;
    transform:translateY(calc(100% + 30px))!important;
    box-shadow:0 -24px 80px rgba(0,0,0,.62)!important;
  }
  .player-overlay.drawer-open .player-drawer{transform:translateY(0)!important}
  .player-drawer:before{
    content:""!important;display:block!important;flex:0 0 auto!important;width:44px!important;height:4px!important;margin:8px auto 2px!important;border-radius:999px!important;background:rgba(255,255,255,.24)!important
  }
  .player-overlay.drawer-open .player-main:after{background:rgba(0,0,0,.42)!important;backdrop-filter:blur(1px)!important;-webkit-backdrop-filter:blur(1px)!important}
  .drawer-head{min-height:56px!important;padding:8px 10px!important}
  .drawer-head h3{font-size:15px!important}
  .drawer-search{padding:8px 10px!important}
  #drawerSearch{height:42px!important;font-size:16px!important}
  #drawerList{padding:8px 8px calc(16px + env(safe-area-inset-bottom))!important;scrollbar-width:none!important}
  #drawerList::-webkit-scrollbar{display:none!important}
  .drawer-channel{grid-template-columns:42px minmax(0,1fr) auto!important;min-height:58px!important;gap:9px!important;padding:7px 8px!important;border-radius:13px!important}
  .drawer-channel img,.drawer-fallback{width:42px!important;height:42px!important;border-radius:10px!important}
  .drawer-channel:active{transform:scale(.985)!important}
}

/* Standalone PWA safe areas */
@media(display-mode:standalone){
  .player-topbar{padding-top:env(safe-area-inset-top)!important;min-height:calc(56px + env(safe-area-inset-top))!important;flex-basis:calc(56px + env(safe-area-inset-top))!important}
  .player-layout{height:calc(100dvh - 56px - env(safe-area-inset-top))!important}
  .player-drawer{bottom:max(7px,env(safe-area-inset-bottom))!important}
}

@media(max-width:420px){
  .player-drawer{left:5px!important;right:5px!important;bottom:5px!important;height:80dvh!important;border-radius:21px!important}
  .player-top-title strong{max-width:38vw!important}
}

@media(max-height:520px) and (orientation:landscape){
  .player-topbar{min-height:48px!important;flex-basis:48px!important}
  .player-layout{height:calc(100dvh - 48px)!important}
  .player-drawer{height:calc(100dvh - 12px)!important;top:6px!important;bottom:6px!important}
  .epg-strip,.ad-companion{display:none!important}
}
