/*
Theme Name: NightTube Pro
Theme URI: https://example.com/nighttube-pro
Author: OpenAI
Author URI: https://openai.com
Description: Dark modern video tube WordPress theme with custom video post type, admin settings, responsive grids, and a creator-style single video layout.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: nighttube-pro
*/

:root {
  --nt-bg: #1a1a1a;
  --nt-bg-2: #222222;
  --nt-card: #2a2a2a;
  --nt-card-2: #303030;
  --nt-accent: #e8003d;
  --nt-accent-hover: #ff4444;
  --nt-text: #ffffff;
  --nt-muted: #aaaaaa;
  --nt-border: #3a3a3a;
  --nt-success: #35d06e;
  --nt-radius: 14px;
  --nt-sidebar: 78px;
  --nt-header: 76px;
  --nt-shadow: 0 16px 40px rgba(0,0,0,.3);
  --nt-transition: .2s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--nt-text);
  background: linear-gradient(180deg, var(--nt-bg), var(--nt-bg-2));
  font-family: 'Inter', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--nt-text); text-decoration: none; transition: color var(--nt-transition), border-color var(--nt-transition), background var(--nt-transition), transform var(--nt-transition), opacity var(--nt-transition), box-shadow var(--nt-transition); }
a:hover { color: var(--nt-accent); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; }
input, textarea, select {
  background: #242424;
  color: var(--nt-text);
  border: 1px solid var(--nt-border);
  border-radius: 999px;
  padding: 12px 14px;
}
textarea { border-radius: 18px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--nt-accent); box-shadow: 0 0 0 3px rgba(232,0,61,.18); }
.screen-reader-text { position: absolute; left: -9999px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #151515; }
::-webkit-scrollbar-thumb { background: #454545; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #5a5a5a; }

.nt-site {
  min-height: 100vh;
}

.nt-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nt-header);
  background: rgba(17,17,17,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nt-border);
}
.nt-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 100%;
  padding: 0 24px 0 26px;
}
.nt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.nt-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--nt-accent), #ff5a70);
  box-shadow: 0 8px 18px rgba(232,0,61,.32);
}
.nt-brand-name {
  font-size: 1.1rem;
  text-transform: uppercase;
}
.nt-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex: 1;
}
.nt-main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nt-main-nav a {
  color: var(--nt-muted);
  font-weight: 600;
  font-size: .95rem;
}
.nt-live-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nt-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--nt-success);
  box-shadow: 0 0 0 0 rgba(53,208,110,.6);
  animation: ntPulse 1.4s infinite;
}
@keyframes ntPulse {
  0% { box-shadow: 0 0 0 0 rgba(53,208,110,.65); }
  70% { box-shadow: 0 0 0 10px rgba(53,208,110,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,208,110,0); }
}
.nt-search-form {
  position: relative;
  width: min(360px, 100%);
}
.nt-search-form input[type="search"] {
  width: 100%;
  padding-right: 44px;
  background: #262626;
}
.nt-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nt-muted);
  pointer-events: none;
}
.nt-button,
button,
input[type="submit"],
.wp-element-button {
  border: 0;
  border-radius: 999px;
  background: var(--nt-accent);
  color: #fff;
  padding: 12px 18px;
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
}
.nt-button:hover,
button:hover,
input[type="submit"]:hover,
.wp-element-button:hover { background: var(--nt-accent-hover); color: #fff; }
.nt-button.is-ghost {
  background: transparent;
  border: 1px solid var(--nt-border);
}
.nt-button.is-ghost:hover {
  border-color: var(--nt-accent);
  color: var(--nt-accent);
}

.nt-layout {
  display: flex;
  min-height: calc(100vh - var(--nt-header));
}
.nt-sidebar {
  position: fixed;
  top: var(--nt-header);
  left: 0;
  width: var(--nt-sidebar);
  height: calc(100vh - var(--nt-header));
  background: #181818;
  border-right: 1px solid var(--nt-border);
  padding: 14px 8px 24px;
  overflow-y: auto;
}
.nt-flag {
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  width: 40px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--nt-border);
  background: #232323;
  font-size: 1.1rem;
}
.nt-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nt-side-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  color: var(--nt-muted);
  text-align: center;
  font-size: .72rem;
}
.nt-side-link svg { width: 18px; height: 18px; }
.nt-side-link:hover,
.nt-side-link.is-active {
  color: #fff;
  background: #242424;
}

.nt-content {
  width: 100%;
  margin-left: var(--nt-sidebar);
  padding: 24px;
}
.nt-shell {
  max-width: 1500px;
  margin: 0 auto;
}
.nt-section { margin-bottom: 34px; }
.nt-section-title {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--nt-accent);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.nt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.nt-card {
  overflow: hidden;
  border-radius: var(--nt-radius);
  background: linear-gradient(180deg, var(--nt-card), var(--nt-card-2));
  border: 1px solid transparent;
  box-shadow: var(--nt-shadow);
  transform: translateZ(0);
}
.nt-card:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--nt-accent);
  box-shadow: 0 18px 50px rgba(232,0,61,.15);
}
.nt-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f0f0f;
}
.nt-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--nt-transition), filter var(--nt-transition); }
.nt-card:hover .nt-thumb img { transform: scale(1.05); filter: brightness(1.12); }
.nt-duration,
.nt-ad-badge {
  position: absolute;
  z-index: 2;
  border-radius: 8px;
  padding: 4px 7px;
  font-size: .7rem;
  font-weight: 700;
}
.nt-duration {
  bottom: 10px;
  right: 10px;
  color: #fff;
  background: rgba(0,0,0,.72);
}
.nt-ad-badge {
  top: 10px;
  left: 10px;
  background: var(--nt-accent);
  color: #fff;
}
.nt-card-body { padding: 12px 12px 14px; }
.nt-card-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: .9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.4em;
}
.nt-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--nt-muted);
  font-size: .8rem;
}
.nt-dot::before {
  content: '•';
  margin-right: 10px;
  color: #6f6f6f;
}

