/* =====================================================
   VideoHub — Premium Dark UI
   Design tokens
   ===================================================== */
:root {
  --bg: #0d0d0d;
  --bg-elevated: #131313;
  --card: #171717;
  --card-hover: #1e1e1e;
  --border: #262626;
  --accent: #ff2d75;
  --accent-soft: rgba(255, 45, 117, 0.14);
  --accent-glow: rgba(255, 45, 117, 0.35);
  --text: #f3f3f3;
  --text-dim: #a3a3a3;
  --text-faint: #6b6b6b;
  --success: #2dd4a7;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 10px 26px -10px var(--accent-glow);
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display-font {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

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

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

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.container-xl { max-width: 1360px; }

/* =====================================================
   Header
   ===================================================== */
.vh-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13, 13, 13, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

.vh-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}
.vh-logo .dot { color: var(--accent); }

.vh-search {
  position: relative;
  flex: 1;
  max-width: 480px;
}
.vh-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1rem 0.6rem 2.6rem;
  font-size: 0.92rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.vh-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card-hover);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.vh-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
}
.vh-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1200;
  display: none;
}
.vh-search-results.show { display: block; animation: fadeIn 0.18s ease; }
.vh-search-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.vh-search-item:last-child { border-bottom: none; }
.vh-search-item:hover { background: var(--card-hover); }
.vh-search-item img { width: 72px; height: 44px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.vh-search-item .t { font-size: 0.85rem; font-weight: 600; }
.vh-search-item .c { font-size: 0.72rem; color: var(--text-faint); }
.vh-search-empty { padding: 1rem; color: var(--text-faint); font-size: 0.85rem; text-align: center; }

.vh-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.25s ease;
}
.vh-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Category nav strip */
.vh-cat-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.7rem 0;
  scrollbar-width: none;
}
.vh-cat-strip::-webkit-scrollbar { display: none; }
.vh-cat-pill {
  white-space: nowrap;
  padding: 0.42rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.vh-cat-pill i { font-size: 0.9rem; }
.vh-cat-pill:hover { color: var(--text); border-color: #3a3a3a; transform: translateY(-1px); }
.vh-cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

/* =====================================================
   Hero Banner
   ===================================================== */
.vh-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #1a0d13 0%, #0d0d0d 60%);
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}
.vh-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  filter: saturate(1.1);
}
.vh-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 30%, var(--accent-glow), transparent 55%),
              linear-gradient(180deg, transparent 0%, var(--bg) 100%);
}
.vh-hero-content { position: relative; z-index: 2; padding: 3rem; max-width: 640px; }
.vh-hero .eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.vh-hero .eyebrow .pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2s infinite;
}
.vh-hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; margin: 0.6rem 0; }
.vh-hero p { color: var(--text-dim); font-size: 1.02rem; margin-bottom: 1.4rem; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 10px rgba(255,45,117,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,45,117,0); }
}

/* =====================================================
   Buttons
   ===================================================== */
.btn-vh {
  border-radius: var(--radius-pill);
  padding: 0.62rem 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-vh-play {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-vh-play:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 30px -10px var(--accent-glow); color: #fff; }
.btn-vh-download {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-vh-download:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-vh-ghost {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 0.62rem 1.6rem;
  font-weight: 700;
  transition: all 0.25s ease;
}
.btn-vh-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.vh-more-videos-wrap {
  text-align: center;
  margin: 2.5rem 0 3rem;
  padding: 0 0.5rem;
}
.vh-more-videos-btn {
  width: 100%;
  max-width: 480px;
  justify-content: center;
  padding: 0.95rem 2rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

/* =====================================================
   Section headers
   ===================================================== */
.vh-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2.4rem 0 1.1rem;
}
.vh-section-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.vh-section-head h2 i { color: var(--accent); }
.vh-section-head a { color: var(--text-faint); font-size: 0.85rem; font-weight: 600; }
.vh-section-head a:hover { color: var(--accent); }

/* =====================================================
   Video Card
   ===================================================== */
.vh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.4rem;
}

.vh-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), border-color 0.3s, box-shadow 0.35s;
  opacity: 0;
  transform: translateY(16px);
  animation: cardIn 0.5s ease forwards;
}
@keyframes cardIn { to { opacity: 1; transform: translateY(0); } }

