/* =========================================================
   LokiPorn — Clean Dark Tube UI
   ========================================================= */

:root {
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #222222;
  --surface-hover: #2c2c2c;
  --border: #272727;
  --border-light: #3a3a3a;
  --text: #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  --accent: #e50914;
  --accent-hover: #f40612;
  --max: 1600px;
}

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

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #303030;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #454545;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px 64px;
}

/* ---------------- 18+ KAPISI ---------------- */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(12px);
}

html.age-ok .age-gate {
  display: none;
}

.age-gate__card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 26px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.age-gate__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.age-gate__18 {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.age-gate h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.age-gate__lead {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

.age-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------------- BUTONLAR ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

.btn--wide {
  min-width: 240px;
  height: 42px;
}

/* ---------------- HEADER ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(15, 15, 15, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding-left: 1px;
}

.brand__name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand__name b {
  font-weight: 800;
  color: var(--accent);
}

.brand--sm .brand__icon {
  width: 24px;
  height: 19px;
  font-size: 10px;
}
.brand--sm .brand__name {
  font-size: 16px;
}

/* Arama Çubuğu */
.search {
  position: relative;
  flex: 1 1 auto;
  max-width: 560px;
  margin: 0 auto;
}

.search__icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 38px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #121212;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search input::placeholder {
  color: var(--text-muted);
}

.search input:focus {
  outline: none;
  border-color: #4a4a4a;
  background: #161616;
}

.search__kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  pointer-events: none;
}

.search input:focus ~ .search__kbd {
  display: none;
}

/* Sağ Menü */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s ease;
}

.nav__btn:hover {
  background: var(--surface-hover);
}

.nav__btn b {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.nav__btn--fav svg {
  color: var(--text-secondary);
}

.nav__btn--fav[aria-pressed="true"] {
  background: rgba(229, 9, 20, 0.18);
  color: #fff;
}

.nav__btn--fav[aria-pressed="true"] svg {
  color: var(--accent);
}

.nav__btn--fav[aria-pressed="true"] b {
  background: var(--accent);
  color: #fff;
}

/* ---------------- KAYNAK SEKMELERİ (SOURCE TABS) ---------------- */

.source-bar {
  background: #141414;
  border-top: 1px solid #1f1f1f;
}

.source-bar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.source-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 0;
}

.source-tabs::-webkit-scrollbar {
  display: none;
}

.source-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.source-tab:hover {
  background: var(--surface-2);
  color: #fff;
}

.source-tab.is-active {
  background: #fff;
  color: #0f0f0f;
  font-weight: 600;
}

.source-tab__badge {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-weight: 500;
}

.source-tab.is-active .source-tab__badge {
  background: rgba(0, 0, 0, 0.12);
  color: #222;
}

/* ---------------- SİNEMA OYNATICI (THEATER PLAYER) ---------------- */

.theater {
  margin-bottom: 24px;
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.theater__container {
  max-width: 1120px;
  margin: 0 auto;
}

.theater.is-wide .theater__container {
  max-width: 100%;
}

.theater__stage {
  background: #000;
  width: 100%;
}

.theater__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 74vh;
  background: #000;
  display: grid;
  place-items: center;
}

.theater__loading {
  color: var(--text-secondary);
  font-size: 13.5px;
}

.theater__video video,
.theater__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.theater__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.theater__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.theater__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.theater__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.quality-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.quality-group:empty {
  display: none;
}

.q-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.q-btn:hover {
  color: #fff;
}

.q-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.theater__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
}

.theater__tags:empty {
  display: none;
}

.tag {
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-secondary);
  transition: background 0.12s ease, color 0.12s ease;
}

.tag:hover {
  background: var(--surface-hover);
  color: #fff;
}

.theater__related {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.related__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related__item img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: #1f1f1f;
}

.related__item span {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related__item:hover span {
  color: #fff;
}

/* ---------------- KATEGORİ & SIRALAMA BAR ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.chips-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
}

.chips-nav {
  flex: 0 0 auto;
  width: 28px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.chips-nav:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
  color: #fff;
}

.chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px 0;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.chip:hover {
  background: var(--surface-2);
  border-color: var(--border-light);
  color: #fff;
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.toolbar__count {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-group {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.sort-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.12s ease, color 0.12s ease;
}

.sort-btn:hover {
  color: #fff;
}

.sort-btn.is-active {
  background: var(--surface-hover);
  color: #fff;
  font-weight: 600;
}

/* ---------------- VİDEO GRİD & KARTLAR ---------------- */

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
}

.card__thumb img,
.card__thumb video.card__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__thumb img {
  transition: transform 0.25s ease;
}

.card:hover .card__thumb img {
  transform: scale(1.02);
}

.card__thumb video.card__preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
}

.badge {
  position: absolute;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.badge--dur {
  right: 6px;
  bottom: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
}

.badge--hd {
  left: 6px;
  bottom: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
}

.badge--hd.is-4k {
  background: var(--accent);
  color: #fff;
}

.card__fav {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  color: #ccc;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.card:hover .card__fav,
.card__fav.is-on {
  opacity: 1;
}

.card__fav:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
}

.card__fav.is-on {
  background: var(--accent);
  color: #fff;
}

.card__body {
  padding: 9px 2px 0;
}

.card__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card:hover .card__title {
  color: #fff;
}

.card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.card__channel {
  color: var(--text-secondary);
  font-weight: 500;
}

.card__rate {
  color: #4ade80;
  font-weight: 500;
}

.dot {
  color: var(--text-muted);
}

/* ---------------- BOŞ DURUM ---------------- */

.empty {
  text-align: center;
  padding: 60px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.empty h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.empty p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* Yükleme İskeleti */
.sk {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sk::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: linear-gradient(90deg, #181818 25%, #242424 50%, #181818 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.sk::after {
  content: "";
  display: block;
  height: 16px;
  width: 75%;
  border-radius: 4px;
  background: #1c1c1c;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ---------------- FOOTER ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: #0a0a0a;
  margin-top: 48px;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer__brand p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 480px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer__links a {
  font-size: 13px;
  color: var(--text-secondary);
}

.site-footer__links a:hover {
  color: #fff;
}

.site-footer__bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px 20px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.credit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.credit-link b {
  color: var(--accent);
  font-weight: 700;
}

.credit-link:hover {
  border-color: var(--accent);
  background: rgba(229, 9, 20, 0.1);
  color: #fff;
}

.site-footer__bottom kbd {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ---------------- TOAST ---------------- */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 250;
  transform: translateY(10px);
  padding: 10px 16px;
  border-radius: 6px;
  background: #242424;
  border: 1px solid #383838;
  font-size: 13px;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------- MOBİL UYUM ---------------- */

@media (max-width: 960px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar__right {
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .wrap {
    padding: 12px 12px 48px;
  }
  .site-header__inner {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }
  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .nav {
    margin-left: auto;
  }
  .nav__btn span {
    display: none;
  }
  .source-bar__inner {
    padding: 0 12px;
  }
  .chips-nav {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 16px 10px;
  }
  .card__title {
    font-size: 13px;
  }
  .theater__bar {
    flex-direction: column;
    padding: 12px 14px;
  }
  .theater__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (hover: none) {
  .card__fav {
    opacity: 1;
  }
}
