/* Universal box-sizing and overflow prevention */
* {
  box-sizing: border-box;
}

html, body {
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Force all elements to respect viewport width */
* {
  max-width: 100vw;
}

/* Navigation Styles */

/* Basic body and responsive styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: black;
  color: white;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
}

body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

html::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

.top-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-image:
    url('data:image/svg+xml;utf8,<svg width="48" height="60" viewBox="0 0 48 60" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity="0.22"><path d="M24 15 Q20 5 12 9 Q8 11 12 15 Q8 19 12 21 Q20 25 24 15 Q28 25 36 21 Q40 19 36 15 Q40 11 36 9 Q28 5 24 15 Z" fill="black"/><circle cx="24" cy="15" r="2" fill="black"/><path d="M24 45 Q20 35 12 39 Q8 41 12 45 Q8 49 12 51 Q20 55 24 45 Q28 55 36 51 Q40 49 36 45 Q40 41 36 39 Q28 35 24 45 Z" fill="black"/><circle cx="24" cy="45" r="2" fill="black"/></g></svg>'),
    url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity="0.18"><path d="M0 0L16 16M16 0L0 16" stroke="%23444" stroke-width="1.2"/></g></svg>'),
    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 48px 60px, 8px 8px, 100% 100%;
  background-repeat: repeat-x, repeat, no-repeat;
  background-blend-mode: overlay, overlay, normal;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border-radius: 0;
  margin: 0;
}

/* 3-Section Navigation Layout */
.nav-section {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 1;
  width: 33.333%;
}

/* Old rules - commented out, replaced by icon-section */
/*
.left-section {
  justify-content: center;
}

.right-section {
  justify-content: center;
}
*/

.center-section {
  justify-content: center;
  max-width: 33.333%;
  flex: 1 1 33.333%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Search Header Styles */
.search-header {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.search-title {
  font-family: 'Long Cang', 'Noto Serif SC', serif;
  font-size: 2.5rem;
  margin: 0;
  background: linear-gradient(45deg, #a8325a, #c44569, #ff6b9d, #b3124b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
  text-shadow: 0 2px 8px #a8325a88, 2px 2px 4px rgba(0,0,0,0.18);
  letter-spacing: 2px;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.search-subtitle {
  font-family: 'Noto Serif SC', serif;
  font-size: 0.6em;
  margin: 0;
  font-weight: 400;
  letter-spacing: 1px;
  color: #c0c0c0;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: none;
  border: none;
  border-radius: 7px;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  cursor: pointer;
  font-size: 4.2em;
  margin: 0;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
}

.top-nav-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: #fff;
}

/* Inner icons (category and list) - perfectly centered and sized */
.top-nav-icon[href="main.html"],
.top-nav-icon[href="index.html"] {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

.top-nav-icon[href="main.html"] svg,
.top-nav-icon[href="index.html"] svg {
  width: 44px;
  height: 44px;
  display: block;
}

@media (max-width: 768px) {
  .top-nav-bar {
    height: 48px;
  }
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .top-nav-bar {
    height: 40px;
  }
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 28px;
    height: 28px;
  }
}

.top-nav-icon:hover, .top-nav-icon:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #ff8c42;
  box-shadow: 0 2px 8px rgba(255,140,66,0.08);
  text-decoration: none;
}

/* Search Content Wrapper */
.search-content-wrapper {
  margin-top: 120px;
  padding: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Results Styles */
.search-results-container {
  max-width: 600px;
  margin: 10px auto 40px auto;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.search-result-card {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.7);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 12px 16px;
  gap: 18px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.search-result-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  background: #222;
  flex-shrink: 0;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result-title {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.2em;
  font-weight: 300;
  color: #fff;
  margin: 0;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(168,50,90,0.10), 0 1px 2px rgba(0,0,0,0.12);
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.search-result-time {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.98em;
  color: #ff8c42;
  margin: 0;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(255,140,66,0.10);
  font-weight: 300;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.search-results-title, h2 {
  font-family: 'Pacifico', 'Montserrat', 'Quicksand', 'Segoe UI', Arial, cursive, sans-serif;
  font-size: 1.6em;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 12px #a8325a22, 0 1px 4px rgba(0,0,0,0.18);
  margin-top: 36px;
  margin-bottom: 18px;
  text-align: center;
  line-height: 1.5;
}

/* Responsive adjustments for the 3-section navigation */
@media (max-width: 768px) {
  .top-nav-bar {
    padding: 0 10px;
  }
  
  .search-title {
    font-size: 1.8rem;
  }
  
  .search-subtitle {
    font-size: 0.5em;
  }
  
  .nav-section {
    width: 33.333%;
  }
  
  .top-nav-icon {
    font-size: 3.5em;
    padding: 6px;
    min-width: 40px;
    min-height: 40px;
  }
  
  .top-nav-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
  }
  
  /* Inner icons - larger */
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    /* Perfect vertical centering: nav bar is 60px, icon is 96px, so we need -18px margin to center */
    margin-top: -18px;
    margin-bottom: -18px;
  }
  
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 52px;
    height: 52px;
  }
  
  .search-content-wrapper {
    padding: 15px;
    margin-top: 110px;
  }
  
  .search-results-container {
    padding: 0 8px;
  }
}

@media (max-width: 480px) {
  .top-nav-bar {
    padding: 0 8px;
    height: 55px;
  }
  
  .search-title {
    font-size: 1.4rem;
  }
  
  .search-subtitle {
    font-size: 0.4em;
  }
  
  .top-nav-icon {
    padding: 5px;
    min-width: 36px;
    min-height: 36px;
    font-size: 5em;
  }
  
  .top-nav-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
  }
  
  /* Inner icons - larger */
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 90px;
    height: 90px;
    min-width: 90px;
    min-height: 90px;
    /* Perfect vertical centering: nav bar is 55px, icon is 90px, so we need -17.5px margin to center */
    margin-top: -17.5px;
    margin-bottom: -17.5px;
  }
  
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 48px;
    height: 48px;
  }
  
  .nav-section {
    width: 33.333%;
  }
  
  .search-content-wrapper {
    padding: 10px;
    margin-top: 1%;
  }
  
  .search-results-container {
    padding: 0 5px;
    gap: 12px;
  }
  
  .search-result-card {
    padding: 10px 12px;
    gap: 12px;
  }
  
  .search-result-img {
    width: 70px;
    height: 70px;
  }
  
  .search-result-title {
    font-size: 1.1em;
  }
  
  .search-result-time {
    font-size: 0.9em;
  }
  
  .search-results-title, h2 {
    font-size: 1.4em;
    margin-top: 24px;
    margin-bottom: 12px;
  }
  
  .nav-section.tab-navigation {
    height: 32px !important;
    top: 55px !important;
  }
  
  /* Mobile-specific floating search styles */
  body #floating-search-container {
    padding: 0 8px;
    max-width: 100vw;
  }
  
  #floating-search-input {
    max-width: calc(100vw - 80px);
    min-width: 150px;
    font-size: 1em;
    padding: 0 16px;
  }
  
  #magnifier-btn {
    width: 44px;
    height: 44px;
    margin-left: 6px;
    margin-right: 6px;
  }
}

