/* =====================================================
   CREATORZ TOOLS HUB — Frontend Styles
   Google Fonts: Syne (display) + DM Sans (body)
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── RESET & CUSTOM PROPS ─────────────────────────── */
.cth-hub, .cth-hub * { box-sizing: border-box; }

.cth-hub {
  --cth-bg:       #060912;
  --cth-surface:  #0d1117;
  --cth-border:   rgba(255,255,255,0.07);
  --cth-text:     #e2e8f0;
  --cth-muted:    #8892a4;
  --cth-radius:   20px;
  --cth-font-d:   'Syne', sans-serif;
  --cth-font-b:   'DM Sans', sans-serif;

  font-family:    var(--cth-font-b);
  color:          var(--cth-text);
  background:     var(--cth-bg);
  padding:        72px 24px 80px;
  position:       relative;
  overflow:       hidden;
  min-height:     480px;
}

/* ── ANIMATED BACKGROUND MESH ─────────────────────── */
.cth-hub::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%, rgba(99,102,241,.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 75%, rgba(20,184,166,.08) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(139,92,246,.05) 0%, transparent 70%);
  animation: cthBgPulse 10s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
@keyframes cthBgPulse {
  0%   { opacity: .7; }
  100% { opacity: 1.3; }
}

.cth-hub::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.cth-hub > * { position: relative; z-index: 1; }

/* ── HEADER ────────────────────────────────────────── */
.cth-hub-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             24px;
  margin-bottom:   48px;
}

