/* === GALLERY PAGE === */
.prompt-gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.prompt-gallery-header {
  text-align: center;
  margin-bottom: 48px;
}

.prompt-gallery-header h1 {
  font-size: 2.8rem;
  margin-bottom: 12px;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.prompt-gallery-header p {
  font-size: 1.1rem;
  color: #64748b;
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* Search bar */
.prompt-search {
  width: 100%;
  max-width: 480px;
  padding: 14px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
}

.prompt-search:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
  background: #fff;
}

/* Tag filters */
.prompt-tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}

.prompt-tag-btn {
  padding: 8px 20px;
  border: 1.5px solid #e2e8f0;
  border-radius: 100px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.prompt-tag-btn:hover {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
}

.prompt-tag-btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* Grid */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* Card */
.prompt-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: #e2e8f0;
}

.prompt-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #f1f5f9;
  display: block;
}

.prompt-card-body {
  padding: 20px;
}

.prompt-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #0f172a;
  line-height: 1.3;
}

.prompt-card-desc {
  font-size: 0.875rem;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
  line-height: 1.5;
}

.prompt-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.prompt-card-tag {
  padding: 3px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Stats row */
.prompt-card-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.prompt-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.prompt-stat svg {
  opacity: 0.6;
}

.prompt-card-actions {
  display: flex;
  gap: 8px;
}

.prompt-card-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.prompt-card-btn:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.prompt-card-btn.copied {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

.prompt-card-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

/* === MODAL === */
.prompt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.prompt-modal {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 1120px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  animation: scaleIn 0.25s ease;
}

.prompt-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.9);
  color: #475569;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.prompt-modal-close:hover {
  background: #fff;
  color: #0f172a;
  transform: scale(1.1);
}

.prompt-modal-content {
  display: flex;
  min-height: 420px;
  overflow: hidden;
}

/* Modal left: image + info */
.prompt-modal-image-section {
  flex: 0 0 38%;
  display: flex;
  flex-direction: column;
  padding: 28px;
  overflow-y: auto;
  background: #fafbfc;
}

.prompt-modal-image {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.prompt-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}

.prompt-modal-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 14px;
  line-height: 1.5;
}

.prompt-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

/* Modal right: code */
.prompt-modal-code-section {
  flex: 1;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  position: relative;
}

.prompt-modal-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  flex-shrink: 0;
}

.prompt-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: system-ui, -apple-system, sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
}

.prompt-copy-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: #475569;
}

.prompt-copy-btn:active {
  transform: scale(0.97);
}

.prompt-copy-btn.copied {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

.prompt-modal-code-scroll {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.prompt-modal-code-scroll pre {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Prism overrides for code theme */
.prompt-modal-code-scroll code[class*="language-"],
.prompt-modal-code-scroll pre[class*="language-"] {
  text-shadow: none;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .prompt-modal-content {
    flex-direction: column;
  }
  .prompt-modal-image-section {
    flex: none;
    padding: 20px;
    max-height: 35vh;
  }
  .prompt-modal {
    max-height: 92vh;
  }
  .prompt-grid {
    grid-template-columns: 1fr;
  }
  .prompt-gallery-header h1 {
    font-size: 2rem;
  }
  .prompt-gallery {
    padding: 24px 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .prompt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