/* Navigation Section for Tabs (used in main.html) */
.nav-section.tab-navigation {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-image:
    url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity="0.18"><path d="M0 0L16 16M16 0L0 16" stroke="%23444" stroke-width="1.2"/></g></svg>'),
    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 8px 8px, 100% 100%;
  background-repeat: repeat, no-repeat;
  background-blend-mode: overlay;
  padding: 0;
  display: flex;
  align-items: center;
  height: 38px;
  font-family: inherit;
  font-size: 1.1em;
  position: fixed;
  top: 60px; /* Updated to account for new header height */
  left: 0;
  width: 100vw;
  z-index: 1000;
  user-select: none;
  box-sizing: border-box;
  border-radius: 0;
  margin: 0;
}

.nav-arrow {
  color: #aaa;
  font-size: 2.2em;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 50%;
  margin: 0 4px;
}

.nav-arrow:active {
  color: #fff;
}

.nav-arrow[disabled] {
  color: #333;
  pointer-events: none;
}

.nav-arrow.hidden {
  display: none;
}

.nav-tabs-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  height: 100%;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  scroll-behavior: smooth;
}

.nav-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.nav-tabs-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  min-width: max-content;
}

.nav-tab {
  color: #ccc;
  font-family: 'Noto Serif SC', 'Kaiti', 'STKaiti', 'KaiTi', '楷体', cursive;
  font-weight: 300;
  font-size: 1em;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.10);
  padding: 0 18px;
  cursor: pointer;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  min-width: 72px;
  justify-content: center;
  white-space: nowrap;
}

.nav-tab.active {
  color: #fff;
  font-weight: 400;
  font-family: 'Noto Serif SC', 'Kaiti', 'STKaiti', 'KaiTi', '楷体', cursive;
  text-shadow: 0 2px 8px #a8325a33, 0 1px 4px rgba(0,0,0,0.18);
}

body #floating-search-container {
  z-index: 9999 !important;
  position: fixed !important;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  overflow: hidden;
}

