/* ThaiTemplate Showcase home — marketplace layout */
:root {
  --sc-purple: #6d28d9;
  --sc-purple-2: #7c3aed;
  --sc-soft: #efe8ff;
  --sc-gold: #eab308;
  --sc-ink: #1f1830;
  --sc-muted: #6d647a;
  --sc-line: rgba(60, 40, 90, 0.1);
  --sc-radius: 16px;
}

.sc-sidebar {
  display: flex;
  flex-direction: column;
}
.sc-sidebar .dash-logo {
  display: block;
  padding: 0.35rem;
  margin: 0.15rem 0.35rem 0.75rem;
  line-height: 0;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(60, 40, 90, 0.06);
}
.sc-sidebar .dash-logo .brand-logo,
.sc-sidebar .brand-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  overflow: hidden;
  clip-path: inset(0 round 18px);
}

.sc-sidebar .sc-side-foot {
  margin-top: auto;
  padding: 1rem 1rem 1.25rem;
}
.sc-side-note {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  color: var(--sc-muted);
  line-height: 1.4;
}
.sc-side-cta {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
}

.sc-main {
  min-width: 0;
}

.sc-top {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 420px) auto;
  gap: 0.85rem 1rem;
  align-items: center;
  padding: 1rem 1.25rem 0.75rem;
  background: rgba(244, 242, 248, 0.92);
  border-bottom: 1px solid var(--sc-line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
}
.sc-top-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sc-ink);
  letter-spacing: -0.02em;
}
.sc-top-copy p {
  margin: 0.2rem 0 0;
  color: var(--sc-muted);
  font-size: 0.82rem;
}

.sc-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--sc-line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  box-shadow: 0 4px 14px rgba(60, 40, 90, 0.05);
}
.sc-search-ico {
  color: var(--sc-muted);
  font-size: 1rem;
}
.sc-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  min-width: 0;
}
.sc-search kbd {
  font-size: 0.68rem;
  color: var(--sc-muted);
  background: #f4f2f8;
  border-radius: 6px;
  padding: 0.12rem 0.35rem;
  border: 1px solid var(--sc-line);
}

.sc-top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.sc-btn.ghost {
  background: #fff;
  color: var(--sc-ink);
  border-color: var(--sc-line);
}
.sc-btn.ghost:hover {
  border-color: rgba(109, 40, 217, 0.35);
  color: var(--sc-purple);
}
.sc-btn.primary {
  background: var(--sc-purple);
  color: #fff;
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.25);
}

.sc-content {
  padding: 0.85rem 1.1rem 2rem;
  max-width: none;
  width: 100%;
}

.sc-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 1.15rem;
}

.sc-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 1.15fr);
  gap: 0.5rem;
  align-items: center;
  min-height: 320px;
  padding: 1.6rem 1.2rem 1.6rem 1.75rem;
  border-radius: 22px;
  background:
    radial-gradient(520px 240px at 88% 18%, rgba(255, 255, 255, 0.24), transparent 55%),
    linear-gradient(120deg, #5b21b6 0%, #7c3aed 48%, #a78bfa 100%);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.sc-hero-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.88;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sc-hero-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.sc-hero-copy p {
  margin: 0.45rem 0 1rem;
  opacity: 0.92;
  font-size: 0.95rem;
  max-width: 34ch;
}
.sc-hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fde68a, #eab308);
  color: #422006;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.sc-hero-cta:hover { filter: brightness(1.05); }

.sc-hero-art {
  position: relative;
  height: 100%;
  min-height: 280px;
  perspective: 900px;
}
.sc-hero-thumb {
  position: absolute;
  margin: 0;
  width: 48%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 16px 32px rgba(40, 10, 80, 0.4);
  transform-origin: 50% 80%;
  will-change: transform;
  backface-visibility: hidden;
}
.sc-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sc-hero-thumb--empty {
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}

/* Fan layout + continuous soft rotate */
.sc-hero-thumb:nth-child(1) {
  left: 4%;
  top: 14%;
  z-index: 2;
  width: 42%;
  --rot: -14deg;
  animation: sc-hero-spin-1 5.5s ease-in-out infinite;
}
.sc-hero-thumb:nth-child(2) {
  left: 18%;
  top: 8%;
  z-index: 3;
  width: 44%;
  --rot: -6deg;
  animation: sc-hero-spin-2 6.2s ease-in-out infinite;
}
.sc-hero-thumb:nth-child(3) {
  left: 36%;
  top: 4%;
  z-index: 5;
  width: 48%;
  --rot: 2deg;
  animation: sc-hero-spin-3 5.8s ease-in-out infinite;
}
.sc-hero-thumb:nth-child(4) {
  right: 2%;
  left: auto;
  top: 10%;
  z-index: 4;
  width: 44%;
  --rot: 12deg;
  animation: sc-hero-spin-4 6.5s ease-in-out infinite;
}

