/**
 * NovaStream "Nova Horizon" Cinema Theme (BOOST 6.10)
 * Optimized for VIDAA Smart TV & Desktop Browser
 * Chromium 53 strict hardware acceleration
 */

/* ==========================================================================
   1. A/B LAYOUT SWITCHER STATE
   ========================================================================== */

/* Classic layout: hide horizon top-bar */
body:not([data-ui-layout="nova-horizon"]) #horizon-top-nav,
body[data-ui-layout="nova-classic"] #horizon-top-nav {
  display: none !important;
}

/* Horizon layout: hide sidebar, expand main-content full-width */
body[data-ui-layout="nova-horizon"] #sidebar {
  display: none !important;
}

body[data-ui-layout="nova-horizon"] #main-content {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  margin-left: 0 !important;
  padding-top: 76px;
  box-sizing: border-box;
}

body[data-ui-layout="nova-horizon"] #view-search.active {
  top: 76px !important;
  height: calc(100% - 76px) !important;
  box-sizing: border-box !important;
}

/* On mobile / small screens, mobile design system takes precedence */
@media screen and (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  #horizon-top-nav {
    display: none !important;
  }
}

/* ==========================================================================
   2. HORIZON FLOATING TOP NAVIGATION BAR (Ref 09)
   ========================================================================== */
#horizon-top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(8, 10, 18, 0.98) 0%, rgba(8, 10, 18, 0.88) 70%, rgba(8, 10, 18, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

/* Brand left zone */
.horizon-nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.horizon-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.horizon-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.horizon-logo-text {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.horizon-logo-text span {
  color: #00d2ff;
}

/* Profile chip in top bar */
.horizon-profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e6e9f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  outline: none;
}

.horizon-profile-avatar {
  font-size: 16px;
  line-height: 1;
}

.horizon-profile-name {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.horizon-profile-chip:hover,
.horizon-profile-chip.focused {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
  transform: scale(1.04);
}

/* Center navigation pills */
.horizon-nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.horizon-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 22px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  white-space: nowrap;
}

.horizon-nav-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex-shrink: 0;
}

.horizon-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.horizon-nav-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
}

.horizon-nav-btn.focused {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
  transform: scale(1.04);
}

/* Meta right zone (Clock + Settings + Fullscreen) */
.horizon-nav-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.horizon-clock {
  font-size: 15px;
  font-weight: 700;
  color: #a3a9b8;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.horizon-settings-btn {
  padding: 8px 12px;
}

/* ==========================================================================
   3. FULL-WIDTH BILLBOARD HERO BANNER (Ref 05)
   ========================================================================== */
body[data-ui-layout="nova-horizon"] #hero-banner {
  margin-top: -76px;
  padding-top: 100px;
  min-height: 520px;
  background-size: cover;
  background-position: center 20%;
  position: relative;
}

body[data-ui-layout="nova-horizon"] .hero-overlay {
  background: linear-gradient(180deg, rgba(8, 10, 18, 0.7) 0%, rgba(8, 10, 18, 0.3) 30%, rgba(8, 10, 18, 0.8) 75%, #080a12 100%),
              linear-gradient(90deg, rgba(8, 10, 18, 0.92) 0%, rgba(8, 10, 18, 0.5) 45%, transparent 100%);
}

body[data-ui-layout="nova-horizon"] .hero-content {
  padding-left: 40px;
  max-width: 680px;
}

/* ==========================================================================
   5. NETFLIX CINEMA POLISH FOCUS RING (BOOST 6.10 24Z)
   ========================================================================== */
body[data-ui-layout="nova-horizon"] .card.focused,
body[data-ui-layout="nova-horizon"] .live-channel-row.focused,
body[data-ui-layout="nova-horizon"] .cat-item-btn.focused,
body[data-ui-layout="nova-horizon"] .live-cat-btn.focused {
  outline: none !important;
  border: 3px solid #ffffff !important;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.45) !important;
  transform: scale(1.04) translateZ(0) !important;
  transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.14s ease, border-color 0.14s ease;
  z-index: 40;
}

body[data-ui-layout="nova-horizon"] .btn-hero.focused {
  border: 3px solid #ffffff !important;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.6) !important;
  transform: scale(1.06) translateZ(0) !important;
}

body[data-ui-layout="nova-horizon"] .btn-hero.play.focused {
  background: #ffffff !important;
  color: #000000 !important;
  border: 3px solid #00f0ff !important;
  outline: 2px solid rgba(0, 240, 255, 0.6) !important;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.95), 0 0 12px rgba(112, 51, 251, 0.8) !important;
  transform: scale(1.08) translateZ(0) !important;
}

