/* =======================================================
   PromptShelf V2 - Modern Minimalist Design System
   Creator-focused AI Prompt Library
   ======================================================= */

:root {
  --bg-main: #0a0a0c;
  --bg-card: #121215;
  --bg-card-hover: #18181c;
  --bg-elevated: #1a1a1f;
  --bg-subtle: #222228;
  --bg-input: #141418;
  
  --border-subtle: #24242c;
  --border-hover: #3a3a46;
  --border-focus: #525262;

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --accent-white: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.08);

  --badge-bg: #1e1e24;
  --badge-border: #2e2e38;
  --badge-text: #e4e4e7;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.7);
  --shadow-modal: 0 25px 60px -10px rgba(0, 0, 0, 0.85);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------- Reset & Base ----------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ----------------- Header & Navigation ----------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
  transition: border-color var(--transition-fast);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  user-select: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2a2a32 0%, #16161b 100%);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* ----------------- Search Bar ----------------- */
.search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-input {
  width: 100%;
  height: 42px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 2.5rem 0 2.6rem;
  font-size: 0.92rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:hover {
  border-color: var(--border-hover);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-wrapper:focus-within .search-icon {
  color: var(--text-primary);
}

.search-clear {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  color: var(--text-primary);
}

.search-clear.visible {
  display: flex;
}

/* ----------------- Filter Chips ----------------- */
.filter-nav {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 2px;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  background-color: var(--accent-white);
  color: #000000;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ----------------- Hero / Subtitle Info ----------------- */
.hero-subbar {
  max-width: 1400px;
  margin: 1.5rem auto 0.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.hero-subbar h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-subbar p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.prompt-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ----------------- Main Layout & Grid ----------------- */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 1rem auto 3rem auto;
  padding: 0 1.5rem;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.4rem;
}

/* ----------------- Prompt Card ----------------- */
.prompt-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition-normal), 
              border-color var(--transition-normal), 
              box-shadow var(--transition-normal),
              background-color var(--transition-normal);
  box-shadow: var(--shadow-card);
  position: relative;
}

.prompt-card:hover {
  transform: translateY(-4px);
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.prompt-card:focus-visible {
  outline: 2px solid var(--accent-white);
  outline-offset: 2px;
}

/* Card Thumbnail Wrapper */
.card-thumbnail-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: #0d0d10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.prompt-card:hover .card-thumbnail {
  transform: scale(1.025);
}

/* Play Badge Overlay for Videos */
.video-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.video-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Card Body */
.card-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  transition: color var(--transition-fast);
}

.card-description {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer Meta */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
  font-size: 0.75rem;
}

.type-pill {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.type-pill.type-video {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.2);
  background-color: rgba(59, 130, 246, 0.08);
}

.type-pill.type-image {
  color: #e2e8f0;
}

.tool-name {
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tool-name::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

/* ----------------- Skeleton Loading Cards ----------------- */
.skeleton-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, #16161b 25%, #22222a 50%, #16161b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-body {
  padding: 1.1rem;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #16161b 25%, #22222a 50%, #16161b 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.title {
  width: 75%;
  height: 18px;
  margin-bottom: 1rem;
}

.skeleton-line.desc-1 {
  width: 100%;
}

.skeleton-line.desc-2 {
  width: 60%;
  margin-bottom: 1.2rem;
}

.skeleton-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.skeleton-pill {
  width: 60px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #16161b 25%, #22222a 50%, #16161b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ----------------- Empty & Error States ----------------- */
.status-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  margin: 1rem 0;
}

.status-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.status-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.status-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
}