@keyframes sc-hero-spin-1 {
  0%, 100% { transform: rotate(calc(var(--rot) - 3deg)) translateY(0); }
  50% { transform: rotate(calc(var(--rot) + 4deg)) translateY(-8px); }
}
@keyframes sc-hero-spin-2 {
  0%, 100% { transform: rotate(calc(var(--rot) + 2deg)) translateY(0); }
  50% { transform: rotate(calc(var(--rot) - 4deg)) translateY(-10px); }
}
@keyframes sc-hero-spin-3 {
  0%, 100% { transform: rotate(calc(var(--rot) - 2deg)) translateY(0) scale(1); }
  50% { transform: rotate(calc(var(--rot) + 3deg)) translateY(-6px) scale(1.02); }
}
@keyframes sc-hero-spin-4 {
  0%, 100% { transform: rotate(calc(var(--rot) + 2deg)) translateY(0); }
  50% { transform: rotate(calc(var(--rot) - 3deg)) translateY(-9px); }
}

.sc-hero-art:hover .sc-hero-thumb {
  animation-play-state: paused;
}
.sc-hero-art:hover .sc-hero-thumb:nth-child(1) { transform: rotate(-10deg) translateY(-4px); }
.sc-hero-art:hover .sc-hero-thumb:nth-child(2) { transform: rotate(-4deg) translateY(-6px); }
.sc-hero-art:hover .sc-hero-thumb:nth-child(3) { transform: rotate(0deg) translateY(-8px) scale(1.04); }
.sc-hero-art:hover .sc-hero-thumb:nth-child(4) { transform: rotate(8deg) translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
  .sc-hero-thumb {
    animation: none !important;
  }
  .sc-hero-thumb:nth-child(1) { transform: rotate(-14deg); }
  .sc-hero-thumb:nth-child(2) { transform: rotate(-6deg); }
  .sc-hero-thumb:nth-child(3) { transform: rotate(2deg); }
  .sc-hero-thumb:nth-child(4) { transform: rotate(12deg); }
}

.sc-hero-art > span {
  position: absolute;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.sc-hero-art > span:nth-child(1) {
  width: 46%; height: 78%;
  right: 8%; top: 8%;
  transform: rotate(6deg);
}
.sc-hero-art > span:nth-child(2) {
  width: 40%; height: 70%;
  right: 28%; top: 16%;
  transform: rotate(-4deg);
}
.sc-hero-art > span:nth-child(3) {
  width: 34%; height: 62%;
  right: 48%; top: 24%;
  transform: rotate(10deg);
}

.sc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  min-height: 320px;
}
.sc-stat {
  background: #fff;
  border: 1px solid var(--sc-line);
  border-radius: 18px;
  padding: 1rem 0.45rem 1.05rem;
  box-shadow: 0 4px 12px rgba(60, 40, 90, 0.04);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}
