/* Template Selection Page (ConstBooth Aesthetic) */

.ts-page-wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  box-sizing: border-box;
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #111827;
}

/* Header & Nav */
.ts-header {
  text-align: center;
  margin-bottom: 24px;
}

.ts-flow-trail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

.ts-flow-trail a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.ts-flow-trail a:hover {
  color: #F12850;
}

.ts-flow-trail .is-active {
  color: #F12850;
  font-weight: 700;
}

.ts-hero-title {
  font-size: 36px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px;
  letter-spacing: -0.025em;
}

.ts-hero-title span.accent {
  color: #F12850;
  font-style: italic;
}

.ts-hero-sub {
  font-size: 16px;
  color: #4b5563;
  margin: 0 0 24px;
}

/* Mode Switcher Tabs */
.ts-mode-tabs-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.ts-mode-tabs {
  display: inline-flex;
  background: #ffffff;
  padding: 4px;
  border-radius: 9999px;
  border: 1.5px solid #000000;
  box-shadow: 3px 3px 0 #000000;
}

.ts-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #000000;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.ts-mode-tab.active {
  background: #000000;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ts-mode-tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05);
}

/* Filter Toolbar */
.ts-toolbar {
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 4px 4px 0 #000000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ts-toolbar-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ts-dropdown {
  position: relative;
}

.ts-dropdown select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 10px;
  padding: 8px 34px 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #000000;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.ts-dropdown select:hover,
.ts-dropdown select:focus {
  background-color: #f4f4f0;
  border-color: #000000;
}

.ts-dropdown::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #000000;
  pointer-events: none;
}

.ts-search-wrap {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-search-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.ts-search-input-box svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #6b7280;
  pointer-events: none;
}

.ts-search-input {
  width: 100%;
  padding: 9px 34px 9px 36px;
  border: 1.5px solid #000000;
  border-radius: 10px;
  font-size: 14px;
  background: #ffffff;
  color: #000000;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.ts-search-input:focus {
  border-color: #F12850;
  box-shadow: 0 0 0 3px rgba(241, 40, 80, 0.15);
}

.ts-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.ts-search-clear:hover {
  color: #000000;
}

.ts-search-btn {
  background: #000000;
  color: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 10px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ts-search-btn:hover {
  background: #F12850;
  border-color: #000000;
  transform: translateY(-1px);
}

/* Trending Tags Bar */
.ts-trending-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 0 4px;
}

.ts-trending-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #000000;
  white-space: nowrap;
}

.ts-tag-chip {
  background: #ffffff;
  color: #000000;
  border: 1.5px solid #000000;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ts-tag-chip:hover {
  background: #f4f4f0;
  transform: translateY(-1px);
}

.ts-tag-chip.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* Category Tabs */
.ts-category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ts-category-tabs::-webkit-scrollbar {
  display: none;
}

.ts-cat-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: #ffffff;
  border: 1.5px solid #000000;
  color: #000000;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.ts-cat-btn:hover {
  background: #f4f4f0;
  transform: translateY(-1px);
}

.ts-cat-btn:active {
  transform: scale(0.96);
}

.ts-cat-btn.active {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
  box-shadow: 2px 2px 0 #000000;
}

/* Templates Grid */
.ts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 1100px) {
  .ts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (max-width: 768px) {
  .ts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .ts-hero-title {
    font-size: 26px;
  }
  .ts-toolbar {
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .ts-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
  }
}

/* Template Card */
.ts-card {
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 18px;
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.ts-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  border-color: #000000;
}

.ts-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Card Header Badges */
.ts-card-badges {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
  z-index: 2;
}

.ts-badge-free {
  display: none !important;
}

.ts-badge-slots {
  background: #f4f4f0;
  color: #000000;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
}

/* Card Preview Window */
.ts-card-preview-wrap {
  width: 100%;
  height: 330px;
  background: #fafaf8;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.ts-card-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.ts-card:hover .ts-card-preview-img {
  transform: scale(1.03);
}

/* Hover Action Button (Start Creating) */
.ts-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border-radius: 12px;
}

.ts-card:hover .ts-card-overlay {
  opacity: 1;
}

.ts-btn-start {
  background: #F12850;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 9999px;
  border: 1.5px solid #000000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 3px 3px 0 #000000;
  transform: translateY(6px);
  transition: transform 0.2s ease;
}

.ts-card:hover .ts-btn-start {
  transform: translateY(0);
}

/* Card Footer */
.ts-card-footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-card-meta-row,
.ts-badge-ratio {
  display: none !important;
}

.ts-badge-slots-subtle {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

.ts-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-card-author {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty State */
.ts-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.ts-empty-state svg {
  width: 48px;
  height: 48px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.ts-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

/* Pagination Bar */
.ts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.ts-page-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid #000000;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  transition: all 0.15s ease;
}

.ts-page-btn:hover:not(:disabled) {
  background: #f4f4f0;
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 #000000;
}

.ts-page-btn.active {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
  box-shadow: 2px 2px 0 #000000;
}

.ts-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.ts-page-info {
  font-size: 13px;
  color: #6b7280;
  margin-left: 12px;
  font-weight: 600;
}
