/* =========================================================
   PROJETS PARTICIPATIFS — SVsansT (FINAL)
   Objectif: rendu "cours" + badge statut qui NE chevauche plus le titre
   + barre de recherche identique (icône dans input, bouton transparent)
   ========================================================= */

:root{
  --svs-blue:#2563eb;
  --svs-blue-600:#1d4ed8;
  --svs-ink:#0f172a;
  --svs-muted:#475569;
  --svs-bg:#ffffff;
  --svs-soft:#f8fafc;
  --svs-border:#e5e7eb;
  --svs-radius:16px;
  --svs-header-h: 64px;
}

/* ===================== Section filtres ===================== */
.filters-section{
  padding:40px 0;
  background:#f9fafb;
  border-bottom:1px solid var(--svs-border);
}

.search-filters{
  display:flex;
  justify-content:center;
}

/* ===== Barre identique (icône dans input, bouton transparent) ===== */
.search-bar{
  width:100%;
  max-width: 980px;
}

.search-bar__row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

/* version 1 champ */
.search-bar__row--single{
  justify-content:center;
}

.search-bar__search{
  flex: 1 1 680px;
  position:relative;
}

.search-bar__search input{
  width:100%;
  height:46px;
  border:1px solid rgba(15,23,42,.12);
  border-radius:12px;
  padding:0 46px 0 1rem; /* place icône */
  background:#ffffff;
  font-size:1rem;
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease;
}

.search-bar__search input:focus{
  border-color: var(--svs-blue);
  box-shadow:0 0 0 3px rgba(37,99,235,0.08);
}

/* bouton transparent */
.search-bar__iconbtn{
  position:absolute;
  top:50%;
  right:6px;
  transform: translateY(-50%);
  width:40px;
  height:40px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:#64748b;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: color .15s ease, background .15s ease, transform .02s ease;
}

.search-bar__iconbtn:hover{
  color: var(--svs-blue);
  background:#f3f4f6;
}

.search-bar__iconbtn:active{
  transform: translateY(-50%) scale(0.98);
}

.search-bar__iconbtn:focus-visible{
  outline:3px solid rgba(37,99,235,0.15);
  outline-offset:2px;
}

.search-bar__iconbtn svg{
  display:block;
  width:20px;
  height:20px;
  stroke:currentColor;
}

/* ===================== Section grille ===================== */
.projects-grid-section{
  background:var(--svs-bg);
  padding:60px 0;
}

.projects-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:2rem;
}

@media (max-width:1200px){
  .projects-grid{ grid-template-columns:repeat(3, 1fr); }
}
@media (max-width:900px){
  .projects-grid{ grid-template-columns:repeat(2, 1fr); }
}
@media (max-width:600px){
  .projects-grid{ grid-template-columns:1fr; }
  .projects-grid-section{ padding:40px 0; }
}

/* ===================== Carte projet ===================== */
.project-card{
  background:#fff;
  border:1px solid #e6e9ee;
  border-radius:var(--svs-radius);
  box-shadow:0 4px 10px rgba(0,0,0,.04);
  padding:1.25rem;
  display:flex;
  flex-direction:column;
  min-height:260px;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position:relative;
}

.project-card:hover{
  transform:translateY(-5px);
  box-shadow:0 16px 40px rgba(37,99,235,.12);
  border-color:rgba(37,99,235,.22);
}

.project-thumb{
  display:block;
  border-radius:14px;
  overflow:hidden;
  aspect-ratio:16/9;
  background:linear-gradient(180deg, rgba(2,6,23,.04), rgba(2,6,23,.01));
  border:1px solid rgba(15,23,42,.10);
  margin-bottom:10px;
}
.project-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Header de carte */
.project-card .course-card__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:2px 0 8px 0;
  min-height:26px;
}

/* ===================== Badge statut ===================== */
.project-status-badge{
  position:static !important;
  top:auto !important;
  right:auto !important;

  display:inline-flex;
  align-items:center;
  gap:.35rem;

  font-size:.8rem;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid transparent;
  line-height:1;
  white-space:nowrap;
}

.project-status-badge::before{
  content:'';
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  background:currentColor;
}

.status-a_venir{
  background:#fff7e6;
  color:#92400e;
  border-color:#fcd34d;
}
.status-en_cours{
  background:#ecfdf5;
  color:#065f46;
  border-color:#6ee7b7;
}
.status-termine{
  background:#f3f4f6;
  color:#334155;
  border-color:#d1d5db;
}

/* ===================== Titre / Résumé ===================== */
.project-card .course-title{
  font-size:1.1rem;
  font-weight:900;
  color:var(--svs-ink);
  margin:6px 0 .45rem 0;
  line-height:1.25;
}

