/*
Theme Name: Cineflix
Theme URI: https://example.com/cineflix
Author: Cineflix
Author URI: https://example.com
Description: Tema WordPress estilo Netflix para catálogo de filmes, séries e animes usando a API do TMDb. Inclui hero rotativo, filtros por gênero estilo Netflix, paginação e player via embed.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cineflix
Tags: dark, full-width-template, custom-colors, custom-menu, theme-options, translation-ready
*/

:root {
  --bg: #0a0a0c;
  --bg-2: #141418;
  --card: #1c1c22;
  --border: #2a2a31;
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --primary: #e50914;
  --primary-hover: #f6121d;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Navbar */
.cf-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 14px 4vw; display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: background .25s ease; background: linear-gradient(to bottom, rgba(0,0,0,.85), transparent); }
.cf-nav.scrolled { background: rgba(10,10,12,.95); backdrop-filter: blur(10px); }
.cf-nav .cf-brand { color: var(--primary); font-weight: 900; font-size: 26px; letter-spacing: -.5px; }
.cf-nav .cf-menu { display: flex; gap: 18px; flex: 1; margin-left: 28px; overflow-x: auto; }
.cf-nav .cf-menu a { font-size: 14px; color: #e5e5e5; white-space: nowrap; }
.cf-nav .cf-menu a:hover { color: var(--primary); }
.cf-nav form { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.55); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; }
.cf-nav form input { background: transparent; border: 0; color: var(--text); outline: none; width: 180px; }

/* Hero */
.cf-hero { position: relative; height: 85vh; min-height: 460px; overflow: hidden; }
.cf-hero .cf-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.cf-hero .cf-slide.active { opacity: 1; }
.cf-hero .cf-slide img { width: 100%; height: 100%; object-fit: cover; }
.cf-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 5%, transparent 60%), linear-gradient(to right, rgba(0,0,0,.7), transparent 60%); pointer-events: none; }
.cf-hero .cf-hero-info { position: absolute; left: 4vw; bottom: 12vh; max-width: 640px; z-index: 2; }
.cf-hero h1 { font-size: clamp(28px, 4.5vw, 60px); font-weight: 900; margin: 0 0 12px; }
.cf-hero p { font-size: clamp(13px, 1.1vw, 16px); color: #e5e5e5; line-height: 1.45; margin: 0 0 22px; }
.cf-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 4px; font-weight: 600; font-size: 15px; }
.cf-btn-primary { background: #fff; color: #000; }
.cf-btn-primary:hover { background: rgba(255,255,255,.85); }
.cf-btn-secondary { background: rgba(109,109,110,.7); color: #fff; margin-left: 10px; }
.cf-btn-secondary:hover { background: rgba(109,109,110,.5); }

/* Rows */
.cf-row { padding: 28px 4vw; }
.cf-row h2 { font-size: clamp(18px, 1.5vw, 24px); margin: 0 0 14px; }
.cf-row .cf-scroller { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cf-row .cf-scroller::-webkit-scrollbar { display: none; }
.cf-card { flex: 0 0 auto; width: 180px; }
.cf-card .cf-poster { aspect-ratio: 2/3; border-radius: 4px; overflow: hidden; background: var(--card); transition: transform .2s ease; }
.cf-card:hover .cf-poster { transform: scale(1.06); outline: 2px solid var(--primary); }
.cf-card img { width: 100%; height: 100%; object-fit: cover; }
.cf-card p { margin: 8px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Category browser */
.cf-browser { padding: 100px 4vw 40px; }
.cf-browser-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.cf-browser-head h1 { font-size: clamp(22px, 2.4vw, 36px); margin: 0; }
.cf-dropdown { position: relative; }
.cf-dropdown > button { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: #fff; border: 1px solid #fff; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.cf-dropdown-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; max-height: 360px; overflow-y: auto; background: rgba(0,0,0,.92); border: 1px solid #333; padding: 6px 0; display: none; z-index: 30; }
.cf-dropdown.open .cf-dropdown-menu { display: block; }
.cf-dropdown-menu button { width: 100%; text-align: left; background: transparent; border: 0; color: #ddd; padding: 8px 14px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.cf-dropdown-menu button:hover { background: rgba(255,255,255,.08); color: #fff; }
.cf-dropdown-menu button.active { color: var(--primary); font-weight: 600; }

.cf-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cf-grid .cf-card { width: 100%; }

/* Pagination */
.cf-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 40px 0 10px; flex-wrap: wrap; }
.cf-pagination a, .cf-pagination span { padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; color: #ddd; font-size: 14px; min-width: 38px; text-align: center; }
.cf-pagination a:hover { background: var(--card); }
.cf-pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Single (movie/tv) */
.cf-single { padding-top: 64px; }
.cf-player { width: 100%; aspect-ratio: 16/9; background: #000; }
.cf-player iframe { width: 100%; height: 100%; border: 0; }
.cf-backdrop { position: relative; height: 60vh; min-height: 340px; }
.cf-backdrop img { width: 100%; height: 100%; object-fit: cover; }
.cf-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), transparent 70%); }
.cf-play-btn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.cf-play-btn .cf-play-circle { width: 96px; height: 96px; border-radius: 50%; background: var(--primary); display: grid; place-items: center; color: #fff; font-size: 38px; box-shadow: 0 12px 40px rgba(0,0,0,.5); transition: background .2s ease; }
.cf-play-btn:hover .cf-play-circle { background: var(--primary-hover); }
.cf-meta { padding: 28px 4vw; max-width: 900px; }
.cf-meta h1 { font-size: clamp(26px, 3vw, 48px); margin: 0 0 8px; font-weight: 900; }
.cf-meta .cf-tags { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 12px 0 16px; }
.cf-meta .cf-tag { background: var(--card); padding: 3px 8px; border-radius: 4px; }
.cf-meta p.cf-overview { font-size: 15px; line-height: 1.6; color: #e5e5e5; }

/* Footer */
.cf-footer { padding: 40px 4vw; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 40px; }

/* Responsive */
@media (max-width: 768px) {
  .cf-nav { padding: 10px 16px; }
  .cf-nav form input { width: 100px; }
  .cf-card { width: 130px; }
  .cf-hero { height: 70vh; }
  .cf-btn-secondary { margin-left: 0; }
}

/* Smart TV / D-pad navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
  transform: scale(1.04);
  transition: transform 120ms ease;
  z-index: 5;
  position: relative;
}
html { scroll-behavior: smooth; }
@media (min-width: 1920px) {
  html { font-size: 18px; }
  body { padding: 24px; }
}
@media (min-width: 2560px) {
  html { font-size: 22px; }
  body { padding: 40px; }
}
