/*
Theme Name: CineBy - Movie & TV Streaming
Theme URI: https://cineby.sc
Description: A 100% cineby.sc clone theme for WordPress — dark background #05070a, red accent #dc2626, bottom floating dock, hero banner, film cards.
Version: 2.2.0
Author: CineBy
Text Domain: cineby
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #05070a; --bg2: #0b0f14; --bg3: #111520;
  --card-bg: #0d1117; --border: rgba(255,255,255,0.07);
  --primary: #dc2626; --primary-h: #ef4444;
  --text: #eef1f6; --text-muted: #8b9ab4; --text-dim: #3a4560;
  --radius: 10px;
}
html { height: -webkit-fill-available; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px; line-height: 1.5;
  min-height: 100vh; overflow-x: hidden; padding-bottom: 110px;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; color: inherit; font-family: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

/* WRAPPER */
.homewrapper, .wrapper, .sectionwrapper {
  max-width: 1360px; margin: 0 auto; padding: 0 16px;
}

/* HEADER */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 62px;
  background: linear-gradient(180deg, rgba(5,7,10,0.97) 0%, rgba(5,7,10,0) 100%);
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
}
.site-header .logo {
  font-size: 21px; font-weight: 700; letter-spacing: -0.5px;
  white-space: nowrap; flex-shrink: 0;
}
.site-header .logo span { color: var(--primary); }
.site-header .search-wrap {
  flex: 1; max-width: 500px; margin: 0 auto; position: relative;
}
.site-header .search-input {
  width: 100%; height: 38px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px; padding: 0 46px 0 16px;
  color: var(--text); font-size: 13px; outline: none;
}
.site-header .search-input::placeholder { color: var(--text-muted); }
.site-header .search-input:focus { border-color: rgba(220,38,38,0.45); }
.site-header .search-btn {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
  background: none; border: none; cursor: pointer;
}
.site-header .hdr-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s; flex-shrink: 0;
}
.site-header .hdr-btn:hover { color: var(--text); background: rgba(255,255,255,0.1); }

