/* AIClothSwap Inspiration Library Stylesheet (Scoped) */
:root {
  --inspo-orange: #FF5A1F;
  --inspo-orange-hover: #E64A12;
  --inspo-orange-light: #FFF7F2;
  --inspo-orange-border: #FFEEDD;
  --inspo-bg: #FAF7F2;
  --inspo-card-bg: #FFFFFF;
  --inspo-border: #EBE3D5;
  --inspo-border-hover: #DDD3C1;
  --inspo-text: #231E1B;
  --inspo-text-muted: #6B635B;
  --inspo-text-dim: #9C9388;
}

.inspo-wrapper {
  background-color: var(--inspo-bg);
  color: var(--inspo-text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  padding: 2rem 1.5rem 5rem;
  min-height: 80vh;
}

.inspo-inner {
  max-width: 1280px;
  margin: 0 auto;
}

/* Header & Intro */
.inspo-hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2.5rem;
}

.inspo-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--inspo-orange-light);
  border: 1px solid var(--inspo-orange-border);
  color: var(--inspo-orange);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 0.8rem;
}

.inspo-h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--inspo-text);
  letter-spacing: -0.025em;
  margin-bottom: 0.8rem;
  line-height: 1.25;
}

.inspo-desc {
  font-size: 1rem;
  color: var(--inspo-text-muted);
  line-height: 1.6;
}

/* Search bar */
.inspo-search-wrap {
  margin: 1.5rem auto 0;
  max-width: 640px;
  position: relative;
  display: flex;
  align-items: center;
}

.inspo-search-icon {
  position: absolute;
  left: 14px;
  color: var(--inspo-text-dim);
  pointer-events: none;
}

.inspo-search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 14px;
  border: 1px solid var(--inspo-border);
  background: #fff;
  font-size: 0.95rem;
  color: var(--inspo-text);
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(80, 60, 40, 0.04);
}

.inspo-search-input:focus {
  border-color: var(--inspo-orange);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12);
}

/* Category Pills Bar */
.inspo-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 16px;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--inspo-border);
  scrollbar-width: thin;
}

.inspo-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--inspo-border);
  color: var(--inspo-text);
  text-decoration: none;
  transition: all 0.2s;
}

.inspo-pill-item:hover {
  border-color: var(--inspo-orange);
  color: var(--inspo-orange);
  transform: translateY(-1px);
}

.inspo-pill-item.active {
  background: var(--inspo-orange);
  border-color: var(--inspo-orange);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 90, 31, 0.25);
}

/* Control Row */
.inspo-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--inspo-text-muted);
}

.inspo-count-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspo-count-num {
  font-weight: 800;
  color: var(--inspo-text);
  font-size: 1rem;
}

.inspo-sort-select {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--inspo-border);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--inspo-text);
  outline: none;
  cursor: pointer;
}

/* Masonry Waterfall */
.masonry-grid {
  column-count: 4;
  column-gap: 1.5rem;
}

@media (max-width: 1200px) {
  .masonry-grid { column-count: 3; }
}

@media (max-width: 820px) {
  .masonry-grid { column-count: 2; }
}

@media (max-width: 520px) {
  .masonry-grid { column-count: 1; }
}

.masonry-card {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--inspo-border);
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(80, 60, 40, 0.04);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.masonry-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -4px rgba(80, 60, 40, 0.12);
  border-color: var(--inspo-border-hover);
}

/* Card Visual Box */
.aspect-box {
  position: relative;
  display: block;
  overflow: hidden;
  background: #f1ede6;
}

.aspect-1-1 { aspect-ratio: 1 / 1; }
.aspect-3-4 { aspect-ratio: 3 / 4; }
.aspect-4-5 { aspect-ratio: 4 / 5; }
.aspect-2-3 { aspect-ratio: 2 / 3; }
.aspect-9-16 { aspect-ratio: 9 / 16; }
.aspect-4-3 { aspect-ratio: 4 / 3; }
.aspect-16-9 { aspect-ratio: 16 / 9; }

.main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.masonry-card:hover .main-img {
  transform: scale(1.02);
}

/* Inset Garment floating thumbnail */
.inset-garment {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  z-index: 2;
}

.masonry-card:hover .inset-garment {
  transform: scale(1.08);
}

.inset-garment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inset-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  padding: 1px 0;
}

.badge-ratio {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
}

.badge-placeholder {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(249, 115, 22, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}

/* Card Body */
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title-zh {
  font-size: 1rem;
  font-weight: 700;
  color: var(--inspo-text);
  line-height: 1.35;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title-zh:hover {
  color: var(--inspo-orange);
}

.card-title-en {
  font-size: 0.8rem;
  color: var(--inspo-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #f5f0e8;
  font-size: 0.8rem;
  color: var(--inspo-text-muted);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.author-handle {
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-verified {
  color: #0284c7;
  font-size: 0.75rem;
  font-weight: bold;
}

.card-likes {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.card-cta-btn {
  display: block;
  text-align: center;
  margin-top: 8px;
  padding: 8px;
  background: var(--inspo-orange-light);
  border: 1px solid var(--inspo-orange-border);
  color: var(--inspo-orange);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.card-cta-btn:hover {
  background: var(--inspo-orange);
  color: #fff;
  border-color: var(--inspo-orange);
}

/* Detail View Layout */
.detail-grid {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--inspo-border);
  padding: 1.5rem;
  box-shadow: 0 4px 20px -2px rgba(80, 60, 40, 0.05);
  margin-bottom: 1.5rem;
}

.detail-stage-box {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f1ede6;
  border: 1px solid var(--inspo-border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  max-height: 640px;
}

.detail-stage-img {
  max-width: 100%;
  max-height: 640px;
  object-fit: contain;
  display: block;
}

.detail-thumbnails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 1rem;
}

.thumb-btn {
  padding: 6px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--inspo-bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.thumb-btn:hover {
  border-color: var(--inspo-border-hover);
}

.thumb-btn.active {
  border-color: var(--inspo-orange);
  background: var(--inspo-orange-light);
}

.thumb-btn-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
}

.thumb-btn-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--inspo-text);
}

.thumb-btn.active .thumb-btn-text {
  color: var(--inspo-orange);
}

/* Detail Right Panel */
.detail-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: var(--inspo-orange);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 24px -4px rgba(255, 90, 31, 0.35);
  transition: all 0.2s;
}

.detail-cta-primary:hover {
  background: var(--inspo-orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(255, 90, 31, 0.45);
}

.prompt-box {
  background: #faf7f2;
  border: 1px solid var(--inspo-border);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  margin-top: 1rem;
}

.prompt-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.prompt-tab-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--inspo-text-muted);
  cursor: pointer;
}

.prompt-tab-btn.active {
  background: #fff;
  border-color: var(--inspo-border);
  color: var(--inspo-orange);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.prompt-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--inspo-border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--inspo-text);
  cursor: pointer;
  transition: all 0.2s;
}

.copy-prompt-btn:hover {
  border-color: var(--inspo-orange);
  color: var(--inspo-orange);
}

.attribution-box {
  border-top: 1px solid var(--inspo-border);
  padding-top: 12px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--inspo-text-muted);
}
