/* ==========================================================================
   DESHI VIDEO — Video Sharing Website
   Design tokens: deep-night backdrop with a marigold/vermillion cinema accent,
   a nod to Indian single-screen theatre marquees.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
  /* Color tokens */
  --bg:          #0F0F17;
  --surface:     #191925;
  --surface-2:   #22222F;
  --border:      #2E2E3F;
  --text:        #F5F3EF;
  --text-muted:  #9B98A8;
  --primary:     #FFB627;   /* marigold */
  --primary-ink: #241A03;
  --accent:      #E94F37;   /* vermillion */
  --success:     #3DBE7C;

  /* Type */
  --font-display: 'Baloo 2', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 68px;
  --max-w: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

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

/* ---------- Sprocket strip (signature motif) ----------
   A repeating perforation pattern echoing a film reel, used as a thin
   divider under the header/marquee and as a card-hover accent. */
.sprocket-strip {
  height: 10px;
  background-image: radial-gradient(circle, var(--bg) 2.5px, transparent 2.6px);
  background-size: 18px 10px;
  background-position: center;
  background-color: var(--primary);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-row {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--primary);
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .brand-mark { border-radius: 9px; flex-shrink: 0; }
.brand .brand-text { color: var(--text); }
.brand .brand-text b { color: var(--primary); font-weight: 800; }
.brand span.dot { color: var(--accent); }
@media (max-width: 520px) { .brand .brand-text { font-size: 22px; } .brand .brand-mark { width: 30px; height: 30px; } }

.search-form {
  flex: 1;
  max-width: 560px;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 18px;
  font-size: 14px;
}
.search-form input:focus { outline: none; }
.search-form button {
  border: none;
  background: var(--primary);
  color: var(--primary-ink);
  padding: 0 20px;
  font-weight: 600;
  font-size: 14px;
}

.header-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.btn-admin-link {
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.btn-admin-link:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- Marquee (trending ticker) ---------- */
.marquee-wrap {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  padding: 8px 0;
  animation: scroll-left 28s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.marquee-track span { margin-right: 48px; }
.marquee-track b { color: var(--primary); }
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- Category nav ---------- */
.cat-nav {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  overflow-x: auto;
}
.cat-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.cat-pill:hover, .cat-pill.active {
  color: var(--primary-ink);
  background: var(--primary);
  border-color: var(--primary);
}

/* ---------- Section heading ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 6px;
  height: 22px;
  background: var(--accent);
  border-radius: 3px;
  display: inline-block;
}

/* ---------- Video grid & card ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  padding-bottom: 24px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}
.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.thumb-wrap .sprocket-strip { position: absolute; bottom: 0; left: 0; right: 0; opacity: 0; transition: opacity 0.15s ease; }
.video-card:hover .thumb-wrap .sprocket-strip { opacity: 1; }

.play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,15,23,0.0);
  transition: background 0.15s ease;
}
.video-card:hover .play-badge { background: rgba(15,15,23,0.25); }
.play-badge svg { width: 44px; height: 44px; opacity: 0; transition: opacity 0.15s ease; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.video-card:hover .play-badge svg { opacity: 1; }

.card-body { padding: 12px 14px 16px; }
.card-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  gap: 10px;
}
.card-cat {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state h3 { font-family: var(--font-display); color: var(--text); font-size: 20px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 30px 0 50px; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* ---------- Watch page ---------- */
.watch-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 28px;
  padding: 28px 0 50px;
  align-items: start;
}
@media (max-width: 900px) {
  .watch-layout { grid-template-columns: 1fr; }
}

.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.player-wrap video { width: 100%; max-height: 560px; display: block; background: #000; }

.watch-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 18px 0 6px;
}

.watch-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.watch-stats {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 13.5px;
  display: flex;
  gap: 16px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
}
.like-btn svg { width: 18px; height: 18px; }
.like-btn:hover { border-color: var(--accent); }
.like-btn.liked { background: var(--accent); border-color: var(--accent); color: #fff; }
.like-btn:disabled { opacity: 0.6; cursor: default; }

.video-desc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 14px;
  color: var(--text-muted);
  white-space: pre-line;
}
.video-desc .tags { margin-top: 12px; }
.tag-chip {
  display: inline-block;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 4px 6px 0 0;
}

.related-title {
  font-family: var(--font-display);
  font-size: 17px;
  margin-bottom: 14px;
}
.related-card { display: flex; gap: 10px; margin-bottom: 14px; }
.related-card .thumb-wrap { width: 150px; flex-shrink: 0; border-radius: var(--radius-sm); }
.related-card .card-body { padding: 0; }
.related-card .card-title { font-size: 13.5px; }
.related-card .card-meta { font-size: 11.5px; }

/* ---------- Forms (search results header, breadcrumbs) ---------- */
.page-heading {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 28px 0 6px;
}
.page-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.site-footer a { color: var(--primary); }

/* ---------- Responsive header ---------- */
@media (max-width: 700px) {
  .header-row { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
  .search-form { order: 3; max-width: 100%; width: 100%; }
  .header-actions { margin-left: 0; }
}


/* ---------- Ad slots ---------- */
.ad-slot { position: relative; margin: 16px auto; text-align: center; max-width: 100%; overflow: hidden; }
.ad-slot .ad-label { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .45; margin-bottom: 4px; }
.ad-slot img, .ad-slot iframe, .ad-slot ins { max-width: 100%; }
.ad-slot.ad-empty { border: 1px dashed rgba(128,128,128,.55); border-radius: 10px; padding: 22px 12px; font-size: 12px; opacity: .6; }
.ad-fullwidth { margin: 0 auto; padding: 6px 12px; }
.grid-ad { grid-column: 1 / -1; }
.grid-ad .ad-slot { margin: 4px auto; }
.sticky-ad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; background: rgba(0,0,0,.85); padding: 6px 30px 6px 6px; }
.sticky-ad .ad-slot { margin: 0 auto; }
.sticky-ad .ad-slot.ad-empty { padding: 10px; }
.sticky-close { position: absolute; top: 2px; right: 6px; background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }


/* ---------- Hover video preview ---------- */
.thumb-wrap { position: relative; overflow: hidden; }
.thumb-wrap .preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .25s ease; pointer-events: none; z-index: 1; }
.previewing .preview-video { opacity: 1; }
.previewing .play-badge, .preview-loading .play-badge { opacity: 0; }
.previewing .thumb-wrap .sprocket-strip { z-index: 2; }
.preview-loading .thumb-wrap::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transform-origin: left; animation: pvLoad 1.1s ease-in-out infinite; z-index: 3; }
@keyframes pvLoad { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }


