:root {
  --bg: #09090b;
  --surface: #121215;
  --surface-hover: #18181b;
  --border: #27272a;
  --border-focus: #52525b;
  --text: #fafafa;
  --text-muted: #71717a;
  --text-dim: #a1a1aa;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }

.container {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
}

/* HEADER */
header {
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.logo-box {
  border: 1px solid var(--text);
  padding: 2px 6px;
  font-size: 11px;
}

.btn-back {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
  text-decoration: none;
}

.btn-back:hover {
  color: var(--text);
  border-color: var(--border-focus);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header-adblock {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-header-adblock:hover {
  background: transparent;
  color: var(--text);
}

.lang-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 12px;
  outline: none;
  cursor: pointer;
  max-width: 220px;
  transition: border-color 0.15s ease;
}

.lang-select:hover,
.lang-select:focus {
  border-color: var(--border-focus);
}

.lang-select option {
  background: var(--surface);
  color: var(--text);
}

/* HERO BANNER */
.hero-banner {
  position: relative;
  width: 100%;
  min-height: 380px;
  background: #000;
  display: flex;
  align-items: flex-end;
  padding: 40px 0;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: grayscale(80%);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,9,11,0.2) 0%, rgba(9,9,11,0.85) 75%, var(--bg) 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.hero-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-play-btn {
  align-self: flex-start;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 24px;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.15s ease;
}

.hero-play-btn:hover {
  background: transparent;
  color: var(--text);
}

/* SEARCH SECTION */
.search-hero {
  padding: 30px 0 20px 0;
}

.search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-input-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.search-input-box:focus-within {
  border-color: var(--text-dim);
}

.search-tag {
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  user-select: none;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px 18px;
  outline: none;
}

.btn-clear-input {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

.btn-clear-input:hover {
  color: var(--text);
  transform: scale(1.15);
}

.search-btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 0 22px;
  height: 48px;
  cursor: pointer;
}

.provider-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--border-focus);
}

.tab-btn.active {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text);
}

.btn-clear-history {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.15s ease;
}

.btn-clear-history:hover {
  color: var(--text);
  border-color: var(--text-dim);
  background: var(--surface-hover);
}

/* COLLECTIONS & GRIDS */
.collection-block {
  margin-bottom: 40px;
}

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.collection-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.movie-card {
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.movie-card:hover,
.movie-card:focus-visible {
  border-color: #fafafa;
  transform: translateY(-2px) scale(1.02);
  background: var(--surface-hover);
  outline: 2px solid #fafafa;
  outline-offset: 2px;
  z-index: 2;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid #fafafa;
  outline-offset: 2px;
}

.poster-box {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #000;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(15%);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .poster-img {
  filter: grayscale(0%);
  transform: scale(1.02);
}

.badge-provider {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(9, 9, 11, 0.9);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 5px;
  color: var(--text);
}

.badge-rating {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(9, 9, 11, 0.9);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 5px;
  color: var(--text);
}

.card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* DEDICATED WATCH PAGE VIEW */
#watchPageView {
  display: none;
  padding-top: 24px;
  padding-bottom: 60px;
}

.watch-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

@media (max-width: 1024px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }
}

.player-column {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--surface);
}

.player-theater-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
}

.player-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* PROVIDER TABS BAR */
.provider-select-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.prov-tabs-left {
  display: flex;
}

.prov-tab-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.prov-tab-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.prov-tab-btn.active {
  color: var(--text);
  background: var(--bg);
  border-bottom: 2px solid var(--text);
}

.btn-reload-servers {
  margin-left: auto;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-reload-servers:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-left-color: var(--text);
}

.btn-reload-servers:active {
  transform: scale(0.98);
}

.btn-reload-servers.rotating .reload-icon {
  animation: spinReload 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spinReload {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.adshield-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: #10b981;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.adshield-btn:hover {
  background: rgba(16, 185, 129, 0.1);
}

.adshield-btn.disabled {
  color: var(--text-muted);
}

/* CONTROLS PANEL */
.stream-controls-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

.item-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.item-btn:hover {
  color: var(--text);
  border-color: var(--border-focus);
}

.item-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

.subtitles-box {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 90px;
  overflow-y: auto;
}

.sub-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  text-decoration: none;
}

.sub-tag:hover {
  color: var(--text);
  border-color: var(--text);
}

/* SIDEBAR METADATA */
.metadata-sidebar {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: fit-content;
}

.meta-poster-box {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #000;
  border: 1px solid var(--border);
  overflow: hidden;
}

.meta-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.meta-orig-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.meta-spec-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.meta-synopsis {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* FOOTER */
footer {
  margin-top: auto;
  padding: 20px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--text-muted);
  border-radius: 50%;
  border-top-color: var(--text);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ADBLOCK MODAL NOTIFICATION */
.adblock-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.adblock-modal-box {
  background: var(--surface);
  border: 1px solid var(--text);
  max-width: 520px;
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.adblock-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.adblock-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  letter-spacing: 0.08em;
}

.adblock-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.adblock-modal-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.adblock-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.adblock-btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.adblock-btn-primary:hover {
  background: transparent;
  color: var(--text);
}

.adblock-btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.adblock-btn-secondary:hover {
  color: var(--text);
  border-color: var(--border-focus);
}
