/*
 * IPTV365 ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â Unified Galaxy Background + Transparent Media Workspace
 * Load AFTER every other stylesheet and inline workspace style.
 * Visual-only: no player, API, login, dashboard tile, or navigation logic changes.
 */

/* One shared galaxy background for Dashboard, Live TV, Movies and Series.
   Scoped to post-login states only: no galaxy flash before the login window. */
html:has(body.iptv365-dashboard-mode),
html:has(body.iptv365-workspace-active),
body.iptv365-dashboard-mode,
body.iptv365-workspace-active {
  min-height: 100% !important;
  background-color: #03030a !important;
  background-image:
    linear-gradient(rgba(0, 0, 0, .50), rgba(0, 0, 0, .50)),
    var(--iptv365-global-bg) !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

/* Keep the common background visible through the app's outer shells. */.app-container {
  background: transparent !important;
}

/* Dashboard: preserve its existing tile design; only make its canvas transparent. */#dashboardScreen:not(.hidden),
#dashboardScreen:not(.hidden) .iptv-main-hub,
#dashboardScreen:not(.hidden) .content-sections-modern,
#dashboardScreen:not(.hidden) .sidebar-actions,
body.iptv365-dashboard-mode .iptv365-pro-dashboard,
body.iptv365-dashboard-mode .iptv365-pro-header,
body.iptv365-dashboard-mode .iptv365-pro-grid,
body.iptv365-dashboard-mode .iptv365-pro-footer {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

/* Movies design has been fully replaced by media-visual-fix.css. */

/* Series presentation is owned exclusively by series-visual.css. */

/* MOVIES + SERIES ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â globally suppress the old shared navigation pill and legacy Back controls
   for the entire media workspace, including Series detail/season/episode screens.
   Do not affect Live TV, Dashboard, the close (X) control, or the current IPTV365 header. */body:not(.iptv365-movies-mode):has(#mediaWorkspaceScreen:not(.hidden)) #iptv365GlobalNav,
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) > .iptv365-screen-back,
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) .iptv365-media-home-btn,
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) .backToHomeBtn,
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) .back-button,
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) button[aria-label*="Back"],
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) button[title*="Back"],
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) .media-back-button,
body:not(.iptv365-movies-mode) #mediaWorkspaceScreen:not(.hidden) .iptv-back-button {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}


/* FINAL NAV CLEANUP ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â Movies, Series and Live TV only.
   Remove the old shared Movies/Series/Home navigation pill and legacy text Back buttons.
   Preserve the current standalone back arrow in all three workspaces. */

/* Hide the shared navigation pill only while any media/player workspace is active. */body:not(.iptv365-movies-mode):has(#mediaWorkspaceScreen:not(.hidden)) #iptv365GlobalNav,
body:has(#liveWorkspaceScreen:not(.hidden)) #iptv365GlobalNav {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Movies + Series: remove the old white/text Back to Home control.
   Keep .iptv365-media-home-btn (the current arrow) visible and working. */#mediaWorkspaceScreen:not(.hidden) .backToHomeBtn,
#mediaWorkspaceScreen:not(.hidden) .back-button:not(.iptv365-media-home-btn),
#mediaWorkspaceScreen:not(.hidden) .iptv365-legacy-back,
#mediaWorkspaceScreen:not(.hidden) .legacy-back-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ================================================================
   IPTV365 FINAL LIVE TV DESIGN ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â SINGLE AUTHORITATIVE STYLE
   Matches the user's latest reference image.
   Scoped only to #liveWorkspaceScreen.
   No dashboard, Movies, Series, API, channel data, or player logic edits.
   ================================================================ */

/* Main two-column frame: left categories and right channel grid. */

/* Left category column and its divider. */

/* Outer category list surface, matching the reference's dark glass frame. */

/* Category rows: compact, dark rounded buttons; no oversized text. */

/* Right side channel area. */

/* Six columns on a compact desktop; scales up as screen width grows. */

/* Channel cards: charcoal glass fill, white outline, fixed visual rhythm. */

/* Logos retain their original source and aspect ratio. */

/* Three readable lines, with no change to channel names or their data. */

/* Keep the existing playback screen functional and inside the right pane. */

/* Legacy floating/back-to-categories control removed. The single sidebar Back button
   uses the existing app.js one-step Live TV back handler. */

/* Laptop and tablet: naturally reduce the number of columns. */

/* Small tablets and phones: keep 2ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œ3 useful channel columns. */


/* =========================================================
   LIVE TV ONLY ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â unified Back | Search split control
   Replaces the old floating Back button and standalone search.
   ========================================================= */


/* ================================================================
   IPTV365 LIVE TV â€” FULL VIEWPORT + CLEAN GLASS CHANNEL CARDS
   Targeted visual overrides only. Existing markup and JS handlers stay intact.
   ================================================================ */

/* Use the complete viewport. Keep the Live TV header in normal flow so it
   cannot be covered by the channel grid/layout. */
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Keep the existing header visible at the top; content begins below it. */
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) > .iptv-live-premium-header {
  position: relative !important;
  inset: auto !important;
  z-index: 5 !important;
  flex: 0 0 clamp(68px, 8.5vh, 88px) !important;
  width: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* The two-column Live TV workspace fills all remaining viewport space. */
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) > .iptv-live-layout {
  position: relative !important;
  inset: auto !important;
  z-index: 1 !important;
  display: grid !important;
  flex: 1 1 auto !important;
  grid-template-columns: minmax(220px, 25%) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 10px 12px 12px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  background: rgba(2, 7, 17, .72) !important;
  box-shadow: none !important;
}

/* Remove the small square/decorative glyph before each category name.
   Category text, ordering, click handlers and selection remain untouched. */
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) .iptv-category-row .iptv365-category-icon {
  display: none !important;
}
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) .iptv-category-row {
  justify-content: flex-start !important;
  gap: 0 !important;
}