#floating-search-input {
  display: none;
  margin-left: 8px;
  z-index: 10000 !important;
  position: relative !important;
  height: 48px;
  font-size: 1.2em;
  font-family: 'Quicksand', 'Montserrat', 'Segoe UI', 'Nunito', Arial, sans-serif;
  border-radius: 24px;
  border: 1.5px solid #ff8c42;
  background: #222233;
  color: #fff;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(196,69,105,0.10);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  max-width: calc(100vw - 120px);
  min-width: 200px;
  box-sizing: border-box;
}
#floating-search-input:focus {
  border: 2px solid #ff5e62;
  box-shadow: 0 4px 16px rgba(255,94,98,0.18);
}
#floating-search-container.active #floating-search-input {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative;
  z-index: 100000;
}
#floating-search-input::placeholder {
  color: #888fa6;
  opacity: 1;
  font-style: italic;
  font-family: 'Segoe UI', 'Nunito', 'Quicksand', 'Montserrat', 'Arial Rounded MT Bold', Arial, sans-serif;
  letter-spacing: 0.04em;
}
#magnifier-btn {
  pointer-events: auto;
  background: linear-gradient(135deg, #667eea 0%, #c44569 100%);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
  margin-left: 8px;
  margin-right: 8px;
  z-index: 10001;
}
#magnifier-btn:hover {
  background: linear-gradient(135deg, #c44569 0%, #667eea 100%);
  box-shadow: 0 4px 16px rgba(196,69,105,0.18);
}
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 0 8px;
  display: inline-block;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  grid-template-rows: repeat(6, auto);
  width: 100%;
  max-width: 98vw;
  min-width: 0;
  margin: 40px auto 0 auto;
  padding: 0 2vw;
  gap: 2px 80px;
  box-sizing: border-box;
  margin-bottom: 0 !important;
  min-height: fit-content;
}

#videoCardsContainer {
  min-height: fit-content;
  width: 100%;
}

