/* ==========================================
   YOUTUBE TUTORIAL SHOWCASE - STYLESHEET
   ==========================================
   
   HOW TO CUSTOMIZE COLORS:
   - Change the cyan accent: search for #00e5ff and replace with your color
   - Change the amber "next" button: search for #f59e0b
   - Dark mode colors are in :root
   - Light mode colors are in .light-mode
   ========================================== */

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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #000000;
  --bg-card: #121212;
  --bg-secondary: #1a1a1a;
  --text: #ffffff;
  --text-muted: #999999;
  --border: #262626;
  --accent: #00e5ff;
  --amber: #f59e0b;
}

/* Light mode overrides */
.light-mode {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-secondary: #f0f0f0;
  --text: #141414;
  --text-muted: #666666;
  --border: #e0e0e0;
  --accent: #00a5b8;
  --amber: #d97706;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ==========================================
   HEADER
   ========================================== */
.header {
  width: 100%;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 12px;
}

/* --- LOGO ---
   Place your logo.png inside hostinger-node/public/ and it will show here.
   The <img> tag uses onerror to silently hide itself if the file is missing. */
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}

.header-logo-img {
  width: 240px;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}

/* ==========================================
   AGE VERIFICATION GATE
   ========================================== */
#age-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.age-gate-box {
  background: #111114;
  border: 1px solid #222;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: 44px 36px 36px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.age-gate-icon {
  font-size: 48px;
  margin-bottom: 18px;
  line-height: 1;
}

.age-gate-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 14px;
  font-family: 'Inter', sans-serif;
}

.age-gate-text {
  font-size: 15px;
  color: #a0a0a0;
  line-height: 1.6;
  margin: 0 0 32px;
  font-family: 'Inter', sans-serif;
}

.age-gate-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.age-btn-enter {
  padding: 14px 24px;
  background: #00e5ff;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.age-btn-enter:hover {
  background: #33eaff;
  transform: translateY(-1px);
}

.age-btn-exit {
  padding: 13px 24px;
  background: transparent;
  color: #666;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.age-btn-exit:hover {
  border-color: #444;
  color: #999;
}

/* Search bar */
.search-wrapper {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 60;
  overflow: hidden;
  padding: 4px 0;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: background-color 0.15s;
}

.search-suggestion-item:hover {
  background-color: var(--bg-secondary);
}

.suggestion-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.suggestion-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
}

.suggestion-badge-category {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
}

.suggestion-badge-video {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.suggestion-badge-keyword {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.search-input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 38px 8px 38px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: 'Inter', sans-serif;
  direction: ltr;
  text-align: left;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

/* Search icon — left side (decorative) */
.search-icon-left {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  z-index: 1;
}

.search-wrapper:focus-within .search-icon-left {
  color: var(--accent);
}

/* Clear button — right side */
.search-clear-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  border-radius: 0 6px 6px 0;
  transition: color 0.15s, background 0.15s;
}

.search-clear-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.light-mode .search-clear-btn:hover {
  background: rgba(0,0,0,0.05);
}

.search-submit-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
  border-radius: 0 6px 6px 0;
}

.search-submit-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.light-mode .search-submit-btn:hover {
  background: rgba(0,0,0,0.05);
}

.search-wrapper--mobile .search-clear-btn {
  right: 40px;
}

/* Active search indicator strip under filter bar */
.search-active-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.search-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}

.search-active-chip button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.search-active-chip button:hover {
  opacity: 1;
}

/* Legacy .search-btn kept for backward compat but hidden */
.search-btn {
  display: none;
}

/* ==========================================
   SKELETON LOADING CARDS
   ========================================== */
@keyframes skeleton-pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}

.skeleton-card {
  display: block;
}

.skeleton-thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 2px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line {
  background: var(--bg-secondary);
  border-radius: 3px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line-title {
  height: 13px;
  margin-top: 10px;
  width: 90%;
  animation-delay: 0.1s;
}

.skeleton-line-title-short {
  height: 13px;
  margin-top: 5px;
  width: 65%;
  animation-delay: 0.15s;
}

.skeleton-line-meta {
  height: 11px;
  margin-top: 8px;
  width: 50%;
  animation-delay: 0.2s;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  background-color: var(--bg-secondary);
}

/* Mobile search */
.mobile-search {
  display: none;
  padding: 0 16px 12px;
}

.mobile-search.active {
  display: block;
}

.mobile-search .search-wrapper {
  max-width: 100%;
}

/* ==========================================
   MOBILE SEARCH FULL-SCREEN OVERLAY
   ========================================== */
.mso {
  display: none;
}

@media (max-width: 767px) {
  .mso {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.mso-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  position: relative;
}

.mso-icon-left {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.mso-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  font-family: 'Inter', sans-serif;
  direction: ltr;
  text-align: left;
  -webkit-appearance: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.mso-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.12);
}

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

.mso-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s;
}

.mso-close-btn:hover {
  color: var(--text);
}

.mso-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Mobile suggestions list ── */
.mso-suggestions {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.mso-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}

.mso-suggestion-item:last-child {
  border-bottom: none;
}