.status-retry-btn {
  margin-top: 1.2rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-retry-btn:hover {
  background: var(--text-primary);
  color: #000;
}

/* ----------------- Modal System ----------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(5, 5, 8, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: scale(0.97) translateY(8px);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-container {
  transform: scale(1) translateY(0);
}

/* Modal Close Button */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(18, 18, 22, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Modal Scrollable Body */
.modal-scroll-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: calc(90vh - 2px);
}

/* Modal Media Section */
.modal-media-wrap {
  width: 100%;
  height: 460px;
  max-height: 52vh;
  background-color: #060608;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
  border-radius: 4px;
}

/* Modal Video Player with Centered Play Button */
.modal-video-box {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  overflow: hidden;
}

/* Modal YouTube Iframe Embed */
.modal-iframe-box {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  overflow: hidden;
  border-radius: 4px;
}

.modal-video-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.modal-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}

.custom-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(15, 15, 20, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  z-index: 10;
}

.custom-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  border-color: #ffffff;
}

.custom-play-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  margin-left: 3px; /* visual center compensation */
}

.custom-play-btn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Modal Details Section */
.modal-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-header-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-title-block {
  flex: 1;
  min-width: 250px;
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tool-badge {
  font-size: 0.78rem;
  font-weight: 600;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Prompt Box */
.prompt-box-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.prompt-textarea-wrap {
  position: relative;
  background-color: #0c0c0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  transition: border-color var(--transition-fast);
}

.prompt-textarea-wrap:focus-within {
  border-color: var(--border-hover);
}

.prompt-text-display {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
  max-height: 180px;
  overflow-y: auto;
}

/* Modal Actions Bar */
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-secondary {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: #2b2b34;
  border-color: var(--border-focus);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary.copied {
  background-color: #15803d;
  border-color: #22c55e;
  color: #ffffff;
}

.btn-primary {
  background-color: var(--accent-white);
  border: 1px solid #ffffff;
  color: #000000;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background-color: #e5e5e8;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* Fallback Media Placeholder */
.media-fallback {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #121216;
  color: var(--text-muted);
  gap: 0.5rem;
  font-size: 0.85rem;
}

.media-fallback svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-muted);
}

/* ----------------- Footer ----------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem;
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  background-color: var(--bg-main);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.developer-name {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ----------------- Responsive Breakpoints ----------------- */
@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .filter-nav {
    margin-left: auto;
  }

  .prompt-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.1rem;
  }

  .modal-container {
    max-height: 94vh;
  }

  .modal-scroll-body {
    padding: 1.1rem;
    gap: 1.1rem;
  }

  .modal-media-wrap {
    height: 360px;
    max-height: 46vh;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.85rem 1rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .filter-nav {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 0.45rem 0.5rem;
  }

  .hero-subbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0 1rem;
  }

  .main-content {
    padding: 0 1rem;
    margin: 1rem auto 2rem auto;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-container {
    max-height: 96vh;
    border-radius: var(--radius-md);
  }

  .modal-media-wrap {
    height: 260px;
    max-height: 40vh;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* ----------------- Add Prompt Button & Modal Styling ----------------- */
.btn-add {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-add:hover {
  background-color: var(--text-primary);
  color: #000000;
  border-color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.add-prompt-container {
  max-width: 680px;
}

.add-prompt-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 0.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.form-group.flex-1 {
  flex: 1;
}

.form-group.flex-2 {
  flex: 2;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.required {
  color: #f87171;
}

.form-input, .form-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-input-sm {
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.form-file {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background-color: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.form-file:hover {
  border-color: var(--border-hover);
}

.form-help {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.type-selector {
  display: flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  height: 42px;
}

.type-radio-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.type-radio-label input {
  display: none;
}

.type-radio-label:has(input:checked) {
  background-color: var(--accent-white);
  color: #000000;
  font-weight: 600;
}

.form-status-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
}

.form-status-msg.error {
  background-color: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.form-status-msg.success {
  background-color: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
    gap: 0.85rem;
  }
}

/* ----------------- Load More Button ----------------- */
.load-more-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2.5rem;
  padding-bottom: 1rem;
}

.btn-load-more {
  background-color: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 0.75rem 2.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-load-more:hover {
  background-color: var(--accent-white);
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

.btn-load-more:active {
  transform: translateY(0);
}