.nt-hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 24px;
  align-items: stretch;
}
.nt-hero-panel,
.nt-feature-panel {
  background: linear-gradient(180deg, #252525, #1d1d1d);
  border: 1px solid var(--nt-border);
  border-radius: 20px;
  box-shadow: var(--nt-shadow);
}
.nt-hero-panel { padding: 28px; }
.nt-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(232,0,61,.14);
  color: #ffd6df;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.nt-hero-title {
  margin: 16px 0 10px;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 1.05;
}
.nt-hero-text { color: var(--nt-muted); max-width: 60ch; }
.nt-hero-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.nt-feature-panel { padding: 18px; display: grid; gap: 12px; }
.nt-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: #282828;
  border: 1px solid #343434;
}
.nt-stat strong { font-size: 1rem; display: block; }
.nt-stat span { color: var(--nt-muted); font-size: .84rem; }

.nt-player-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  gap: 24px;
}
.nt-video-stage,
.nt-related-panel,
.nt-surface {
  background: linear-gradient(180deg, #242424, #1b1b1b);
  border: 1px solid var(--nt-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--nt-shadow);
}
.nt-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0c0c0c;
}
.nt-video-frame iframe,
.nt-video-frame video,
.nt-video-frame .wp-video,
.nt-video-frame .wp-video-shortcode,
.nt-video-frame img { width: 100%; height: 100%; object-fit: cover; }
.nt-play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.34));
}
.nt-play-button {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 0;
  background: var(--nt-accent);
  box-shadow: 0 16px 35px rgba(232,0,61,.35);
}
.nt-play-button::before {
  content: '';
  display: inline-block;
  margin-left: 6px;
  border-style: solid;
  border-width: 16px 0 16px 24px;
  border-color: transparent transparent transparent white;
}
.nt-video-meta {
  padding: 20px 22px 16px;
}
.nt-video-title { margin: 0 0 8px; font-size: clamp(1.4rem, 2vw, 2rem); }
.nt-video-submeta {
  color: var(--nt-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: .86rem;
}
.nt-promo-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 18px 22px 22px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(232,0,61,.12), rgba(255,68,68,.07));
  border: 1px solid rgba(232,0,61,.28);
}
.nt-countdown { color: var(--nt-accent); font-weight: 800; letter-spacing: .05em; }
.nt-related-panel { padding: 16px; }
.nt-related-stack { display: grid; gap: 14px; }
.nt-related-item {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
}
.nt-related-item:hover { background: rgba(255,255,255,.03); }
.nt-related-item .nt-thumb { border-radius: 12px; }

.nt-footer {
  margin-top: 40px;
  padding: 30px 0 80px;
  border-top: 1px solid var(--nt-border);
}
.nt-tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.nt-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #333;
  border: 1px solid #444;
  color: #fff;
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.nt-tag:hover { color: var(--nt-accent); border-color: var(--nt-accent); }

.nt-cookie {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 30px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(20,20,20,.96);
  border: 1px solid var(--nt-border);
  box-shadow: var(--nt-shadow);
}
.nt-cookie p { margin: 0; color: var(--nt-muted); }

.nt-empty,
.no-results,
.not-found {
  padding: 28px;
  background: #242424;
  border: 1px solid var(--nt-border);
  border-radius: 18px;
}
.nt-archive-head { margin-bottom: 18px; }
.nt-archive-head p { color: var(--nt-muted); margin: 8px 0 0; }

.page-content,
.entry-content,
.comment-content { color: #dfdfdf; }
.entry-content a,
.comment-content a { color: #ff6b87; }
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 { color: #fff; }

.nt-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: rgba(18,18,18,.98);
  border-top: 1px solid var(--nt-border);
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.nt-mobile-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--nt-muted);
  font-size: .68rem;
  padding: 6px 4px;
  border-radius: 10px;
}
.nt-mobile-bar a svg { width: 18px; height: 18px; }
.nt-mobile-bar a:hover,
.nt-mobile-bar a.is-active { color: #fff; background: #262626; }

@media (max-width: 1200px) {
  .nt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nt-hero { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .nt-header-inner { gap: 14px; padding-inline: 16px; }
  .nt-search-form { width: min(240px, 100%); }
  .nt-main-nav { gap: 12px; }
  .nt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nt-player-layout { grid-template-columns: 1fr; }
  .nt-content { padding: 18px; }
}
@media (max-width: 760px) {
  :root { --nt-header: 68px; }
  .nt-header-right { gap: 10px; }
  .nt-main-nav { display: none; }
  .nt-sidebar {
    display: none;
  }
  .nt-content {
    margin-left: 0;
    padding: 14px;
  }
  .nt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nt-related-item { grid-template-columns: 110px 1fr; }
  .nt-mobile-bar { display: grid; }
  .nt-footer { padding-bottom: 110px; }
  .nt-cookie { left: 12px; right: 12px; bottom: 82px; max-width: none; }
}
@media (max-width: 560px) {
  .nt-grid { grid-template-columns: 1fr; }
  .nt-search-form { display: none; }
  .nt-brand-name { font-size: .98rem; }
  .nt-related-item { grid-template-columns: 1fr; }
  .nt-promo-strip { flex-direction: column; align-items: flex-start; }
}