.video-cell {
  background: rgba(34, 34, 56, 0.92);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.10), 0 1.5px 6px rgba(196,69,105,0.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 10px 10px 10px;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s, background 0.18s;
  position: relative;
  min-height: 120px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.video-cell:hover, .video-cell:focus {
  background: linear-gradient(135deg, #667eea 0%, #c44569 100%);
  box-shadow: 0 4px 24px rgba(196,69,105,0.18), 0 2px 8px rgba(102,126,234,0.12);
  transform: translateY(-2px) scale(1.03);
}
.video-thumb-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
  box-sizing: border-box;
}
.video-thumb {
  width: 100%;
  max-width: 260px;
  min-width: 140px;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  margin: 0 auto;
  border-radius: 10px;
  background: #222;
  box-shadow: 0 1.5px 8px rgba(168,50,90,0.10);
  transition: box-shadow 0.18s;
  overflow: hidden;
  box-sizing: border-box;
}
.video-cell:hover .video-thumb {
  box-shadow: 0 4px 16px #ff8c4280, 0 2px 8px #a8325a33;
}
.video-name {
  font-family: 'Segoe UI', 'Montserrat', 'Quicksand', Arial, sans-serif;
  font-size: 1.08em;
  color: #fff;
  text-align: center;
  margin-top: 2px;
  margin-bottom: 0;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-shadow: 0 1.5px 6px #a8325a22, 0 1px 2px rgba(0,0,0,0.12);
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  line-height: 1.2;
}
.no-results {
  color: #ff8c42;
  text-align: center;
  font-size: 1.2em;
  margin: 60px 0 40px 0;
  letter-spacing: 0.04em;
}
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  margin-bottom: 18px;
  min-height: 36px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow: hidden;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(34,34,56,0.85);
  border-radius: 10px;
  padding: 8px 18px;
  box-shadow: 0 1.5px 8px rgba(168,50,90,0.10);
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.pag-num {
  color: #fff;
  font-size: 1.08em;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  margin: 0 2px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  outline: none;
  font-weight: 400;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pag-num.active, .pag-num:hover {
  background: linear-gradient(135deg, #667eea 0%, #c44569 100%);
  color: #fff;
}
.pag-num.disabled {
  color: #666;
  cursor: default;
  opacity: 0.6;
}
.pag-num.disabled:hover {
  background: none;
  color: #666;
}
.pag-arrow {
  color: #ff8c42;
  font-size: 1.2em;
  padding: 0 10px;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  border-radius: 50%;
  background: none;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pag-arrow:hover {
  color: #fff;
  background: #ff8c42;
}
@media (max-width: 700px) {
  .video-grid {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 36px auto 12px auto !important;
    padding: 0 1vw;
    box-sizing: border-box;
  }
  .video-thumb {
    max-width: 180px;
    min-width: 100px;
  }
  .pagination-container {
    max-width: 100vw !important;
    overflow: hidden;
    padding: 0 2vw;
  }
  .pagination {
    padding: 6px 12px;
    gap: 6px;
    max-width: 100% !important;
    justify-content: center;
    flex-wrap: wrap;
    overflow: hidden;
  }
  .pag-num {
    font-size: 1em;
    padding: 3px 8px;
    margin: 0 1px;
    max-width: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 480px) {
  .video-grid {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 3px auto 12px auto !important;
    padding: 0 !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px 2px !important;
    box-sizing: border-box;
  }
  .video-cell, .video-thumb-wrapper {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .video-thumb {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  .pagination-container {
    max-width: 100vw !important;
    overflow: hidden;
    padding: 0 1vw;
  }
  .pagination {
    padding: 6px 8px;
    gap: 4px;
    max-width: 100% !important;
    justify-content: center;
    flex-wrap: wrap;
    overflow: hidden;
  }
  .pag-num {
    font-size: 0.9em;
    padding: 2px 6px;
    margin: 0 1px;
    max-width: 35px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pag-arrow {
    font-size: 1.1em;
    padding: 0 8px;
  }
}

.empty-cell {
  background: transparent !important;
  box-shadow: none !important;
  cursor: default !important;
  pointer-events: none;
}

html, body {
  overflow-x: hidden;
}

.pagination-multiline {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  gap: 0;
}
.pagination-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  margin: 2px 0;
  gap: 6px;
}
.pagination-row::-webkit-scrollbar {
  display: none;
}

@media (max-width: 700px) {
  .pagination-multiline {
    width: 100vw;
    max-width: 100vw;
    padding: 0 2vw;
    box-sizing: border-box;
  }
  .pagination-row {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    margin: 2px 0;
  }
  .pag-num {
    min-width: 28px;
    font-size: 1em;
    padding: 3px 6px;
  }
  .pag-arrow {
    font-size: 1.1em;
    padding: 0 8px;
  }
}
@media (max-width: 480px) {
  .pagination-multiline {
    width: 100vw;
    max-width: 100vw;
    padding: 0 1vw;
  }
  .pagination-row {
    gap: 2px;
  }
  .pag-num {
    min-width: 24px;
    font-size: 0.95em;
    padding: 2px 4px;
  }
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 18px;
  color: #888;
  font-family: 'Noto Serif SC', serif;
  margin-top: 120px;
  text-align: center;
  padding: 20px;
}

/* Ensure the first video card is not covered by the fixed nav */
.video-grid .video-cell:first-child {
  margin-top: 0px;
}

body.index main {
  padding-top: 20% !important;
  margin-top: 0 !important;
  padding-bottom: 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
} 

/* Icon sections - equal width and perfect centering */
.nav-section.icon-section,
.top-nav-bar .nav-section.icon-section {
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.nav-section.center-section,
.top-nav-bar .nav-section.center-section {
  flex: 0 1 auto !important;
  text-align: center !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure all icons are perfectly centered within their sections */
.nav-section.icon-section .top-nav-icon,
.top-nav-bar .nav-section.icon-section .top-nav-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Override any specific icon rules to ensure perfect centering */
.nav-section.icon-section .top-nav-icon[href="index.html"],
.nav-section.icon-section .top-nav-icon[href="main.html"],
.top-nav-bar .nav-section.icon-section .top-nav-icon[href="index.html"],
.top-nav-bar .nav-section.icon-section .top-nav-icon[href="main.html"] {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ensure the icon content is centered */
.nav-section.icon-section .top-nav-icon .material-icons,
.top-nav-bar .nav-section.icon-section .top-nav-icon .material-icons {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Force the navigation bar to distribute space evenly */
.top-nav-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 60px !important;
  padding: 0 !important;
  gap: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Ensure each section maintains its intended width */
.top-nav-bar .nav-section.icon-section {
  flex: 0 0 60px !important;
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.top-nav-bar .nav-section.center-section {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
}

/* Responsive adjustments for icon sections */
@media (max-width: 768px) {
  .nav-section.icon-section,
  .top-nav-bar .nav-section.icon-section {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    flex: 0 0 50px !important;
  }
  
  .top-nav-bar .nav-section.icon-section {
    flex: 0 0 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
  }
}

@media (max-width: 480px) {
  .nav-section.icon-section,
  .top-nav-bar .nav-section.icon-section {
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    flex: 0 0 45px !important;
  }
  
  .top-nav-bar .nav-section.icon-section {
    flex: 0 0 45px !important;
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
  }
} 