:root {
  --bg-color: #030712;
  --card-bg: #0b1329;
  --border-blue: #1e3a8a;
  --accent-blue: #1d4ed8;
  --dark-yellow: #eab308;
  --nav-red: #ef4444;
  --nav-green: #22c55e;
  --nav-yellow: #eab308;
  --text-white: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Padauk', Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-white);
  padding-bottom: 90px;
  user-select: none;
  -webkit-user-select: none;
}

/* Inverted Custom Scroll Indicator */
#scrollTrack {
  position: fixed;
  top: 0;
  right: 2px;
  width: 5px;
  height: 100vh;
  z-index: 99;
  pointer-events: none;
}

#scrollThumb {
  position: absolute;
  width: 100%;
  height: 40px;
  background: var(--accent-blue);
  border-radius: 3px;
  top: 100%;
  transform: translateY(-100%);
}

/* Header & Dynamic Island */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #080e1e;
  border-bottom: 1px solid var(--border-blue);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-title {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}
.site-title span { color: var(--accent-blue); }

.dynamic-island {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #000;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #1e293b;
  font-size: 12px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px;
}

/* Search Box */
.search-box {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border-blue);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 14px;
}

.search-box button {
  background: var(--accent-blue);
  border: none;
  padding: 0 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.search-box button svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* Ads Placement */
.ads-banner {
  width: 100%;
  min-height: 70px;
  background: #080e1e;
  border: 1px dashed var(--border-blue);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Dropdown Menu & Filters */
.dropdown-btn {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-blue);
  color: var(--text-white);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 8px;
}

.category-group {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.category-group.show {
  display: grid;
}

.cat-btn {
  padding: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-blue);
  color: var(--text-white);
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.cat-btn.active {
  background: var(--dark-yellow);
  color: #000;
  border-color: var(--dark-yellow);
}

/* Video Grid List */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.video-card {
  background: var(--card-bg);
  border: 1px solid var(--border-blue);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.thumbnail-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Shimmer Loading */
.shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #0b1329 25%, #152244 50%, #0b1329 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

.video-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discussion-text {
  color: var(--dark-yellow);
  font-size: 13px;
  font-weight: bold;
  line-height: 1.3;
}

.meta-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 4px;
}

.views-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.views-box svg {
  width: 12px;
  height: 12px;
  fill: var(--text-muted);
}

.watermark {
  font-size: 11px;
  font-weight: bold;
  color: var(--accent-blue);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 24px 0;
}

.page-box {
  background: var(--accent-blue);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #2563eb;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  min-width: 32px;
  text-align: center;
}

.page-box.info {
  background: #0f172a;
  border-color: var(--border-blue);
  cursor: default;
}

.page-box.active {
  background: var(--dark-yellow);
  color: #000;
  border-color: var(--dark-yellow);
}

/* ================= WATCH SCREEN & PLAYER ================= */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-blue);
  color: var(--text-white);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 12px;
  font-weight: bold;
}
.back-btn svg { width: 16px; height: 16px; fill: #fff; }

.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-blue);
}

.video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-player video.zoomed {
  object-fit: cover;
}

/* Frosted Motion Glass Buffering */
.buffering-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.buffering-overlay.active {
  display: flex;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--dark-yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Controls Layer */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(3, 7, 18, 0.95);
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

/* Touch-optimized Seek Bar */
.progress-area {
  width: 100%;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  touch-action: none;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 3px;
  position: relative;
  pointer-events: none;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--dark-yellow);
  border-radius: 3px;
}

.progress-indicator {
  position: absolute;
  right: -6px;
  top: -3px;
  width: 12px;
  height: 12px;
  background: var(--dark-yellow);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,0.8);
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.left-controls, .right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: #fff;
  touch-action: manipulation;
}

.btn-ctrl svg {
  width: 22px;
  height: 22px;
  fill: #f8fafc;
  pointer-events: none;
}

.vol-slider {
  width: 50px;
  height: 3px;
  accent-color: var(--dark-yellow);
}

.time-display {
  font-size: 12px;
  font-weight: bold;
}

.settings-wrapper {
  position: relative;
}

.quality-menu {
  display: none;
  position: absolute;
  bottom: 30px;
  right: 0;
  background: #0f172a;
  border: 1px solid var(--border-blue);
  border-radius: 4px;
  min-width: 80px;
  z-index: 60;
}

.quality-menu.show {
  display: block;
}

.quality-item {
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.quality-item.active {
  background: var(--dark-yellow);
  color: #000;
  font-weight: bold;
}

.watch-info {
  margin: 12px 0 20px;
}

.watch-info h2 {
  font-size: 16px;
  color: var(--dark-yellow);
  margin-bottom: 6px;
}

.related-section h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

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

.related-card {
  background: var(--card-bg);
  border: 1px solid var(--border-blue);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.related-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card p {
  padding: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

/* Floating Bottom Navigation */
.bottom-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #080e1e;
  border-top: 1px solid var(--border-blue);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 8px;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-home { color: var(--nav-red); }
.nav-home svg { fill: var(--nav-red); }

.nav-ads { color: var(--nav-green); }
.nav-ads svg { fill: var(--nav-green); }

.nav-cat { color: var(--nav-yellow); }
.nav-cat svg { fill: var(--nav-yellow); }

footer {
  text-align: center;
  margin-top: 30px;
  padding: 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid #111827;
}
