/* ============================================================
   Boîte à idées — style.css
   Compatible XAMPP local + OVH production
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f5f5f3;
}

a { color: inherit; text-decoration: none; }

/* ---- Conteneur ---- */
.idea-container { max-width: 1000px; margin: 0 auto; padding: 0 1rem; }

/* ---- Header ---- */
.idea-header {
  background: #fff;
  border-bottom: 1px solid #e8e8e5;
  padding: .75rem 0;
  position: sticky; top: 0; z-index: 10;
}
.idea-topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.idea-topbar h1 {
  font-size: 17px; font-weight: 600; flex: 1; min-width: 140px;
}
.icon-bulb { margin-right: 4px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Boutons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; padding: 6px 14px;
  border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: background .12s;
}
.btn-primary  { background: #534AB7; color: #fff; border-color: #534AB7; }
.btn-primary:hover  { background: #3C3489; border-color: #3C3489; }
.btn-outline  { border-color: #d0cfc8; color: #333; background: #fff; }
.btn-outline:hover  { background: #f0f0ed; }
.btn-outline.active { background: #EEEDFE; border-color: #AFA9EC; color: #3C3489; }
.btn-ghost    { color: #666; background: transparent; border-color: transparent; }
.btn-ghost:hover    { background: #f0f0ed; }
.btn-danger   { background: transparent; color: #A32D2D; border-color: #f09595; }
.btn-danger:hover   { background: #FCEBEB; }
.btn-sm { font-size: 12px; padding: 3px 10px; }

/* ---- Stats ---- */
.idea-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr));
  gap: 10px; margin: 1.25rem 0;
}
.stat-card {
  background: #fff; border: 1px solid #e8e8e5; border-radius: 10px;
  padding: 12px 16px;
}
.stat-label { font-size: 11px; color: #888; margin-bottom: 3px; }
.stat-val   { font-size: 22px; font-weight: 600; }
a.stat-card { text-decoration: none; cursor: pointer; transition: border-color .12s; }
a.stat-card:hover { border-color: #AFA9EC; }
.stat-active { border-color: #534AB7 !important; background: #EEEDFE; }
.stat-active .stat-label { color: #534AB7; }
.stat-active .stat-val   { color: #3C3489; }

/* ---- Filtres ---- */
.idea-filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.25rem;
}
.idea-filters input[type=text],
.idea-filters select {
  font-size: 13px; padding: 6px 10px; border: 1px solid #d0cfc8;
  border-radius: 8px; background: #fff; color: #1a1a1a;
}
.idea-filters input[type=text] { flex: 1; min-width: 140px; }

/* ---- Grille idées ---- */
.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 2rem;
}
.idea-card {
  background: #fff; border: 1px solid #e8e8e5; border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column;
}
.idea-card:hover { border-color: #c5c4be; }
.idea-card-head { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: flex-start; }
.idea-card-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; line-height: 1.4; }
.idea-card-desc  { font-size: 12px; color: #666; line-height: 1.5; flex: 1; margin-bottom: 10px; }
.idea-card-foot  { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.idea-author { font-size: 11px; color: #aaa; }
.idea-empty  { text-align: center; padding: 3rem; color: #aaa; }
.ml-auto { margin-left: auto; }

/* ---- Vote ---- */
.vote-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 3px 9px; border-radius: 8px;
  border: 1px solid #d0cfc8; background: transparent;
  cursor: pointer; color: #555; transition: all .12s;
}
.vote-btn:hover { border-color: #534AB7; color: #534AB7; }
.vote-btn.voted { background: #E6F1FB; border-color: #85B7EB; color: #0C447C; }

/* ---- Badges ---- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.badge-cat      { background: #E1F5EE; color: #085041; }
.badge-code     { background: #EEEDFE; color: #3C3489; }
.badge-success  { background: #EAF3DE; color: #27500A; }
.badge-warning  { background: #FAEEDA; color: #633806; }
.badge-danger   { background: #FCEBEB; color: #791F1F; }
.badge-secondary{ background: #F1EFE8; color: #444441; }
.badge-info     { background: #E6F1FB; color: #0C447C; }

/* ---- Alertes ---- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 1rem; font-size: 14px; }
.alert-info   { background: #E6F1FB; color: #0C447C; border: 1px solid #B5D4F4; }
.alert-danger { background: #FCEBEB; color: #791F1F; border: 1px solid #F7C1C1; }

/* ---- Formulaires ---- */
.idea-form, .param-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: #555; font-weight: 500; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
.form-group input[type=text],
.form-group input[type=number],
.form-group select,
.form-group textarea {
  font-size: 14px; padding: 7px 10px; border: 1px solid #d0cfc8;
  border-radius: 8px; background: #fff; color: #1a1a1a;
  font-family: inherit; width: 100%;
}
.form-group textarea { resize: vertical; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.req { color: #A32D2D; }

/* ---- CMS checks ---- */
.cms-checks { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.cms-checks label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.cms-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px;
  font-size: 11px; font-weight: 700; margin-right: 2px;
}
.cms-on  { background: #EAF3DE; color: #27500A; }
.cms-off { background: #F1EFE8; color: #B4B2A9; }

/* ---- Paramètres admin ---- */
.param-tabs { display: flex; gap: 0; border-bottom: 1px solid #e8e8e5; margin-bottom: 1.25rem; }
.param-tab {
  font-size: 14px; padding: 8px 18px; border-bottom: 2px solid transparent;
  color: #888; margin-bottom: -1px;
}
.param-tab:hover { color: #1a1a1a; }
.param-tab.active { color: #534AB7; border-bottom-color: #534AB7; font-weight: 500; }

.param-box {
  background: #fff; border: 1px solid #e8e8e5; border-radius: 12px;
  padding: 16px; margin-bottom: 1.25rem;
}
.param-box h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

.param-table { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e8e8e5; border-radius: 12px; overflow: hidden; }
.param-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: #666;
  padding: 10px 12px; background: #f8f8f6; border-bottom: 1px solid #e8e8e5;
}
.param-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0ed; font-size: 13px; vertical-align: middle; }
.param-table tr:last-child td { border-bottom: none; }
.param-table tr.edit-row td { background: #f8f7ff; }
.actions-cell { display: flex; gap: 6px; align-items: center; }
.text-muted { color: #aaa; }

.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form input[type=text],
.inline-form input[type=number] {
  font-size: 13px; padding: 4px 8px; border: 1px solid #d0cfc8;
  border-radius: 6px; background: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .idea-grid { grid-template-columns: 1fr 1fr; }
  .idea-topbar h1 { font-size: 15px; }
  .param-table th:nth-child(3), .param-table td:nth-child(3) { display: none; }
}
@media (max-width: 400px) {
  .idea-grid { grid-template-columns: 1fr; }
}
