/* Layout pensado para 1920x1080. O tamanho base (rem) é ajustado pelo app.js
   conforme a resolução da TV. Sem variáveis CSS para rodar no webOS 3.x. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b0b0f; color: #f2f2f2; }
body { font-family: "LG Smart UI", "Segoe UI", Roboto, Arial, sans-serif; }
.hidden { display: none !important; }
.screen { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }

/* ---------- Topo ---------- */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 6rem; z-index: 5;
  display: flex; align-items: center; padding: 0 4.5rem;
  background: linear-gradient(to bottom, rgba(11,11,15,0.95), rgba(11,11,15,0));
}
.logo { font-size: 2.4rem; font-weight: 900; letter-spacing: 0.08em; color: #e50914; margin-right: 3rem; }
.logo span { color: #f2f2f2; }
#tabs { display: flex; flex: 1; }
.tab {
  background: transparent; border: 0; color: #b9b9c3; font: inherit; font-size: 1.4rem; font-weight: 600;
  padding: 0.6rem 1.4rem; margin-right: 0.6rem; border-radius: 2rem; outline: none;
}
.tab.active { color: #fff; border-bottom: 0.2rem solid #e50914; border-radius: 0; }
.tab.focused { background: #f2f2f2; color: #0b0b0f; border-radius: 2rem; }
#search-input {
  width: 22rem; font: inherit; font-size: 1.3rem; padding: 0.7rem 1.4rem; border-radius: 2rem;
  border: 0.15rem solid #44444f; background: rgba(0,0,0,0.6); color: #fff; outline: none;
}
#search-input.focused { border-color: #f2f2f2; background: #1c1c24; }
#settings-btn { font-size: 2rem; line-height: 1; padding: 0.4rem 0.9rem; margin: 0 0 0 1rem; }

/* ---------- Configurações ---------- */
#settings { background: #0b0b0f; z-index: 15; padding: 4rem 0 0; }
#settings-title { font-size: 3rem; padding: 0 9rem; }
#settings-note { font-size: 1.2rem; color: #8d8d99; padding: 0.4rem 9rem 0; }
#settings-body { position: absolute; top: 10rem; left: 0; right: 0; bottom: 0; overflow: hidden; padding: 0 9rem 4rem; }
.settings-section { font-size: 1.7rem; margin: 2rem 0 0.3rem; }
.settings-hint { font-size: 1.15rem; color: #8d8d99; margin-bottom: 0.8rem; }
.setting-line { display: flex; align-items: center; }
.setting {
  display: flex; align-items: center; width: 56rem; margin: 0 0 0.6rem; padding: 1rem 1.6rem;
  font: inherit; font-size: 1.4rem; text-align: left; color: #f2f2f2;
  background: #1c1c24; border: 0; border-radius: 0.5rem; outline: none;
}
.setting-label { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.setting-value { font-weight: 700; margin-left: 2rem; color: #b9b9c3; }
.setting.on .setting-value { color: #46d369; }
.setting.small { width: auto; margin-left: 1rem; }
.setting.focused { background: #f2f2f2; color: #0b0b0f; }
.setting.focused .setting-value { color: #0b0b0f; }
.setting-input {
  width: 56rem; margin: 0 0 0.6rem; padding: 1rem 1.6rem; font: inherit; font-size: 1.3rem;
  color: #fff; background: #16161d; border: 0.15rem solid #44444f; border-radius: 0.5rem; outline: none;
}
.setting-input.focused { border-color: #f2f2f2; }

/* ---------- Destaque (hero) ---------- */
#hero { position: absolute; top: 0; left: 0; right: 0; height: 62%; }
#hero-bg, #details-bg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover; background-position: center 20%;
}
#hero-shade {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to right, rgba(11,11,15,0.95) 0%, rgba(11,11,15,0.6) 45%, rgba(11,11,15,0) 75%),
              linear-gradient(to top, #0b0b0f 0%, rgba(11,11,15,0) 45%);
}
#hero-info { position: absolute; left: 4.5rem; top: 8rem; width: 46%; }
#hero-title { font-size: 3.6rem; line-height: 1.1; margin-bottom: 0.8rem; text-shadow: 0 0.2rem 1rem rgba(0,0,0,0.6); }
#hero-meta, #details-meta { font-size: 1.3rem; color: #46d369; font-weight: 600; margin-bottom: 0.8rem; }
#hero-overview {
  font-size: 1.3rem; line-height: 1.5; color: #d6d6de;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Fileiras ---------- */
#rows { position: absolute; top: 52%; left: 0; right: 0; bottom: 0; overflow: hidden; padding-bottom: 3rem; }
.row { margin-bottom: 1.4rem; }
.row-title { font-size: 1.6rem; font-weight: 700; padding: 0 4.5rem; margin-bottom: 0.6rem; }
.row-track {
  position: relative; display: flex; overflow: hidden; white-space: nowrap;
  padding: 1rem 4.5rem 1.2rem;
}
.card {
  -webkit-flex: 0 0 auto; flex: 0 0 auto; width: 11.5rem; margin-right: 1.1rem; border-radius: 0.6rem;
  background: #1c1c24; overflow: hidden; position: relative;
}
.card img { display: block; width: 100%; height: 17.25rem; object-fit: cover; }
.card .placeholder {
  height: 17.25rem; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1rem; font-size: 1.2rem; white-space: normal; color: #b9b9c3;
}
.card .card-label {
  font-size: 1rem; padding: 0.4rem 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d6d6de;
}
.card.wide { width: 20rem; }
.card.wide img, .card.wide .placeholder { height: 11.25rem; }
.card.logo img { object-fit: contain; padding: 1.5rem; box-sizing: border-box; background: #1f1f29; }
.card.focused {
  /* Sem sombra desfocada nem transição: na TV isso pesa a cada movimento. */
  -webkit-transform: scale(1.08); transform: scale(1.08); z-index: 2;
  box-shadow: 0 0 0 0.25rem #f2f2f2;
}

#message {
  position: absolute; top: 58%; left: 4.5rem; right: 4.5rem; font-size: 1.5rem; line-height: 1.6;
  color: #d6d6de; background: #16161d; padding: 2rem; border-radius: 0.8rem; border-left: 0.4rem solid #e50914;
}

/* ---------- Detalhes ---------- */
#details { background: #0b0b0f; z-index: 10; }
#details-shade {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to right, #0b0b0f 0%, rgba(11,11,15,0.85) 45%, rgba(11,11,15,0.2) 100%),
              linear-gradient(to top, #0b0b0f 0%, rgba(11,11,15,0) 50%);
}
#details-info { position: absolute; left: 4.5rem; top: 6rem; width: 50%; }
#details-title { font-size: 3.4rem; margin-bottom: 1rem; }
#details-overview { font-size: 1.35rem; line-height: 1.6; color: #d6d6de; margin-bottom: 2rem; max-height: 13rem; overflow: hidden; }
#details-actions { display: flex; }
.btn {
  font: inherit; font-size: 1.4rem; font-weight: 700; padding: 0.9rem 2.4rem; margin-right: 1rem;
  border-radius: 0.5rem; border: 0; background: rgba(109,109,110,0.7); color: #fff; outline: none;
}
.btn.primary { background: #e50914; }
.btn.focused { background: #f2f2f2; color: #0b0b0f; -webkit-transform: scale(1.05); transform: scale(1.05); }
#details-children { position: absolute; left: 0; right: 0; bottom: 2rem; }

/* ---------- Player ---------- */
#player { background: #000; z-index: 20; }
#video, #yt-holder iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: #000; }
#player-ui {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3rem 4.5rem 2.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  -webkit-transition: opacity 0.3s; transition: opacity 0.3s;
}
#player-ui.faded { opacity: 0; }
#player-title { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
#player-bar { height: 0.45rem; background: rgba(255,255,255,0.25); border-radius: 0.3rem; overflow: hidden; }
#player-progress { height: 100%; width: 0; background: #e50914; }
#player-time { font-size: 1.2rem; margin-top: 0.7rem; color: #d6d6de; }
#player-hint { font-size: 1.05rem; margin-top: 0.4rem; color: #8d8d99; }
#player-spinner {
  position: absolute; top: 50%; left: 50%; width: 5rem; height: 5rem; margin: -2.5rem 0 0 -2.5rem;
  border: 0.45rem solid rgba(255,255,255,0.2); border-top-color: #e50914; border-radius: 50%;
  -webkit-animation: spin 0.9s linear infinite; animation: spin 0.9s linear infinite;
}
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Avisos ---------- */
#toast {
  position: absolute; bottom: 3rem; left: 50%; width: 50rem; margin-left: -25rem; z-index: 50; text-align: center;
  background: rgba(28,28,36,0.96); padding: 1.1rem 2rem; border-radius: 0.6rem; font-size: 1.3rem;
  box-shadow: 0 0.6rem 2rem rgba(0,0,0,0.6);
}
.loading { font-size: 1.4rem; color: #8d8d99; padding: 2rem 4.5rem; }
