/**
 * AI prompt library — reference masonry layout (Geekape brand).
 */

.geekape-prompts-archive .archive-hero,
.geekape-prompts-archive .archive-filter {
  display: none !important;
}

.ga-prompts {
  padding: 1.25rem 0 3.5rem;
}

.ga-prompts-shell {
  max-width: 1280px;
}

.ga-prompts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ga-prompts-toolbar__left {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.ga-prompts-toolbar__title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--geekape-text, #17212b);
}

.ga-prompts-toolbar__count {
  font-size: 0.95rem;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompts-toolbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ga-prompts-user {
  font-size: 0.875rem;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompts-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.35rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.55rem;
  background: #16c784;
  color: #081712;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.ga-prompts-create:hover {
  filter: brightness(1.08);
  color: #081712;
  text-decoration: none;
}

.ga-prompts-create.is-disabled {
  opacity: 0.55;
}

.ga-prompts-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.15rem;
}

.ga-prompts-tab {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(22, 199, 132, 0.18);
  border-radius: 999px;
  background: var(--geekape-card, #fff);
  color: var(--geekape-text, #17212b);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.ga-prompts-tab:hover {
  border-color: rgba(22, 199, 132, 0.45);
  color: var(--geekape-primary, #16c784);
  text-decoration: none;
}

.ga-prompts-tab.is-active {
  background: rgba(22, 199, 132, 0.14);
  border-color: rgba(22, 199, 132, 0.5);
  color: var(--ri-primary-text, #0a5c3d);
}

[data-bs-theme="dark"] .ga-prompts-tab.is-active {
  color: #7dffc0;
}

.ga-prompts-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .ga-prompts-layout {
    grid-template-columns: 1fr;
  }
}

.ga-prompts-sidebar {
  position: sticky;
  top: 5.5rem;
  padding: 1rem;
  border: 1px solid rgba(22, 199, 132, 0.12);
  border-radius: 1rem;
  background: var(--geekape-card, #fff);
}

.ga-prompts-filters {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ga-prompts-filters__label {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompts-filters input[type="search"],
.ga-prompts-filters select,
.ga-prompt-form input,
.ga-prompt-form select,
.ga-prompt-form textarea {
  width: 100%;
  border: 1px solid rgba(22, 199, 132, 0.18);
  border-radius: 0.55rem;
  background: rgba(8, 23, 18, 0.03);
  color: var(--geekape-text, #17212b);
  font-size: 0.875rem;
}

.ga-prompts-filters input[type="search"],
.ga-prompts-filters select {
  height: 2.25rem;
  padding: 0 0.75rem;
}

[data-bs-theme="dark"] .ga-prompts-filters input[type="search"],
[data-bs-theme="dark"] .ga-prompts-filters select,
[data-bs-theme="dark"] .ga-prompt-form input,
[data-bs-theme="dark"] .ga-prompt-form select,
[data-bs-theme="dark"] .ga-prompt-form textarea {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(22, 199, 132, 0.2);
  color: #e6e8ec;
}

.ga-prompts-filters__submit {
  margin-top: 0.55rem;
  height: 2.15rem;
  border: 0;
  border-radius: 0.55rem;
  background: rgba(22, 199, 132, 0.16);
  color: var(--ri-primary-text, #0a5c3d);
  font-weight: 600;
  cursor: pointer;
}

[data-bs-theme="dark"] .ga-prompts-filters__submit {
  color: #7dffc0;
}

.ga-prompts-tagcloud {
  margin-top: 1.1rem;
}

.ga-prompts-tagcloud__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.ga-prompts-tag {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(22, 199, 132, 0.08);
  color: var(--geekape-muted, #5d616e);
  font-size: 0.72rem;
  text-decoration: none;
}

.ga-prompts-tag:hover,
.ga-prompts-tag.is-active {
  background: rgba(22, 199, 132, 0.2);
  color: var(--geekape-primary, #16c784);
  text-decoration: none;
}

/* Masonry */
.ga-prompts-masonry {
  column-count: 1;
  column-gap: 1rem;
}

@media (min-width: 700px) {
  .ga-prompts-masonry {
    column-count: 2;
  }
}

@media (min-width: 1100px) {
  .ga-prompts-masonry {
    column-count: 3;
  }
}

.ga-prompt-card {
  display: inline-flex;
  flex-direction: column;
  width: 100%;
  margin: 0 0 1rem;
  break-inside: avoid;
  border: 1px solid rgba(22, 199, 132, 0.12);
  border-radius: 1rem;
  background: var(--geekape-card, #fff);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(8, 23, 18, 0.05);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ga-prompt-card:hover {
  border-color: rgba(22, 199, 132, 0.35);
  transform: translateY(-2px);
}

.ga-prompt-card__top {
  display: flex;
  justify-content: flex-end;
  padding: 0.65rem 0.75rem 0;
}

.ga-prompt-badge {
  display: inline-flex;
  align-items: center;
  height: 1.45rem;
  padding: 0 0.5rem;
  border-radius: 0.4rem;
  background: rgba(22, 199, 132, 0.14);
  color: var(--ri-primary-text, #0a5c3d);
  font-size: 0.72rem;
  font-weight: 650;
}

[data-bs-theme="dark"] .ga-prompt-badge {
  color: #7dffc0;
}

.ga-prompt-badge--prompt-writing { background: rgba(14, 165, 233, 0.16); color: #0369a1; }
.ga-prompt-badge--prompt-image { background: rgba(168, 85, 247, 0.16); color: #7e22ce; }
.ga-prompt-badge--prompt-video { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.ga-prompt-badge--prompt-coding { background: rgba(34, 197, 94, 0.16); color: #15803d; }
.ga-prompt-badge--prompt-marketing { background: rgba(244, 63, 94, 0.16); color: #be123c; }

[data-bs-theme="dark"] .ga-prompt-badge--prompt-writing { color: #7dd3fc; }
[data-bs-theme="dark"] .ga-prompt-badge--prompt-image { color: #d8b4fe; }
[data-bs-theme="dark"] .ga-prompt-badge--prompt-video { color: #fcd34d; }
[data-bs-theme="dark"] .ga-prompt-badge--prompt-coding { color: #86efac; }
[data-bs-theme="dark"] .ga-prompt-badge--prompt-marketing { color: #fda4af; }

.ga-prompt-card__media {
  position: relative;
  display: block;
  margin: 0.45rem 0.75rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(8, 23, 18, 0.08);
  aspect-ratio: 4 / 3;
}

.ga-prompt-card--video .ga-prompt-card__media {
  aspect-ratio: 16 / 10;
}

.ga-prompt-card__media img,
.ga-prompt-card__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ga-prompt-card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--geekape-muted, #5d616e);
  font-size: 0.85rem;
  text-decoration: none;
}

.ga-prompt-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.6rem;
  height: 2.6rem;
  margin: -1.3rem 0 0 -1.3rem;
  border-radius: 999px;
  background: rgba(8, 23, 18, 0.55);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.ga-prompt-card__play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.75rem;
  border-color: transparent transparent transparent #fff;
}

.ga-prompt-card__body {
  padding: 0.7rem 0.85rem 0.35rem;
}

.ga-prompt-card__title {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.ga-prompt-card__title a {
  color: inherit;
  text-decoration: none;
}

.ga-prompt-card__title a:hover {
  color: var(--geekape-primary, #16c784);
}

.ga-prompt-card__excerpt {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompt-card__preview {
  margin: 0;
  max-height: 11rem;
  overflow: hidden;
  padding: 0.7rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(8, 23, 18, 0.045);
  border: 1px solid rgba(22, 199, 132, 0.08);
  color: var(--geekape-text, #17212b);
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  mask-image: linear-gradient(180deg, #000 62%, transparent);
}

.ga-prompt-card__preview--compact {
  max-height: 4.8rem;
  margin-top: 0.35rem;
  font-size: 0.7rem;
}

[data-bs-theme="dark"] .ga-prompt-card,
[data-bs-theme="dark"] .ga-prompts-sidebar {
  background: var(--geekape-card, #21242b);
}

[data-bs-theme="dark"] .ga-prompt-card__preview {
  background: rgba(0, 0, 0, 0.28);
}

.ga-prompt-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.ga-prompt-card__tags a {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(22, 199, 132, 0.1);
  color: var(--geekape-muted, #5d616e);
  font-size: 0.7rem;
  text-decoration: none;
}

.ga-prompt-card__tags a:hover {
  color: var(--geekape-primary, #16c784);
}

.ga-prompt-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.55rem 0.75rem 0.7rem;
}

.ga-prompt-card__author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.ga-prompt-card__avatar {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
}

.ga-prompt-card__author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompt-card__views {
  font-size: 0.72rem;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompt-card__actions {
  display: flex;
  gap: 0.25rem;
}

.ga-prompt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(22, 199, 132, 0.1);
  color: var(--geekape-text, #17212b);
  cursor: pointer;
  text-decoration: none;
}

.ga-prompt-icon-btn:hover {
  background: rgba(22, 199, 132, 0.22);
  color: var(--geekape-primary, #16c784);
}

.ga-prompt-icon-btn.is-copied {
  background: #0a5c3d;
  color: #7dffc0;
}

.ga-prompt-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ga-prompts-empty {
  padding: 3rem 1.25rem;
  text-align: center;
  border: 1px dashed rgba(22, 199, 132, 0.3);
  border-radius: 1rem;
  background: var(--geekape-card, #fff);
}

.ga-prompts-empty h2 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}

.ga-prompts-empty p {
  margin: 0 0 1rem;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompts-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.ga-prompts-pagination a,
.ga-prompts-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(22, 199, 132, 0.18);
  background: var(--geekape-card, #fff);
  color: var(--geekape-text, #17212b);
  text-decoration: none;
  font-size: 0.875rem;
}

.ga-prompts-pagination .current {
  background: rgba(22, 199, 132, 0.16);
  border-color: rgba(22, 199, 132, 0.45);
  font-weight: 600;
}

/* Modal */
.ga-prompt-modal[hidden] {
  display: none !important;
}

.ga-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.ga-prompt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 10, 0.62);
  backdrop-filter: blur(2px);
}

.ga-prompt-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 840px);
  overflow: auto;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 1rem;
  background: var(--geekape-card, #fff);
  border: 1px solid rgba(22, 199, 132, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .ga-prompt-modal__panel {
  background: #1c2128;
}

.ga-prompt-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.ga-prompt-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.ga-prompt-modal__close {
  border: 0;
  background: transparent;
  color: var(--geekape-muted, #5d616e);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.ga-prompt-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.ga-prompt-form label,
.ga-prompt-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompt-form__field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ga-prompt-assist {
  height: 1.85rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(22, 199, 132, 0.35);
  border-radius: 0.45rem;
  background: rgba(22, 199, 132, 0.12);
  color: var(--ri-primary-text, #0a5c3d);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

[data-bs-theme="dark"] .ga-prompt-assist {
  color: #7dffc0;
}

.ga-prompt-assist:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ga-prompt-form .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ga-prompt-form input,
.ga-prompt-form select,
.ga-prompt-form textarea {
  padding: 0.55rem 0.7rem;
  font-weight: 400;
}

.ga-prompt-form textarea {
  min-height: 7rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.ga-prompt-form__msg {
  margin: 0;
  font-size: 0.85rem;
  color: #b45309;
}

.ga-prompt-form__msg.is-ok {
  color: #15803d;
}

.ga-prompt-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.ga-prompt-form__cancel,
.ga-prompt-form__submit {
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: 0.55rem;
  font-weight: 600;
  cursor: pointer;
}

.ga-prompt-form__cancel {
  border: 1px solid rgba(22, 199, 132, 0.2);
  background: transparent;
  color: var(--geekape-text, #17212b);
}

.ga-prompt-form__submit {
  border: 0;
  background: #16c784;
  color: #081712;
}

.ga-prompt-form__submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ga-prompt-modal__hint {
  margin: 0.5rem 0 0;
  color: var(--geekape-muted, #5d616e);
  line-height: 1.55;
}

/* Single */
.ga-prompt-single {
  margin: 0 0 1.5rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(22, 199, 132, 0.18);
  border-radius: 1rem;
  background: var(--geekape-card, #fff);
}

.ga-prompt-single__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ga-prompt-single__text {
  margin: 0;
  padding: 1rem 1.05rem;
  border-radius: 0.75rem;
  background: rgba(8, 23, 18, 0.04);
  border: 1px solid rgba(22, 199, 132, 0.1);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-bs-theme="dark"] .ga-prompt-single {
  background: var(--geekape-card, #21242b);
}

[data-bs-theme="dark"] .ga-prompt-single__text {
  background: rgba(0, 0, 0, 0.28);
}

.ga-prompt-single__notes {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(22, 199, 132, 0.12);
  font-size: 0.9rem;
  color: var(--geekape-muted, #5d616e);
}

.ga-prompt-single__notes strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--geekape-text, #17212b);
}

.ga-prompt-single__notes p {
  margin: 0;
}

.ga-prompt-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.15rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 0.55rem;
  background: #16c784;
  color: #081712;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.ga-prompt-copy.is-copied {
  background: #0a5c3d;
  color: #7dffc0;
}

@media (max-width: 575.98px) {
  .ga-prompts-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ga-prompts-toolbar__right {
    justify-content: space-between;
  }

  .ga-prompts-sidebar {
    position: static;
  }
}