.mso-suggestion-item:hover,
.mso-suggestion-item:active {
  background: var(--bg-secondary);
}

.mso-suggestion-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.mso-suggestion-icon svg {
  width: 15px;
  height: 15px;
}

.mso-suggestion-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mso-suggestion-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.mso-badge-category { background: rgba(0,229,255,0.15); color: var(--accent); }
.mso-badge-video    { background: rgba(255,77,77,0.12);  color: #ff4d4d; }
.mso-badge-keyword  { background: rgba(160,160,160,0.15); color: var(--text-muted); }

.mso-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 16px 10px;
  text-transform: uppercase;
}

.mso-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 20px;
}

.mso-cat-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mso-cat-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.mso-footer {
  padding: 8px 16px 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.mso-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 32px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.mso-action-btn:hover {
  background: var(--bg-tertiary, var(--bg-secondary));
  border-color: var(--text-muted);
}

/* ==========================================
   CATEGORIES BAR
   ========================================== */
.categories-bar {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background-color: var(--bg);
}

.light-mode .categories-bar {
  border-bottom-color: var(--border);
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s;
}

.dropdown-btn:hover {
  color: var(--text);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  min-width: 180px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background-color 0.15s;
}

.dropdown-item:hover {
  background-color: var(--bg-secondary);
}

.dropdown-item.active {
  color: var(--accent);
}

/* ==========================================
   CONTENT WRAPPER (left/right margins)
   ========================================== */
.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 40px 40px;
  /* Reserve enough vertical space so the footer never jumps up during page changes */
  min-height: 70vh;
}

@media (max-width: 1024px) { .content-wrapper { padding: 20px 24px 32px; } }
@media (max-width: 768px)  { .content-wrapper { padding: 16px 16px 24px; } }

/* ==========================================
   BREADCRUMB
   ========================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-home {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s;
}

.breadcrumb-home:hover { opacity: 0.75; }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.breadcrumb-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s;
}
.breadcrumb-link:hover { opacity: 0.75; }

/* ==========================================
   HOME VIEW — CATEGORY CARDS
   ========================================== */
.home-heading-row {
  margin-bottom: 28px;
}

.home-heading {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.home-subheading {
  font-size: 14px;
  color: var(--text-muted);
}

.cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) { .cat-cards-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (max-width: 700px)  { .cat-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 400px)  { .cat-cards-grid { grid-template-columns: 1fr; } }

.cat-card {
  display: block;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.22s, box-shadow 0.22s;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

.cat-card:hover .cat-card-thumb img {
  transform: scale(1.05);
}

.cat-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.cat-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
  display: block;
}

.cat-card-thumb.no-thumb {
  background: var(--bg-secondary);
}

.cat-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cat-card:hover .cat-card-overlay {
  background: rgba(0,0,0,0.35);
}

.cat-card-play {
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s, transform 0.2s;
}

.cat-card:hover .cat-card-play {
  opacity: 1;
  transform: scale(1);
}

.cat-card-info {
  padding: 14px 8px 8px;
  text-align: center;
}

.cat-card-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  transition: color 0.2s;
}

.cat-card:hover .cat-card-name {
  color: var(--accent);
}

.cat-card-channel {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cat-card-count {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 3px 10px;
  border-radius: 10px;
}

/* Sub-topics badge on thumbnail */
.cat-card-sub-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.75);
  color: var(--accent);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

/* ==========================================
   MORE CATEGORIES CARD (16th card on home)
   ========================================== */
.more-cat-card {
  cursor: pointer;
}
.more-cat-thumb {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,229,255,0.07) 0%, rgba(0,229,255,0.03) 100%) !important;
  border: 2px dashed rgba(0,229,255,0.3) !important;
  color: var(--accent);
  transition: border-color 0.2s, background 0.2s;
}
.more-cat-card:hover .more-cat-thumb {
  border-color: var(--accent) !important;
  background: rgba(0,229,255,0.13) !important;
}
.more-cat-card .cat-card-channel {
  color: var(--accent);
  opacity: 0.85;
}
.more-cat-card .cat-card-count {
  color: var(--accent);
}

/* ==========================================
   SUBCATEGORY PAGE HEADER
   ========================================== */
.subcat-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.subcat-page-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.subcat-page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.subcat-page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================
   CATEGORY DROPDOWN (pure black)
   ========================================== */
.cat-dd-wrapper {
  position: relative;
}

.cat-dd-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.cat-dd-btn:hover,
.cat-dd-btn.open {
  background: var(--border);
  border-color: var(--accent);
}

.cat-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  z-index: 1000;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cat-dd-menu::-webkit-scrollbar { width: 5px; }
.cat-dd-menu::-webkit-scrollbar-track { background: transparent; }
.cat-dd-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.cat-dd-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cat-dd-item:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.cat-dd-item.active {
  color: var(--accent);
  font-weight: 600;
}

.cat-dd-more-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 10px;
}

.cat-dd-more-link {
  color: var(--accent) !important;
  font-weight: 600;
  text-decoration: none;
  display: block;
}

.cat-dd-more-link:hover {
  background: var(--bg-secondary);
  color: var(--accent) !important;
  opacity: 0.85;
}