.project-card .course-description{
  color:var(--svs-muted);
  font-size:.95rem;
  line-height:1.5;
  margin:0 0 1rem 0;
  max-height:4.5rem;
  overflow:hidden;
  text-overflow:ellipsis;
}

.course-description--empty{
  color:#94a3b8;
  font-style:italic;
}

/* ===================== Métadonnées ===================== */
.project-card .course-meta{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  margin-bottom:1rem;
}

.project-card .meta-item{
  display:inline-flex;
  align-items:center;
  font-size:.87rem;
  color:#334155;
  background:var(--svs-soft);
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #eef2f7;
}

/* ===================== Bouton ===================== */
.project-card .course-btn{
  background:var(--svs-blue);
  color:#fff;
  border-radius:10px;
  font-weight:900;
  padding:10px 14px;
  text-decoration:none;
  text-align:center;
  transition:all .2s ease;
  margin-top:auto;
}

.project-card .course-btn:hover{
  background:var(--svs-blue-600);
  transform:translateY(-2px);
}

/* ===================== Page projet détaillée ===================== */
.project-details-page{
  padding:60px 0;
  background:#fff;
}

.project-full{
  font-size:1rem;
  color:#334155;
  line-height:1.7;
}
.project-full h2,
.project-full h3{
  color:#1f4e79;
  margin-top:1.5rem;
  font-weight:800;
}
.project-full img{
  max-width:100%;
  border-radius:10px;
  margin:1rem 0;
}
.project-full p{ margin-bottom:1rem; }

/* ===================== Modal proposer un projet ===================== */
.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  z-index:1200;
  background:rgba(0,0,0,.6);
  align-items:center;
  justify-content:center;
  padding:18px;
  backdrop-filter:blur(3px);
}
.modal-overlay.active{ display:flex; }

.modal-content{
  background:#fff;
  border-radius:16px;
  max-width:760px;
  width:100%;
  box-shadow:0 18px 45px rgba(0,0,0,.35);
  padding:18px;
  max-height:90vh;
  overflow:auto;
  position:relative;
  border:1px solid rgba(15,23,42,.10);
}

.close-btn{
  position:absolute;
  top:10px;
  right:12px;
  width:40px;
  height:40px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.12);
  font-size:22px;
  cursor:pointer;
  color:#0f172a;
  display:flex;
  align-items:center;
  justify-content:center;
}

.modal-form .form-group{ margin-bottom:12px; }
.modal-form label{
  display:block;
  margin-bottom:6px;
  font-weight:900;
  color:#0f172a;
}
.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="number"],
.modal-form select,
.modal-form textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid rgba(15,23,42,.12);
  border-radius:12px;
  font-size:14px;
  outline:none;
  background:#fff;
}
.modal-form textarea{
  resize:vertical;
  min-height:110px;
}

.form-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:14px;
  flex-wrap:wrap;
}

.project-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border-radius:999px;
  font-weight:900;
  cursor:pointer;
  border:1px solid transparent;
  background:var(--svs-blue);
  color:#fff;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}
.project-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(2,6,23,.12);
}
.project-btn.secondary{
  background:#fff;
  color:#0f172a;
  border-color:rgba(15,23,42,.14);
}
.project-btn.secondary:hover{
  background:#f1f5f9;
}

@media (max-width:520px){
  .form-actions{ justify-content:stretch; }
  .form-actions .project-btn{ width:100%; }
}

/* ===================== Promos internes ===================== */
.promo-card{
  border:1px solid var(--svs-border);
  position:relative;
  overflow:hidden;
}

.promo-card--basic::after,
.promo-card--support::after{
  content:"";
  position:absolute;
  inset:-80px -120px auto auto;
  width:260px;
  height:260px;
  border-radius:999px;
  opacity:.18;
  transform:rotate(10deg);
  pointer-events:none;
}
.promo-card--basic::after{ background:#0ea5e9; }
.promo-card--support::after{ background:#6366f1; }

@media (max-width:420px){
  .project-card{
    padding:1rem;
    min-height:220px;
  }
  .project-card .course-title{ font-size:1.05rem; }
  .project-card .course-description{ font-size:.92rem; }
}

/* ================= Barre de progression de lecture (identique cours) ================= */
.course-progress-floating{
  position:fixed;
  top:var(--svs-header-h, 64px);
  left:0;
  right:0;
  z-index:80;
  pointer-events:none;
}
.course-progress-label{ display:none; }
.course-progress-track{
  position:relative;
  width:100%;
  height:3px;
  background:rgba(148,163,184,.35);
  overflow:hidden;
}
.course-progress-inner{
  position:absolute;
  inset:0;
  width:0%;
  border-radius:0 999px 999px 0;
  background:linear-gradient(90deg, #1d4ed8, #3b82f6);
  transition:width .18s ease-out;
}
@media (max-width:480px){
  .course-progress-track{ height:3px; }
}