/**
 * Club-IA — Prompt library styles.
 * Grid, cards, filters, single prompt, hero, breadcrumb, modal.
 */

/* ══ Archive Hero ═══════════════════════════════════════════════════════════ */
.cia-archive-hero {
  background: linear-gradient(135deg, #1e40af 0%, #4f46e5 50%, #7c3aed 100%);
  color: #fff;
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.cia-archive-hero--news {
  background: linear-gradient(135deg, #0f766e 0%, #0891b2 50%, #1d4ed8 100%);
}
.cia-archive-hero__title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.cia-archive-hero__sub {
  font-size: 1.05rem;
  opacity: 0.88;
  margin: 0 0 1.5rem;
}
.btn-propose {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.btn-propose:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

/* ══ Breadcrumb (single prompt) ═════════════════════════════════════════════ */
.cia-breadcrumb-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0;
}
.cia-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.cia-breadcrumb a {
  color: var(--cia-primary, #2563eb);
  text-decoration: none;
  font-weight: 500;
}
.cia-breadcrumb a:hover { text-decoration: underline; }
.cia-breadcrumb__sep { color: #94a3b8; }
.cia-breadcrumb__current {
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}

/* ══ Filters ════════════════════════════════════════════════════════════════ */
.prompt-filters {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.prompt-filters__search {
  position: relative;
  margin-bottom: 1rem;
}
.prompt-filters__search::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center;
}
.prompt-filters__input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f8fafc;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.prompt-filters__input:focus {
  outline: none;
  border-color: #4f46e5;
  background: #fff;
}
.prompt-filters__dropdowns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.prompt-filters__select {
  flex: 1 1 160px;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #f8fafc;
  color: #374151;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: border-color 0.2s;
}
.prompt-filters__select:focus {
  outline: none;
  border-color: #4f46e5;
}
.prompt-filters__count {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}
#prompt-count { font-weight: 700; color: #4f46e5; }

/* ══ Grid ═══════════════════════════════════════════════════════════════════ */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* ══ Promise Card ════════════════════════════════════════════════════════════ */
.prompt-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.22s, transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.prompt-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.11);
  transform: translateY(-3px);
}

/* Accent bar top */
.prompt-card__accent {
  height: 4px;
  background: #94a3b8;
  flex-shrink: 0;
}
.prompt-card__accent--debutant   { background: linear-gradient(90deg, #10b981, #34d399); }
.prompt-card__accent--intermediaire { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.prompt-card__accent--avance      { background: linear-gradient(90deg, #ef4444, #f87171); }

.prompt-card__body {
  padding: 1rem 1.125rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.prompt-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.prompt-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
}
.prompt-card__title a {
  color: #1e293b;
  text-decoration: none;
}
.prompt-card__title a:hover { color: #4f46e5; }

/* Prompt preview snippet */
.prompt-card__preview {
  font-size: 0.82rem;
  color: #64748b;
  background: #f8fafc;
  border-left: 3px solid #c7d2fe;
  border-radius: 0 6px 6px 0;
  padding: 0.5rem 0.65rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  line-height: 1.5;
  flex: 1;
}

.prompt-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: auto;
}

/* Tool badges */
.prompt-card__tool {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  border-radius: 9999px;
  background: #e0e7ff;
  color: #4338ca;
}
.prompt-card__tool--chatgpt   { background: #d1fae5; color: #065f46; }
.prompt-card__tool--claude    { background: #fef3c7; color: #92400e; }
.prompt-card__tool--copilot   { background: #dbeafe; color: #1e40af; }
.prompt-card__tool--gemini    { background: #fce7f3; color: #9d174d; }

/* Stars */
.prompt-card__rating {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.star-filled { color: #f59e0b; }
.star-empty  { color: #d1d5db; }
.prompt-card__rating-count { color: #94a3b8; margin-left: 2px; }

.prompt-card__copies {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.prompt-card__copies svg { opacity: 0.6; }

.prompt-card__contributor {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  color: #94a3b8;
}

/* Card actions */
.prompt-card__actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.125rem 1rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.prompt-card__actions .btn-copy-prompt {
  flex: 1;
  justify-content: center;
}

/* ══ Buttons ═════════════════════════════════════════════════════════════════ */
.btn-copy-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #4f46e5;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}
.btn-copy-prompt:hover { background: #4338ca; transform: translateY(-1px); }
.btn-copy-prompt.copied { background: #10b981; }

.btn-view-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s;
  white-space: nowrap;
}
.btn-view-prompt:hover { border-color: #4f46e5; color: #4f46e5; }

/* Load more */
.cia-load-more {
  text-align: center;
  padding: 1rem 0 2rem;
}
.btn-load-more {
  background: #fff;
  color: #4f46e5;
  border: 2px solid #4f46e5;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.btn-load-more:hover { background: #4f46e5; color: #fff; }

/* No results */
.cia-no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: #94a3b8;
  padding: 3rem 1rem;
  font-size: 1rem;
}

/* ══ Single Prompt ═══════════════════════════════════════════════════════════ */
.prompt-single {
  max-width: 800px;
  margin: 2rem auto 3rem;
  padding: 0 1rem;
}

.prompt-single__header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e8ecf0;
}
.prompt-single__title {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 1rem;
  color: #1e293b;
  line-height: 1.2;
}
.prompt-single__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.prompt-single__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: #64748b;
}
.prompt-single__stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.prompt-single__stat svg { color: #94a3b8; }

/* Content section (prompt + copy button inline) */
.prompt-single__content { margin-bottom: 2rem; }

.prompt-single__content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.prompt-single__content-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: #1e293b;
}

/* Inline copy button (next to h2) */
.btn-copy-prompt--inline {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  gap: 0.35rem;
}

.prompt-single__text {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.prompt-single__text pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #1e293b;
}

/* Example section */
.prompt-single__example { margin-bottom: 2rem; }
.prompt-single__example h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #1e293b;
}
.prompt-single__example-text {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  color: #166534;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Rating section */
.prompt-single__rating { margin-bottom: 2rem; }
.prompt-single__rating h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #1e293b;
}
.star-rating {
  display: inline-flex;
  gap: 0.2rem;
}
.star-rating .star {
  font-size: 2rem;
  cursor: pointer;
  color: #d1d5db;
  transition: color 0.15s, transform 0.12s;
  line-height: 1;
}
.star-rating .star--active,
.star-rating .star--hover { color: #f59e0b; }
.star-rating .star:hover { transform: scale(1.2); }
.star-rating__feedback {
  font-size: 0.875rem;
  color: #10b981;
  margin: 0.5rem 0 0;
  min-height: 1.25rem;
}

/* Comments section */
.prompt-single__comments {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e8ecf0;
}

/* ══ Badges (shared) ═════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}
.badge--metier     { background: #ede9fe; color: #5b21b6; }
.badge--thematique { background: #dbeafe; color: #1e40af; }
.badge--outil      { background: #d1fae5; color: #065f46; }
.badge--level-debutant     { background: #d1fae5; color: #065f46; }
.badge--level-intermediaire { background: #fef3c7; color: #92400e; }
.badge--level-avance        { background: #fee2e2; color: #991b1b; }

/* ══ Submit modal ════════════════════════════════════════════════════════════ */
.prompt-submit-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.prompt-submit-modal .modal-inner {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* ══ Responsive ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .cia-archive-hero__title { font-size: 1.5rem; }
  .prompt-grid { grid-template-columns: 1fr; }
  .prompt-single__title { font-size: 1.5rem; }
  .prompt-single__stats { flex-direction: column; gap: 0.5rem; }
  .prompt-single__content-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .prompt-filters__dropdowns { flex-direction: column; }
}

/* ══ Submit Form (modal) ═════════════════════════════════════════════════════ */
.prompt-submit-form h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: #1e293b;
}
.form-row { margin-bottom: 1rem; }
.form-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}
.form-row input[type="text"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #f8fafc;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: #4f46e5;
  background: #fff;
}
.form-row textarea { min-height: 100px; resize: vertical; }
.form-row--3cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.form-row--3cols .form-row { margin-bottom: 0; }
.btn-submit-form {
  width: 100%;
  padding: 0.75rem;
  background: #4f46e5;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.18s;
}
.btn-submit-form:hover { background: #4338ca; }
.btn-close-modal {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}
.form-feedback {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #10b981;
  text-align: center;
}
.form-feedback.error { color: #ef4444; }

/* ══ News Grid & Cards ═══════════════════════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.news-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.22s, transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.11);
  transform: translateY(-3px);
}
.news-card__image { overflow: hidden; }
.news-card__image img { width: 100%; height: 180px; object-fit: cover; display: block; transition: transform 0.3s; }
.news-card:hover .news-card__image img { transform: scale(1.04); }
.news-card__body { padding: 1rem 1.125rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.news-card__tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.news-card__tag { font-size: 0.7rem; font-weight: 600; padding: 0.18rem 0.5rem; border-radius: 9999px; background: #dbeafe; color: #1e40af; }
.news-card__pinned { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700; color: #d97706; background: #fef3c7; padding: 0.18rem 0.5rem; border-radius: 9999px; }
.news-card__title { font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.35; }
.news-card__title a { color: #1e293b; text-decoration: none; }
.news-card__title a:hover { color: #4f46e5; }
.news-card__excerpt { font-size: 0.85rem; color: #64748b; margin: 0; flex: 1; }
.news-card__meta { font-size: 0.78rem; color: #94a3b8; margin-top: auto; }

/* ══ News Single ═════════════════════════════════════════════════════════════ */
.news-single { max-width: 800px; margin: 2rem auto 3rem; padding: 0 1rem; }
.news-single__header { margin-bottom: 2rem; }
.news-single__title { font-size: 1.9rem; font-weight: 800; margin: 0 0 1rem; color: #1e293b; }
.news-single__meta { display: flex; gap: 1rem; font-size: 0.875rem; color: #64748b; margin-bottom: 1rem; }
.news-single__featured { border-radius: 12px; overflow: hidden; margin-bottom: 2rem; }
.news-single__featured img { width: 100%; height: auto; display: block; }
.news-single__content { line-height: 1.75; }