/* Inactive channel cards use a quiet glass surface, not permanent neon. */
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) #liveChannelGrid > .iptv-channel-card,
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) #liveChannelGrid > .iptv-channel-card:nth-child(3n+1) {
  border: 1px solid rgba(220, 235, 248, .20) !important;
  border-radius: 15px !important;
  background: linear-gradient(145deg,
    rgba(255,255,255,.075),
    rgba(12,20,34,.58) 48%,
    rgba(5,10,20,.78)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.075),
              0 4px 14px rgba(0,0,0,.20) !important;
  -webkit-backdrop-filter: blur(12px) saturate(115%) !important;
  backdrop-filter: blur(12px) saturate(115%) !important;
  transform: none !important;
  transition: border-color .18s ease, box-shadow .18s ease,
              background .18s ease, transform .18s ease !important;
}

/* Neon is reserved for an actual interaction: hover, keyboard focus,
   or the currently selected channel. */
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) #liveChannelGrid > .iptv-channel-card:hover,
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) #liveChannelGrid > .iptv-channel-card:focus-visible,
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) #liveChannelGrid > .iptv-channel-card.active {
  border-color: rgba(35, 202, 255, .98) !important;
  background: linear-gradient(145deg,
    rgba(9, 45, 69, .88),
    rgba(8, 17, 32, .94)) !important;
  box-shadow: 0 0 0 1px rgba(35,202,255,.32),
              0 0 13px rgba(0,180,255,.48),
              0 0 25px rgba(0,145,255,.28),
              inset 0 0 14px rgba(0,180,255,.10) !important;
  transform: translateY(-1px) !important;
  outline: none !important;
}

/* On touch devices, the active class provides the highlight without hover. */
@media (hover: none) {
  #liveWorkspaceScreen.iptv-live-screen:not(.hidden) #liveChannelGrid > .iptv-channel-card:hover {
    border-color: rgba(220,235,248,.20) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.075),
                0 4px 14px rgba(0,0,0,.20) !important;
    transform: none !important;
  }
  #liveWorkspaceScreen.iptv-live-screen:not(.hidden) #liveChannelGrid > .iptv-channel-card.active {
    border-color: rgba(35,202,255,.98) !important;
    box-shadow: 0 0 0 1px rgba(35,202,255,.32),
                0 0 13px rgba(0,180,255,.48),
                0 0 25px rgba(0,145,255,.28),
                inset 0 0 14px rgba(0,180,255,.10) !important;
  }
}

/* Preserve a useful split layout on phones while still filling the viewport. */
@media (max-width: 800px) {
  #liveWorkspaceScreen.iptv-live-screen:not(.hidden) > .iptv-live-layout {
    grid-template-columns: minmax(118px, 32%) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    padding: 7px !important;
  }
  #liveWorkspaceScreen.iptv-live-screen:not(.hidden) > .iptv-live-premium-header {
    flex-basis: 60px !important;
  }
}

/* =========================================================
   IPTV365 LIVE TV â€” Movies background only.
   Reuse the exact cinematic green/blue background asset used
   by the Movies workspace. No layout, cards, or behavior changes.
   ========================================================= */
html:has(body #liveWorkspaceScreen.iptv-live-screen:not(.hidden)),
body:has(#liveWorkspaceScreen.iptv-live-screen:not(.hidden)) {
  background-color: #020812 !important;
  background-image: var(--iptv365-global-bg) !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

/* Keep the Live TV workspace canvas transparent so the new
   full-viewport Movies background remains visible behind it. */
#liveWorkspaceScreen.iptv-live-screen:not(.hidden) {
  background-color: transparent !important;
  background-image: none !important;
}