/* BOTTOM DOCK */
.dock-panel {
  position: fixed; bottom: 14px; left: 50%;
  transform: translateX(-50%); z-index: 200;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 12px 10px; border-radius: 22px;
  background: rgba(11,15,20,0.85);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.85), inset 0 1px 0 rgba(255,255,255,0.06);
  white-space: nowrap;
}
.dock-item {
  position: relative; display: inline-flex; flex-direction: column;
  align-items: center; gap: 5px; padding: 8px 16px; border-radius: 14px;
  background: rgba(5,7,10,0.9); border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted); font-size: 11px; font-weight: 500;
  text-decoration: none; min-width: 62px; letter-spacing: 0.01em;
  transition: color 0.18s, background 0.22s, border-color 0.22s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 6px 14px -6px rgba(0,0,0,0.6);
}
.dock-item:hover { color: var(--primary-h); border-color: rgba(220,38,38,0.25); }
.dock-item.active { color: var(--primary); border-color: rgba(220,38,38,0.2); }
.dock-item.active::after {
  content: ""; position: absolute; bottom: -10px; left: 50%;
  transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 10px rgba(220,38,38,0.8);
}
.dock-icon { display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* HERO BANNER */
.hero-banner {
  position: relative; width: 100%; height: 80vh;
  min-height: 520px; max-height: 760px; overflow: hidden;
}
.hero-backdrop {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
}
.banner-overlay-hero {
  position: absolute; bottom: -2px; left: 0; right: 0; width: 100%; height: 101%;
  background:
    linear-gradient(180deg, rgba(5,7,10,0) 30%, #05070a),
    linear-gradient(180deg, rgba(0,0,0,0.55) 0, rgba(5,7,10,0) 35%),
    linear-gradient(270deg, rgba(5,7,10,0) 45%, rgba(5,7,10,0.58) 90%);
  z-index: 2;
}
.hero-content {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: flex-end; padding: 0 5% 10vh;
}
.hero-info { max-width: 560px; }
.hero-title { font-size: clamp(26px,4vw,52px); font-weight: 700; line-height: 1.12; margin-bottom: 12px; }
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 14px; margin-bottom: 14px; color: var(--text-muted); font-size: 13px;
}
.hero-meta .rating { display: flex; align-items: center; gap: 4px; color: #f5c518; font-weight: 600; }
.hero-desc { font-size: 14px; color: var(--text-muted); line-height: 1.65; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600; border-radius: 12px;
  transition: background 0.2s; text-decoration: none;
}
.hero-btn-play:hover { background: var(--primary-h); }
.hero-btn-info {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14); color: var(--text);
  font-size: 14px; font-weight: 500; border-radius: 12px;
  transition: background 0.2s; text-decoration: none;
}
.hero-btn-info:hover { background: rgba(255,255,255,0.16); }
.hero-dots { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; }
.hero-dot { width: 24px; height: 2px; border-radius: 2px; background: rgba(238,241,246,0.22); cursor: pointer; transition: background 0.3s, width 0.3s; }
.hero-dot.active { width: 44px; background: var(--primary); box-shadow: 0 0 12px rgba(220,38,38,0.6); }

/* SECTIONS */
.section-block { margin-bottom: 44px; }
.heading-trail { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.heading-trail::before { content: ""; width: 3px; height: 20px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }
.heading-trail h2 { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; }
.view-all { margin-left: auto; font-size: 12px; color: var(--primary); font-weight: 500; }
.view-all:hover { color: var(--primary-h); }

/* Tabs */
.tab-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn { padding: 5px 16px; font-size: 12px; font-weight: 600; border: 1px solid rgba(255,255,255,0.09); border-radius: 20px; background: rgba(255,255,255,0.04); color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.pill-btn.active, .pill-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* FILM GRID */
.film-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 14px; }
@media (min-width: 768px) { .film-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; } }

/* FILM CARD */
.flw-item { position: relative; min-width: 0; }
.film-poster {
  display: block; position: relative; width: 100%;
  aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden;
  background: var(--card-bg); border: 1px solid rgba(255,255,255,0.04);
}
.film-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; display: block; }
.flw-item:hover .film-poster img { transform: scale(1.05); }
.poster-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s; border-radius: var(--radius);
}
.flw-item:hover .poster-overlay { background: rgba(0,0,0,0.4); }
.play-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(220,38,38,0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.7);
  transition: opacity 0.25s, transform 0.25s;
  color: #fff; font-size: 20px;
}
.flw-item:hover .play-icon { opacity: 1; transform: scale(1); }
.tick-item { position: absolute; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; line-height: 1.5; }
.tick-rate { top: 7px; left: 7px; background: rgba(0,0,0,0.78); color: #f5c518; display: flex; align-items: center; gap: 3px; backdrop-filter: blur(4px); }
.tick-quality { top: 7px; right: 7px; background: var(--primary); color: #fff; }
.film-detail { padding: 9px 2px 2px; }
.film-name { display: block; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; transition: color 0.15s; }
.film-name:hover { color: #fff; }
.fd-infor { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }

/* DETAIL PAGE */
.detail-hero { position: relative; width: 100%; height: 58vh; min-height: 380px; overflow: hidden; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.detail-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,7,10,0.22) 0%, rgba(5,7,10,0.98) 100%), linear-gradient(90deg, rgba(5,7,10,0.72) 0%, transparent 55%); }
.detail-content { position: relative; max-width: 1360px; margin: -130px auto 0; padding: 0 20px 40px; z-index: 2; }
.detail-layout { display: flex; gap: 28px; align-items: flex-start; }
.detail-poster { flex-shrink: 0; width: 190px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.07); box-shadow: 0 10px 44px rgba(0,0,0,0.65); }
.detail-poster img { width: 100%; display: block; }
.detail-info { flex: 1; min-width: 0; padding-top: 120px; }
.detail-title { font-size: clamp(22px,3vw,40px); font-weight: 700; margin-bottom: 12px; }
.detail-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.stat-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.stat-quality { background: var(--primary); color: #fff; }
.stat-rating { background: rgba(245,197,24,0.12); color: #f5c518; border: 1px solid rgba(245,197,24,0.28); }
.stat-year { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border); }
.detail-desc { font-size: 14px; color: var(--text-muted); line-height: 1.72; margin-bottom: 18px; }
.genre-chip { display: inline-flex; padding: 4px 12px; border-radius: 20px; font-size: 12px; color: var(--text-muted); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); margin: 2px; }
.genre-chip:hover { color: var(--primary); border-color: rgba(220,38,38,0.3); }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.btn-primary:hover { background: var(--primary-h); }
.player-wrap { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 14px; overflow: hidden; margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.06); }
.player-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.tv-player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.tv-player-layout .player-wrap { min-width: 0; }
.tv-episode-panel { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.server-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.server-btn { padding: 7px 16px; border-radius: 9px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.server-btn:hover, .server-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ep-btn { padding: 6px 12px; border-radius: 7px; font-size: 11px; font-weight: 500; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07); color: var(--text-muted); cursor: pointer; transition: all 0.18s; }
.ep-btn:hover, .ep-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ep-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; max-height: 160px; overflow-y: auto; }
.cast-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.cast-card { flex-shrink: 0; width: 80px; text-align: center; }
.cast-photo { width: 70px; height: 70px; border-radius: 50%; overflow: hidden; margin: 0 auto 5px; background: var(--bg3); border: 2px solid rgba(255,255,255,0.07); }
.cast-photo img { width: 100%; height: 100%; object-fit: cover; }
.cast-name { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-char { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* FILTER PAGE */
.browse-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-btn { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid rgba(255,255,255,0.09); background: rgba(255,255,255,0.04); color: var(--text-muted); cursor: pointer; transition: all 0.18s; }
.filter-btn:hover, .filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* SEARCH */
.search-page { padding: 80px 0 40px; }
.big-search { position: relative; max-width: 600px; margin: 0 auto 32px; }
.big-input { width: 100%; height: 50px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 25px; padding: 0 50px 0 20px; color: var(--text); font-size: 15px; outline: none; }
.big-input:focus { border-color: rgba(220,38,38,0.4); }
.big-btn { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--primary); background: none; border: none; cursor: pointer; font-size: 18px; }

/* HOME SEO INTRO */
.home-seo { max-width: 860px; margin: 8px auto 18px; padding: 22px 24px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.025); }
.home-seo h2 { font-size: 18px; margin-bottom: 8px; }
.home-seo p { color: var(--text-muted); font-size: 13px; line-height: 1.75; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 32px 0; flex-wrap: wrap; }
.page-btn { min-width: 36px; height: 36px; border-radius: 9px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); color: var(--text-muted); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 10px; transition: all 0.18s; }
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* FOOTER */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 20px; text-align: center; font-size: 12px; color: var(--text-dim); margin-bottom: 90px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* PWA INSTALL PROMPT */
.pwa-install-card {
  position: fixed; right: 18px; bottom: 20px; z-index: 220;
  display: flex; align-items: center; gap: 12px; max-width: 300px;
  padding: 10px 10px 10px 14px; border-radius: 14px;
  background: rgba(11,15,20,0.96); border: 1px solid rgba(220,38,38,0.45);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5); backdrop-filter: blur(18px);
}
.pwa-install-card[hidden] { display: none; }
.pwa-install-copy { display: flex; flex-direction: column; min-width: 0; }
.pwa-install-copy strong { color: var(--text); font-size: 12px; white-space: nowrap; }
.pwa-install-copy span { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
#cineby-install-button { padding: 8px 11px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
#cineby-install-button:hover { background: var(--primary-h); }
.pwa-install-close { color: var(--text-muted); font-size: 18px; line-height: 1; padding: 2px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .site-header { padding: 0 12px; gap: 8px; }
  .site-header .search-wrap { min-width: 0; }
  .hero-content { padding: 0 16px 88px; }
  .hero-title { font-size: 22px; }
  .hero-desc { display: none; }
  .film-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .detail-layout { flex-direction: column; }
  .detail-poster { width: 130px; }
  .detail-info { padding-top: 10px; }
  .detail-hero { height: 42vh; }
  .detail-content { margin-top: -70px; padding: 0 12px 30px; }
  .dock-item { padding: 7px 10px; min-width: 50px; font-size: 10px; }
  .tv-player-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tv-episode-panel { order: 2; }
  .player-wrap { aspect-ratio: 16 / 9; min-height: 200px; }
  .home-seo { margin-top: 0; padding: 18px; }
  .pwa-install-card { right: 12px; bottom: 88px; max-width: calc(100vw - 24px); }
}