/* ---------- Ad device targeting ---------- */
.ad-dev-mobile { display: none; }
@media (max-width: 768px) {
  .ad-dev-desktop { display: none; }
  .ad-dev-mobile { display: block; }
}
.ad-slot iframe { margin: 0 auto; display: block; }


/* ---------- Header page links ---------- */
.header-row { flex-wrap: wrap; }
.top-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.top-links a { padding: 7px 11px; border-radius: 99px; font-size: 13.5px; color: var(--text-muted); transition: color .15s, background .15s; }
.top-links a:hover { color: var(--text); background: var(--surface-2); }
.top-links a.active { color: var(--primary-ink); background: var(--primary); font-weight: 600; }
.menu-toggle { display: none; margin-left: auto; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; line-height: 0; }
@media (max-width: 1080px) {
  .menu-toggle { display: inline-flex; }
  .top-links { display: none; width: 100%; flex-wrap: wrap; margin: 0; padding: 4px 0 10px; order: 10; }
  .top-links.open { display: flex; }
  .top-links a { background: var(--surface-2); }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 32px 0 0; border-top: 1px solid var(--border); background: var(--surface); text-align: left; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding-bottom: 24px; }
.footer-about p { color: var(--text-muted); font-size: 14px; margin: 10px 0 0; max-width: 320px; }
.footer-links h4 { margin: 0 0 10px; font-family: var(--font-display); font-size: 15px; color: var(--primary); }
.footer-links a { display: block; padding: 4px 0; font-size: 14px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 14px; padding-bottom: 18px; font-size: 13px; color: var(--text-muted); text-align: center; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- Static pages ---------- */
.static-page { max-width: 820px; margin: 28px auto 8px; }
.static-page h1 { font-family: var(--font-display); font-size: 34px; margin: 0 0 4px; }
.static-updated { color: var(--text-muted); font-size: 13.5px; margin: 0 0 22px; }
.prose { line-height: 1.7; color: #DDD9E3; }
.prose h2 { font-family: var(--font-display); font-size: 21px; color: var(--text); margin: 28px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose a, .static-page a { color: var(--primary); }
.prose a:hover { text-decoration: underline; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: 13px; }
.static-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.static-table th, .static-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.static-table th { color: var(--text-muted); font-weight: 600; }

/* ---------- Contact form ---------- */
.contact-form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.contact-form label { display: grid; gap: 6px; font-size: 13.5px; color: var(--text-muted); }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; font: inherit; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary); }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .cf-row { grid-template-columns: 1fr; } }
.cf-btn { justify-self: start; background: var(--primary); color: var(--primary-ink); border: 0; border-radius: 99px; padding: 11px 26px; font-weight: 700; font-size: 15px; }
.cf-btn:hover { filter: brightness(1.08); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14.5px; }
.notice-ok { background: rgba(61,190,124,.12); border: 1px solid rgba(61,190,124,.45); }
.notice-err { background: rgba(233,79,55,.12); border: 1px solid rgba(233,79,55,.45); }

/* ---------- Mobile header layout fix ---------- */
@media (max-width: 1080px) {
  .header-row { gap: 10px 12px; padding-top: 10px; padding-bottom: 10px; }
  .header-row .brand { order: 1; }
  .header-row .menu-toggle { order: 2; margin-left: auto; }
  .header-row .search-form { order: 3; flex: 1 1 100%; max-width: 100%; margin: 0; }
  .header-row .top-links { order: 4; }
}
@media (max-width: 1080px) { .header-row { padding-left: 16px; padding-right: 16px; } }
