/* ==========================================================================
   FORBIDDEN NUDE - MODERN PURPLE TOPLIST THEME
   100% Native Vanilla CSS (Zero external Tailwind CDN) | Ultra Fast (<2ms)
   Clean, light, modern purple aesthetic with responsive table & cards
   ========================================================================== */

:root {
  --primary-purple: #9333ea;
  --primary-purple-hover: #7e22ce;
  --primary-purple-light: #f3e8ff;
  --primary-purple-dark: #6b21a8;
  --tag-yellow: #facc15;
  --tag-yellow-text: #854d0e;
  --bg-page: #f3f4f6;
  --bg-card: #ffffff;
  --border-light: #e5e7eb;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* Master Header */
.toplist-header {
  background: #ffffff;
  box-shadow: var(--shadow-md);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-purple);
  margin: 0;
  letter-spacing: -0.5px;
}

.brand-pill {
  background: var(--primary-purple-light);
  color: var(--primary-purple-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid #e9d5ff;
}

.header-search-box {
  width: 100%;
  max-width: 360px;
  position: relative;
}

.search-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  outline: none;
  background: #f9fafb;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary-purple);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* Sub-Header Tabs & Stats Bar */
.sub-header-bar {
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  border-color: #c084fc;
  color: var(--primary-purple);
}

.tab-btn.active {
  background: var(--primary-purple);
  color: #ffffff;
  border-color: var(--primary-purple);
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.3);
}

.stats-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stats-counter strong {
  color: var(--primary-purple-dark);
}

/* Main Content Layout */
.toplist-layout {
  max-width: 1400px;
  margin: 16px auto 40px;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.table-column {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.sidebar-column {
  width: 320px;
  flex-shrink: 0;
}

/* ==========================================================================
   TOPLIST TABLE CARD
   ========================================================================== */
.toplist-table-card {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.toplist-table-card thead th {
  background: var(--primary-purple-light);
  color: var(--primary-purple-dark);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid #e9d5ff;
}

.toplist-table-card tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.15s ease;
  cursor: pointer;
}

.toplist-table-card tbody tr:hover {
  background-color: #faf5ff;
  transform: translateY(-1px);
}

.toplist-table-card tbody tr:last-child {
  border-bottom: none;
}

.toplist-table-card tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}

/* Table Content Details */
.table-thumb-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.table-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-title-text {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  transition: color 0.15s ease;
}

.toplist-table-card tbody tr:hover .site-title-text {
  color: var(--primary-purple);
}

.editor-tag {
  background-color: var(--tag-yellow);
  color: var(--tag-yellow-text);
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.category-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.views-text {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.votes-text {
  font-size: 12px;
  color: var(--text-muted);
}

.visit-btn {
  background: var(--primary-purple);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(147, 51, 234, 0.25);
  transition: all 0.2s ease;
}

.visit-btn:hover {
  background: var(--primary-purple-hover);
  transform: scale(1.04);
}

/* ==========================================================================
   SPONSORED SIDEBAR SECTION
   ========================================================================== */
.sponsored-card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.sponsored-card h3 {
  font-weight: 800;
  color: #4f46e5;
  font-size: 16px;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sponsored-pill {
  font-size: 10px;
  font-weight: 700;
  background: #eef2ff;
  color: #4f46e5;
  padding: 2px 6px;
  border-radius: 4px;
}

.sponsored-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sponsor-box-item {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.sponsor-box-item:hover {
  transform: translateY(-2px);
}

.sponsor-img-wrapper {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: #000;
  border: 1px solid #e5e7eb;
}

.sponsor-img {
  width: 100%;
  display: block;
  border-radius: 8px;
  transition: transform 0.25s ease;
}

.sponsor-box-item:hover .sponsor-img {
  transform: scale(1.02);
}

.sponsor-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  transition: color 0.15s ease;
  line-height: 1.35;
}

.sponsor-box-item:hover .sponsor-label {
  color: #4f46e5;
}

/* Master Footer */
.toplist-footer {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-light);
  background: #ffffff;
  margin-top: 40px;
}

.compliance-box {
  max-width: 800px;
  margin: 0 auto 16px;
  padding: 10px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #6b7280;
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .toplist-layout {
    flex-direction: column;
  }
  .sidebar-column {
    width: 100%;
  }
  .sponsored-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 640px) {
  .toplist-table-card thead th:nth-child(4),
  .toplist-table-card tbody td:nth-child(4),
  .toplist-table-card thead th:nth-child(5),
  .toplist-table-card tbody td:nth-child(5) {
    display: none;
  }
}

/* ==========================================================================
   NEW INTERACTIVE FEATURES (DARK MODE, SORTING, UPVOTES, TOAST, BACK TO TOP)
   ========================================================================== */

/* Dark Mode Palette */
body.dark-mode {
  --bg-page: #0f111a;
  --bg-card: #171b26;
  --border-light: #262c3d;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary-purple-light: #2a1b42;
  --primary-purple-dark: #d8b4fe;
}
body.dark-mode .toplist-header,
body.dark-mode .toplist-table-card,
body.dark-mode .sponsored-card,
body.dark-mode .toplist-footer {
  background: #171b26;
  border-color: #262c3d;
}
body.dark-mode .toplist-table-card thead th {
  background: #231638;
  color: #d8b4fe;
  border-bottom: 2px solid #3b2260;
}
body.dark-mode .toplist-table-card tbody tr {
  border-bottom: 1px solid #202636;
}
body.dark-mode .toplist-table-card tbody tr:hover {
  background-color: #211c33;
}
body.dark-mode .site-title-text {
  color: #f1f5f9;
}
body.dark-mode .views-text {
  color: #e2e8f0;
}
body.dark-mode .compliance-box {
  background: #131722;
  border-color: #262c3d;
  color: #94a3b8;
}
body.dark-mode .search-input {
  background: #131722;
  border-color: #2d354a;
  color: #fff;
}
body.dark-mode .tab-btn {
  background: #171b26;
  color: #cbd5e1;
  border-color: #2d354a;
}
body.dark-mode .sponsor-label {
  color: #e2e8f0;
}
body.dark-mode .sponsor-img-wrapper {
  border-color: #262c3d;
}

/* Sortable Table Headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}
.sortable-th:hover {
  color: var(--primary-purple);
}
.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.6;
}
.sortable-th:hover .sort-icon {
  opacity: 1;
}

/* Upvote Button */
.vote-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.upvote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary-purple-light);
  color: var(--primary-purple);
  border: 1px solid #e9d5ff;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.upvote-btn:hover {
  background: var(--primary-purple);
  color: #ffffff;
  transform: translateY(-2px);
}
.upvote-btn.voted {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--primary-purple-light);
  border: 1px solid #e9d5ff;
  color: var(--primary-purple-dark);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.theme-toggle-btn:hover {
  background: var(--primary-purple);
  color: #ffffff;
}

/* Floating Back to Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-purple);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(147, 51, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 99;
}
.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top-btn:hover {
  transform: translateY(-3px);
  background: var(--primary-purple-hover);
}

/* Toast Popup */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #1e1b4b;
  color: #ffffff;
  border: 1px solid #4338ca;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast-notice.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Row Highlight Pulse for Roulette */
@keyframes rowPulse {
  0% { background-color: #f3e8ff; transform: scale(1.01); }
  50% { background-color: #d8b4fe; transform: scale(1.02); }
  100% { background-color: inherit; transform: scale(1); }
}
.row-highlight {
  animation: rowPulse 1.2s ease;
}