.vh-card:hover {
  transform: translateY(-6px);
  border-color: #333;
  box-shadow: var(--shadow-card);
}

.vh-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #0a0a0a;
}
.vh-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.4s ease;
  opacity: 0;
}
.vh-thumb-wrap img.loaded { opacity: 1; }
.vh-card:hover .vh-thumb-wrap img { transform: scale(1.08); }

.vh-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0,0,0,0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}
.vh-cat-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.vh-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.vh-card:hover .vh-play-overlay { opacity: 1; }
.vh-play-overlay i {
  width: 54px; height: 54px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.3rem;
  box-shadow: 0 0 0 8px rgba(255,45,117,0.18);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}
.vh-card:hover .vh-play-overlay i { transform: scale(1); }

.vh-card-body { padding: 1rem 1.1rem 1.15rem; }
.vh-card-title {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.vh-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 0.55rem;
}
.vh-card-meta .dot::before { content: '•'; margin: 0 2px; }
.vh-card-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.9rem;
  min-height: 2.4em;
}
.vh-card-actions { display: flex; gap: 0.5rem; }
.vh-card-actions .btn-vh { flex: 1; justify-content: center; padding: 0.5rem 0.8rem; font-size: 0.82rem; }

/* =====================================================
   Skeleton loading
   ===================================================== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.vh-skel-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.vh-skel-thumb { aspect-ratio: 16/9; }
.vh-skel-line { height: 12px; border-radius: 6px; margin: 10px 14px; }
.vh-skel-line.w60 { width: 60%; }
.vh-skel-line.w40 { width: 40%; }
.vh-skel-line.w90 { width: 90%; }

.thumb-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-spinner .ring {
  width: 30px; height: 30px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.vh-buffering {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: repeating-linear-gradient(135deg, #131313, #131313 10px, #171717 10px, #171717 20px);
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.25s;
}
.vh-buffering:hover { color: var(--text); }
.vh-buffering .ring {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.vh-buffering span { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.4s ease; }

/* =====================================================
   Single Video page
   ===================================================== */
.vh-player-frame {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  cursor: pointer;
}
.vh-player-frame img { width: 100%; height: 100%; object-fit: cover; }
.vh-player-frame .vh-play-overlay { opacity: 1; background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.55)); }
.vh-player-frame .vh-play-overlay i { width: 78px; height: 78px; font-size: 1.9rem; }

.vh-stat-pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.vh-stat-pill i { color: var(--accent); }

.vh-glass {
  background: rgba(23,23,23,0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.vh-share-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.25s ease;
}
.vh-share-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* =====================================================
   Footer
   ===================================================== */
.vh-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
}
.vh-footer h6 { font-weight: 700; margin-bottom: 1rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.vh-footer a.link { color: var(--text-faint); font-size: 0.88rem; display: block; margin-bottom: 0.55rem; transition: color 0.2s; }
.vh-footer a.link:hover { color: var(--accent); }
.vh-newsletter input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
}
.vh-newsletter input:focus { outline: none; border-color: var(--accent); box-shadow: none; }
.vh-newsletter button {
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 0 1.2rem;
}

/* Back to top */
#backToTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-accent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 999;
  border: none;
}
#backToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { transform: translateY(-4px); }

/* Loader for infinite scroll */
.vh-loader { display: flex; justify-content: center; padding: 2rem 0; }
.vh-loader .spin {
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Empty state */
.vh-empty { text-align: center; padding: 4rem 1rem; color: var(--text-faint); }
.vh-empty i { font-size: 2.6rem; color: var(--accent); margin-bottom: 1rem; display: block; }

/* Responsive */
@media (max-width: 768px) {
  .vh-hero-content { padding: 1.8rem; }
  .vh-search { max-width: none; }
  .vh-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 0.9rem; }
  .vh-card-actions { flex-direction: column; }
}

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
