/* TikTok-specific additions (keeps the rest of the UI identical to youtube-tools) */

#tiktokBlueZone{
  /*
    Invisible “color accent” zone used by the constellation background.
    - Bigger than before so the cyan accent is more noticeable.
    - Slowly moves (drifts) so the cyan highlight feels alive.
  */
  position: fixed; /* Match the fixed canvas so the effect stays consistent while scrolling */
  top: 18%;
  right: 10%;

  /* Responsive sizing: scales with viewport but stays within sane limits */
  width: clamp(280px, 30vw, 560px);
  height: clamp(200px, 24vh, 420px);

  opacity: 0;           /* Invisible, used only as a color-zone for the constellation */
  pointer-events: none; /* Never block clicks */
  z-index: 0;

  /* Make movement smooth + cheap for the browser */
  will-change: transform;
  animation: tiktokBlueZoneDrift 14s ease-in-out infinite alternate;
}

@keyframes tiktokBlueZoneDrift{
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-10vw, 8vh); }
  100% { transform: translate(-6vw, -7vh); }
}

/* Ensure canvas sits behind everything */
canvas#constellationCanvas{
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  pointer-events: none; /* Don't make the browser do hit-testing on the canvas */
}

/* --------------------------------------------
   Angel Globe (VANTA) — decorative background

   Requirements:
   - Behind the constellation canvas
   - Bottom-right of the viewport initially
   - NOT fixed (scrolls away when the user scrolls)
   -------------------------------------------- */

#angelGlobe{
  /* Responsive square size */
  --globeSize: clamp(240px, 28vw, 520px);

  position: absolute;
  width: var(--globeSize);
  height: var(--globeSize);

  /* Start in the bottom-right of the visible viewport (but still part of the page flow)
     so it moves up as the user scrolls down. */
  right: 18px;
  top: calc(100vh - var(--globeSize) - 18px);

  /* Must be behind the constellation canvas (which is z-index: -1) */
  z-index: -2;

  /* Pure decoration: don't ever block clicks/scroll */
  pointer-events: none;

  /* Keeps edges from looking harsh on light UI */
  opacity: 0.92;
}

/* Ensure the VANTA canvas stays contained + scales correctly */
#angelGlobe canvas{
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
}

.tiktok-link-icon {
	transition: filter 0.2s ease-in-out;
}

.tiktok-link-icon:hover {
	filter: opacity(0.7);
}

/* ----------------------------
   TikTok page modernization
   ---------------------------- */

/* Hero */
.tt-hero{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.25rem 0 0.75rem;
}

.tt-hero-kicker{
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7280;
  margin-top: 0.5rem;
}

.tt-hero-title{
  margin: 0.2rem 0 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  font-weight: 650;
  color: #111;
  text-align: center !important;
}

.tt-hero-sub{
  font-size: 13px;
  color: #4b5563;
}

.tt-hero-highlight{
  margin-top: 0.5rem;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  background: linear-gradient(90deg, #d11f4b 0%, #2c2c2c 48%, #169c9a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ------------------------------
   Dataset stats (Twitter-style scroller)
   ------------------------------ */

.tt-stats-wrap{
  margin-top: 0.75rem;
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  overflow: visible;
}

.tt-stats{
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 0 0 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.tt-stats::-webkit-scrollbar{
  height: 8px;
}

.tt-stats::-webkit-scrollbar-thumb{
  background: rgba(151, 153, 156, 0.18);
  border-radius: 999px;
}

.tt-stats::-webkit-scrollbar-track{
  background: rgba(128, 129, 133, 0.06);
  border-radius: 999px;
}

.tt-stats-wrap::before,
.tt-stats-wrap::after{
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 140ms ease;
  z-index: 1;
}

.tt-stats-wrap::before{
  left: 0;
  /* Match the page's light background (#f8f9fa) */
  background: linear-gradient(to right, rgba(248, 249, 250, 1), rgba(248, 249, 250, 0));
}

.tt-stats-wrap::after{
  right: 0;
  background: linear-gradient(to left, rgba(248, 249, 250, 1), rgba(248, 249, 250, 0));
}

.tt-stats-wrap.tt-at-start::before{ opacity: 0; }
.tt-stats-wrap.tt-at-end::after{ opacity: 0; }

.tt-stats-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  color: rgba(17, 24, 39, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.tt-stats-nav:hover{
  background: rgba(255, 255, 255, 0.98);
  color: rgba(17, 24, 39, 0.92);
}

.tt-stats-nav:active{
  transform: translateY(-50%) scale(0.98);
}

.tt-stats-nav-left{ left: 8px; }
.tt-stats-nav-right{ right: 8px; }

.tt-stats-wrap.tt-at-start .tt-stats-nav-left,
.tt-stats-wrap.tt-at-end .tt-stats-nav-right{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tt-stat{
  position: relative;
  padding: 0.55rem 0.85rem 0.6rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(209, 31, 75, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  min-width: 137px;
  max-width: 193px;
  flex: 0 0 auto;
  text-align: center;
}

.tt-stat-top{
  position: relative;
  min-height: 1rem;
}

.tt-stat-label{
  font-size: 12px;
  color: #4b5563;
  letter-spacing: 0.02em;
  display: block;
  width: 100%;
  text-align: center;
  padding: 0 0.8rem;
}

.tt-stat-value{
  margin-top: 0.15rem;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Subtle TikTok beacon (pink-red + blue) */
.tt-beacon{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(209, 31, 75, 0.88), rgba(29, 155, 240, 0.78));
  box-shadow: 0 0 0 0 rgba(124, 91, 165, 0.45);
  position: absolute;
  left: 0.1rem;
  top: 0.35rem;
}

@media (max-width: 520px){
  .tt-stat{
    min-width: 165px;
  }
}


/* Search card */
.tt-search-wrap{
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.tt-search-card{
  width: min(780px, 96vw);
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.tt-search-card.tt-invalid .tt-slider{
  border-color: #f26d6d;
  box-shadow: 0 0 0 3px rgba(242,109,109,0.25);
}

.tt-search-card.tt-invalid .tt-slider{
  border-color: #f26d6d;
  box-shadow: 0 0 0 3px rgba(242, 109, 109, 0.22);
}

.tt-search-meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* Terms switch */
.tos-field{
  margin: 0;
  padding: 0;
  gap: 10px;
}

.tt-switch{
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.tt-switch input{
  opacity: 0;
  width: 0;
  height: 0;
}

.tt-slider{
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid #d6d6d6;
  background: #efefef;
  transition: background 160ms ease, border-color 160ms ease;
}

.tt-slider::before{
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.16);
  transition: transform 160ms ease;
}

.tt-switch input:checked + .tt-slider{
  background: #1d9bf0;
  border-color: #1d9bf0;
}

.tt-switch input:checked + .tt-slider::before{
  transform: translate(18px, -50%);
}

.accept-tos{
  margin: 0 !important;
  font-size: 12px;
  color: #374151;
  text-decoration: none;
}

.accept-tos a{
  color: #1d4ed8;
}

.howto-handle{
  margin: 0;
  padding: 0;
}

.howto-handle-text{
  margin-right: 0 !important;
  color: #1d4ed8;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Search input */
/* Match the twitter-tools search bar (same layout, colors, placeholder, etc.) */
.search-container{ justify-content: flex-start; }
/* Small layout polish on narrow screens */
@media (max-width: 520px){
  .tt-search-card{ padding: 12px; }
  .search-input{ padding-right: 102px; }
}