body[data-ui-layout="nova-horizon"] .btn-hero.play.focused svg {
  fill: #000000 !important;
}

/* Hardware CSS Acceleration for low-RAM VIDAA TV */
body[data-ui-layout="nova-horizon"] .card,
body[data-ui-layout="nova-horizon"] .btn-hero,
body[data-ui-layout="nova-horizon"] .horizon-nav-btn {
  will-change: transform;
}

/* ==========================================================================
   6. NETFLIX STYLE COMPACT SEARCH LAYOUT (NOVA HORIZON)
   ========================================================================== */
body[data-ui-layout="nova-horizon"] .search-layout {
  padding: 16px 36px 16px 36px !important;
  gap: 32px !important;
}

body[data-ui-layout="nova-horizon"] .search-keyboard-panel {
  width: 338px !important;
  min-width: 330px !important;
  max-width: 345px !important;
  padding: 4px 8px 16px 8px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body[data-ui-layout="nova-horizon"] .search-input-display {
  min-height: 44px !important;
  padding: 8px 14px !important;
  border-radius: 10px !important;
}

body[data-ui-layout="nova-horizon"] .search-input-icon {
  width: 20px !important;
  height: 20px !important;
  margin-right: 10px !important;
}

body[data-ui-layout="nova-horizon"] .search-query-text {
  font-size: 16px !important;
}

/* Netflix Filter Tabs: 1 single aligned horizontal row */
body[data-ui-layout="nova-horizon"] .search-filter-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body[data-ui-layout="nova-horizon"] .search-filter-tab {
  flex: 1 1 0 !important;
  padding: 6px 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
}

body[data-ui-layout="nova-horizon"] .search-filter-tab svg {
  width: 12px !important;
  height: 12px !important;
  margin-right: 3px !important;
}

/* Compact Virtual Keyboard */
body[data-ui-layout="nova-horizon"] .keyboard-grid,
body[data-ui-layout="nova-horizon"] .virtual-keyboard-grid {
  gap: 5px !important;
  padding: 4px 6px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

body[data-ui-layout="nova-horizon"] .key-btn,
body[data-ui-layout="nova-horizon"] .search-key {
  height: 38px !important;
  font-size: 15px !important;
  border-radius: 6px !important;
}

body[data-ui-layout="nova-horizon"] .key-btn.action-btn {
  font-size: 12px !important;
}

body[data-ui-layout="nova-horizon"] .key-btn.focused,
body[data-ui-layout="nova-horizon"] .search-key.focused {
  border-color: #ffffff !important;
  box-shadow: 0 0 16px rgba(112, 51, 251, 0.85), 0 0 8px rgba(0, 210, 255, 0.95) !important;
  background: rgba(112, 51, 251, 0.35) !important;
  color: #ffffff !important;
  transform: scale(1.06) !important;
  z-index: 5 !important;
}

/* Recent Searches: 100% visible below keyboard without scroll */
body[data-ui-layout="nova-horizon"] .search-history-container {
  padding: 8px 12px !important;
  gap: 6px !important;
  border-radius: 8px !important;
}

body[data-ui-layout="nova-horizon"] .search-history-title {
  font-size: 11px !important;
}

body[data-ui-layout="nova-horizon"] .history-chip {
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 12px !important;
}

/* Expanded Results Panel */
body[data-ui-layout="nova-horizon"] .search-results-panel {
  padding-left: 10px !important;
  padding-right: 20px !important;
  gap: 16px !important;
}

body[data-ui-layout="nova-horizon"] .search-vod-grid .card-vod,
body[data-ui-layout="nova-horizon"] .search-series-grid .card-vod {
  width: calc((100% - 64px) / 5) !important;
  height: 330px !important;
}

@media (max-width: 1600px) {
  body[data-ui-layout="nova-horizon"] .search-vod-grid .card-vod,
  body[data-ui-layout="nova-horizon"] .search-series-grid .card-vod {
    width: calc((100% - 48px) / 4) !important;
    height: 310px !important;
  }
}