.cth-hub-title {
  font-family: var(--cth-font-d);
  font-size:   clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin:      0;
  background:  linear-gradient(135deg, #fff 30%, rgba(255,255,255,.55));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cth-hub-subtitle {
  font-size:  1rem;
  color:      var(--cth-muted);
  margin:     8px 0 0;
  font-weight: 400;
  letter-spacing: .01em;
}

/* ── SEARCH ─────────────────────────────────────────── */
.cth-search-wrap {
  position:    relative;
  flex-shrink: 0;
}
.cth-search-icon {
  position:  absolute;
  left:      14px;
  top:       50%;
  transform: translateY(-50%);
  width:     18px;
  height:    18px;
  color:     var(--cth-muted);
  pointer-events: none;
}
.cth-search-input {
  background:  rgba(255,255,255,.04);
  border:      1px solid var(--cth-border);
  border-radius: 50px;
  padding:     10px 20px 10px 44px;
  color:       var(--cth-text);
  font-size:   .9rem;
  font-family: var(--cth-font-b);
  outline:     none;
  width:       260px;
  transition:  border-color .2s, background .2s, box-shadow .2s;
}
.cth-search-input::placeholder { color: var(--cth-muted); }
.cth-search-input:focus {
  border-color: rgba(99,102,241,.6);
  background:   rgba(99,102,241,.06);
  box-shadow:   0 0 0 3px rgba(99,102,241,.12);
}

/* ── CATEGORY PILLS ──────────────────────────────── */
.cth-cats {
  display:     flex;
  flex-wrap:   wrap;
  gap:         10px;
  margin-bottom: 36px;
}
.cth-cat {
  background:    rgba(255,255,255,.04);
  border:        1px solid var(--cth-border);
  border-radius: 50px;
  color:         var(--cth-muted);
  font-family:   var(--cth-font-b);
  font-size:     .85rem;
  font-weight:   500;
  padding:       7px 16px;
  cursor:        pointer;
  transition:    all .2s ease;
  display:       flex;
  align-items:   center;
  gap:           6px;
}
.cth-cat:hover {
  background:   rgba(255,255,255,.08);
  color:        var(--cth-text);
  border-color: rgba(255,255,255,.2);
}
.cth-cat.active {
  background:   linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color:        #fff;
  box-shadow:   0 4px 16px rgba(99,102,241,.35);
}
.cth-cat-count {
  background:  rgba(255,255,255,.18);
  border-radius: 50px;
  padding:     1px 7px;
  font-size:   .75rem;
}

/* ── GRID ─────────────────────────────────────────── */
.cth-grid {
  display:               grid;
  grid-template-columns: repeat(2, 1fr);
  gap:                   20px;
  transition:            opacity .3s ease;
}
@media (min-width: 600px) {
  .cth-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .cth-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}
@media (min-width: 1200px) {
  .cth-grid { grid-template-columns: repeat(4, 1fr); gap: 28px; }
}

/* ── CARD ─────────────────────────────────────────── */
.cth-card {
  position:         relative;
  background:       rgba(13,17,34,.88);
  backdrop-filter:  blur(24px);
  border:           1px solid var(--cth-border);
  border-radius:    var(--cth-radius);
  padding:          28px 22px 22px;
  display:          flex;
  flex-direction:   column;
  gap:              0;
  cursor:           pointer;
  overflow:         hidden;
  transition:       transform .4s cubic-bezier(.175,.885,.32,1.275),
                    box-shadow .4s ease,
                    border-color .3s ease;
  animation:        cthCardIn .5s ease both;
}

.cth-card:nth-child(1)  { animation-delay: .05s; }
.cth-card:nth-child(2)  { animation-delay: .10s; }
.cth-card:nth-child(3)  { animation-delay: .15s; }
.cth-card:nth-child(4)  { animation-delay: .20s; }
.cth-card:nth-child(5)  { animation-delay: .25s; }
.cth-card:nth-child(6)  { animation-delay: .30s; }
.cth-card:nth-child(7)  { animation-delay: .35s; }
.cth-card:nth-child(8)  { animation-delay: .40s; }

@keyframes cthCardIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* Gradient border via pseudo-element */
.cth-card::before {
  content:    '';
  position:   absolute;
  inset:      0;
  border-radius: var(--cth-radius);
  padding:    1px;
  background: linear-gradient(135deg, var(--cs, #6366f1), var(--ce, #8b5cf6));
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  mask:         linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite:         exclude;
  opacity:    0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.cth-card:hover::before { opacity: 1; }

/* Shine overlay */
.cth-card-shine {
  position:   absolute;
  inset:      0;
  border-radius: var(--cth-radius);
  background: linear-gradient(135deg, rgba(255,255,255,.06) 0%, transparent 60%);
  opacity:    0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.cth-card:hover .cth-card-shine { opacity: 1; }

/* Bottom glow */
.cth-card:hover {
  transform:    translateY(-8px);
  box-shadow:   0 20px 50px rgba(0,0,0,.5),
                0 0 60px color-mix(in srgb, var(--cs, #6366f1) 20%, transparent);
  border-color: transparent;
}

/* ── CARD TOP (icon + badge) ─────────────────────── */
.cth-card-top {
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
  margin-bottom:   20px;
}

.cth-icon {
  width:         58px;
  height:        58px;
  border-radius: 16px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  padding:       10px;
  flex-shrink:   0;
  transition:    transform .4s cubic-bezier(.175,.885,.32,1.275), box-shadow .3s ease;
  box-shadow:    0 8px 24px rgba(0,0,0,.3);
}
.cth-card:hover .cth-icon {
  transform:  scale(1.08) rotate(-3deg);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.cth-icon svg {
  width:  100%;
  height: 100%;
}

@media (max-width: 480px) {
  .cth-icon { width: 48px; height: 48px; padding: 8px; border-radius: 12px; }
}

.cth-badge {
  font-size:     .7rem;
  font-weight:   600;
  font-family:   var(--cth-font-d);
  letter-spacing: .04em;
  border:        1px solid;
  border-radius: 50px;
  padding:       3px 10px;
  white-space:   nowrap;
  line-height:   1;
  align-self:    flex-start;
}

/* ── CARD BODY ───────────────────────────────────── */
.cth-card-body { flex: 1; margin-bottom: 20px; }

.cth-tool-name {
  font-family: var(--cth-font-d);
  font-size:   1.1rem;
  font-weight: 700;
  margin:      0 0 4px;
  color:       var(--cth-text);
  line-height: 1.2;
}
@media (max-width: 480px) {
  .cth-tool-name { font-size: 1rem; }
}

.cth-tool-tagline {
  font-size:   .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin:      0 0 10px;
  opacity:     .85;
}

.cth-tool-desc {
  font-size:   .84rem;
  line-height: 1.55;
  color:       var(--cth-muted);
  margin:      0;
  display:     -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:    hidden;
}

/* ── LAUNCH BUTTON ───────────────────────────────── */
.cth-launch {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  border-radius:   12px;
  padding:         11px 18px;
  color:           #fff;
  font-family:     var(--cth-font-b);
  font-size:       .88rem;
  font-weight:     600;
  text-decoration: none;
  transition:      filter .25s ease, transform .25s ease, box-shadow .25s ease;
  position:        relative;
  overflow:        hidden;
}
.cth-launch::after {
  content:    '';
  position:   absolute;
  inset:      0;
  background: rgba(255,255,255,0);
  transition: background .2s ease;
}
.cth-launch:hover {
  filter:     brightness(1.12);
  transform:  translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
  color:      #fff;
  text-decoration: none;
}
.cth-launch svg {
  width:      16px;
  height:     16px;
  flex-shrink: 0;
  transition: transform .25s ease;
}
.cth-launch:hover svg { transform: translateX(3px); }

/* ── PAGINATION ──────────────────────────────────── */
.cth-pag {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             16px;
  margin-top:      52px;
}
.cth-pag-arrow {
  display:     flex;
  align-items: center;
  gap:         6px;
  background:  rgba(255,255,255,.05);
  border:      1px solid var(--cth-border);
  border-radius: 50px;
  color:       var(--cth-muted);
  font-family: var(--cth-font-b);
  font-size:   .88rem;
  font-weight: 500;
  padding:     9px 18px;
  cursor:      pointer;
  transition:  all .2s ease;
}
.cth-pag-arrow:hover:not(:disabled) {
  background:   rgba(255,255,255,.1);
  color:        var(--cth-text);
  border-color: rgba(255,255,255,.2);
}
.cth-pag-arrow:disabled {
  opacity:    .3;
  cursor:     not-allowed;
}
.cth-pag-arrow svg { width: 18px; height: 18px; }
.cth-dots { display: flex; gap: 8px; align-items: center; }
.cth-dot {
  width:         10px;
  height:        10px;
  border-radius: 50px;
  background:    rgba(255,255,255,.2);
  border:        none;
  cursor:        pointer;
  padding:       0;
  transition:    all .25s ease;
}
.cth-dot.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  width:      28px;
  box-shadow: 0 0 12px rgba(99,102,241,.5);
}
.cth-dot:hover:not(.active) { background: rgba(255,255,255,.4); }

/* ── NO RESULTS ──────────────────────────────────── */
.cth-no-results {
  text-align:  center;
  color:       var(--cth-muted);
  padding:     60px 20px;
  font-size:   1rem;
}

/* ── HIDDEN (for filter/pagination) ─────────────── */
.cth-card.cth-hidden { display: none !important; }
.cth-grid.cth-fading { opacity: .4; }

/* ── LIGHT THEME OVERRIDE (optional) ────────────── */
.cth-hub.cth-light {
  --cth-bg:      #f8fafc;
  --cth-surface: #ffffff;
  --cth-border:  rgba(0,0,0,.07);
  --cth-text:    #1e293b;
  --cth-muted:   #64748b;
}
.cth-hub.cth-light::before { opacity: .35; }
.cth-hub.cth-light::after  { background-image: radial-gradient(circle, rgba(0,0,0,.04) 1px, transparent 1px); }
.cth-hub.cth-light .cth-card {
  background:   rgba(255,255,255,.9);
  border-color: rgba(0,0,0,.08);
}
.cth-hub.cth-light .cth-card:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,.15), 0 0 60px color-mix(in srgb, var(--cs, #6366f1) 15%, transparent);
}
.cth-hub.cth-light .cth-hub-title {
  background:              linear-gradient(135deg, #1e293b, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip:         text;
}