.cat-dd-subitem {
  padding-left: 28px;
}

.cat-dd-divider {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 16px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ==========================================
   MAIN CONTENT (legacy class kept)
   ========================================== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.date-filter,
.date-filter-wrapper,
.duration-filter-wrapper {
  position: relative;
  display: inline-block;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
}

.filter-btn:hover {
  background: var(--border);
}

.duration-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  margin-top: 0;
  width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 1000;
  padding: 6px 0;
}

.duration-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  font-size: 13px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.duration-option:hover {
  background: var(--border);
}

.radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
}

.radio-dot.active {
  border-color: var(--accent);
  background: var(--accent);
}

.section-heading {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* ==========================================
   VIDEO GRID
   ========================================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.video-card {
  display: block;
}

.video-card:hover .thumb-img {
  transform: scale(1.02);
}

.video-card:hover .video-title {
  color: var(--accent);
}

.thumb-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  /* Pulse while image is in flight */
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

/* Stop pulse once image is confirmed loaded or confirmed failed */
.thumb-wrapper.loaded {
  animation: none;
}

.video-card:hover .thumb-wrapper {
  border-color: var(--accent);
}

.duration-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 2px;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
  /* Hidden until browser confirms it loaded — prevents broken-image icon flash */
  visibility: hidden;
  color: transparent; /* suppress alt text on broken images */
}

/* Reveal the image once it finishes loading */
.thumb-img.loaded {
  visibility: visible;
}

.video-title {
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  padding: 0 2px;
  line-height: 1.4;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.no-results-icon {
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 16px;
}

.no-results-icon svg {
  width: 48px;
  height: 48px;
}

.no-results-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.no-results-text {
  font-size: 14px;
  color: var(--text-muted);
}

.no-results-reset {
  margin-top: 20px;
  padding: 9px 24px;
  background: var(--accent);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-family: 'Inter', sans-serif;
}

.no-results-reset:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 0 2px;
}

.video-category {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.video-channel {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}


/* ==========================================
   PAGINATION — unified tab-style
   ========================================== */
.pag-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-bottom: 40px;
  position: relative;
  z-index: 10;
}

.pag-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

/* Every button — prev, page numbers, next — is the same size */
.pag-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.pag-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--accent);
}

.pag-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  cursor: default;
}

.pag-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

/* "..." gap indicator */
.pag-ellipsis {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}

/* Page info text under the bar */
.pag-info {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Mobile: slightly smaller buttons to prevent overflow */
@media (max-width: 480px) {
  .pag-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 13px;
    border-radius: 5px;
  }
  .pag-ellipsis {
    width: 28px;
    height: 36px;
  }
  .pag-bar {
    gap: 5px;
  }
}

/* ==========================================
   RELATED CATEGORIES
   ========================================== */
.related-section {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
  padding-bottom: 24px;
}

.related-heading {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.related-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-btn {
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.related-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text);
}

.related-btn.active {
  background-color: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 48px 24px;
  text-align: center;
}

/* ── Footer row: secondary logo far-left, main content centered, spacer balances right ── */
.footer-main {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
}

.footer-secondary-logo {
  width: 80px;
  height: auto;
  flex-shrink: 0;
  opacity: 0.85;
  display: block;
  transition: opacity 0.2s;
}

.footer-secondary-logo:hover {
  opacity: 1;
}

/* Invisible spacer — mirrors secondary-logo width to keep center-group truly centered */
.footer-spacer {
  width: 80px;
  flex-shrink: 0;
}

/* Main logo + links stacked and centered */
.footer-center-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-logo-small {
  display: block;
  line-height: 0;
}

.footer-logo-img {
  width: 180px;
  height: auto;
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-logo-small:hover .footer-logo-img {
  opacity: 1;
}

.footer-links-block {
  text-align: center;
}

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: center;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 52px;
}

.footer-link {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.2s;
}

.footer-copy {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
  letter-spacing: 0.01em;
}

.footer-link:hover {
  color: var(--text);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .search-wrapper {
    display: none;
  }
  .mobile-search-btn {
    display: flex;
  }
  .main {
    padding-bottom: 80px;
  }
  .mobile-search .search-input {
    font-size: 16px !important;
    direction: ltr !important;
    text-align: left !important;
    padding-right: 82px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    caret-color: var(--text);
    unicode-bidi: plaintext;
    -webkit-rtl-ordering: logical;
  }
}

@media (max-width: 480px) {
  .header-logo-img {
    width: 160px;
  }
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .video-meta {
    gap: 4px;
  }
  .video-category,
  .video-channel {
    font-size: 11px;
  }
  .page-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .footer-links {
    gap: 8px 32px;
  }
}

/* Footer: collapse to centered column on mobile, hide secondary logo */
@media (max-width: 600px) {
  .footer-main {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  .footer-secondary-logo,
  .footer-spacer {
    display: none;
  }
  .footer-logo-img {
    width: 130px;
  }
}

/* Hide mobile search button on desktop */
@media (min-width: 769px) {
  .mobile-search-btn {
    display: none !important;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}
.light-mode ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}