.sc-stat-ico {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
  color: #fff;
}
.sc-stat-ico--purple { background: #7c3aed; }
.sc-stat-ico--green { background: #16a34a; }
.sc-stat-ico--gold { background: #eab308; color: #422006; }
.sc-stat-ico--blue { background: #38bdf8; color: #0c4a6e; }
.sc-stat strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  color: var(--sc-purple);
  line-height: 1.15;
}
.sc-stat strong.is-green { color: #16a34a; }
.sc-stat strong.is-gold { color: #ca8a04; }
.sc-stat strong.is-ink { color: var(--sc-ink); }
.sc-stat span {
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--sc-ink);
  margin-top: 0.2rem;
}
.sc-stat em {
  font-style: normal;
  font-size: 0.65rem;
  color: var(--sc-muted);
  margin-top: 0.12rem;
}

.sc-filters { margin-bottom: 0.85rem; }
.sc-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.sc-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--sc-line);
  background: #fff;
  color: var(--sc-muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}
.sc-chip.is-active {
  background: var(--sc-soft);
  color: var(--sc-purple);
  border-color: rgba(109, 40, 217, 0.28);
}
.sc-chip-clear { color: #b45309; border-color: rgba(180, 83, 9, 0.25); }

.sc-cat-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.35rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.sc-cat {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.45rem;
  align-items: center;
  min-width: 118px;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--sc-line);
  text-decoration: none;
  color: var(--sc-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.sc-cat:hover {
  border-color: rgba(109, 40, 217, 0.3);
  transform: translateY(-1px);
}
.sc-cat.is-active {
  background: var(--sc-soft);
  border-color: rgba(109, 40, 217, 0.4);
  box-shadow: 0 6px 14px rgba(109, 40, 217, 0.12);
}
.sc-cat-ico {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f4f2f8;
  font-size: 1.05rem;
}
.sc-cat.is-active .sc-cat-ico { background: #fff; }
.sc-cat em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}
.sc-cat i {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--sc-muted);
}

.sc-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.35rem 0 0.65rem;
}
.sc-section-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
}
.sc-section-head span,
.sc-section-head a {
  font-size: 0.8rem;
  color: var(--sc-muted);
  text-decoration: none;
  font-weight: 650;
}
.sc-section-head a:hover { color: var(--sc-purple); }

.sc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}
.sc-card {
  background: #fff;
  border: 1px solid var(--sc-line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(60, 40, 90, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.sc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(60, 40, 90, 0.12);
}
.sc-card-media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: #efe8ff;
  overflow: hidden;
}
.sc-card-thumb-host {
  position: absolute;
  inset: 0;
  display: block;
}
.sc-card-thumb-host .mini-poster,
.sc-card-thumb-host .tpl-cover,
.sc-card-thumb-host .tpl-cover-img,
.sc-card-thumb-host .tpl-cover-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sc-cat {
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.sc-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sc-card-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 2rem;
}
.sc-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(91, 33, 182, 0.28);
  font-style: normal;
}
.sc-badge.is-free {
  background: #7c3aed;
  color: #fff;
}
.sc-badge.is-premium {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 55%, #f59e0b 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(120, 53, 15, 0.25);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}
.sc-badge-crown {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}
.sc-card-body {
  padding: 0.7rem 0.75rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.sc-card-body strong {
  font-size: 0.88rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.sc-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--sc-purple);
  background: var(--sc-soft);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}
.sc-owner {
  font-size: 0.7rem;
  color: var(--sc-muted);
}
.sc-card-actions { margin-top: auto; }
.sc-card-btn {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: #7c3aed;
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 0.15s ease, filter 0.15s ease;
}
.sc-card-btn:hover { background: #5b21b6; }
.sc-card-btn.is-premium {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(120, 53, 15, 0.2);
}
.sc-card-btn.is-premium:hover {
  filter: brightness(0.96);
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 50%, #d97706 100%);
}
.sc-card.is-premium {
  border-color: rgba(245, 158, 11, 0.35);
}

.sc-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  background: #fff;
  border: 1px dashed var(--sc-line);
  border-radius: 16px;
  color: var(--sc-muted);
}
.sc-empty p { margin: 0 0 0.85rem; }

.sc-content .market-entry-banner {
  margin-bottom: 1rem;
}

.sc-collections { margin-top: 1.5rem; }
.sc-collection-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}
.sc-collection {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background:
    linear-gradient(160deg, rgba(109, 40, 217, 0.1), rgba(255, 255, 255, 0.9)),
    #fff;
  border: 1px solid var(--sc-line);
  min-height: 110px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sc-collection:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(60, 40, 90, 0.1);
}
.sc-collection-ico { font-size: 1.4rem; }
.sc-collection strong {
  font-family: var(--display);
  font-size: 0.95rem;
}
.sc-collection em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--sc-muted);
}

@media (max-width: 1400px) {
  .sc-hero-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr);
  }
  .sc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .sc-hero-row {
    grid-template-columns: 1fr;
  }
  .sc-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 0;
  }
  .sc-hero { min-height: 260px; }
  .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sc-collection-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sc-top {
    grid-template-columns: 1fr;
  }
  .sc-top-actions { justify-content: flex-start; }
  .sc-hero { grid-template-columns: 1fr; }
  .sc-hero-art { display: none; }
  .sc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-collection-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .dash.sc-shell {
    grid-template-columns: 1fr;
  }
  .sc-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--sc-line);
  }
  .sc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-content { padding: 0.75rem 0.85rem 1.5rem; }
}
