/* ═══════════════════════════════════════════════════════════════
   La Chaloupe – Gestion v1.2.2
   CSS minimaliste : structure uniquement, couleurs et typo
   héritées du thème Divi. Surcharger les variables ci-dessous
   dans le CSS personnalisé Divi (Thème > Options > CSS).
   ═══════════════════════════════════════════════════════════════ */

/*
  VARIABLES À SURCHARGER DANS DIVI si besoin :

  #lachaloupe-admin-root,
  #lachaloupe-public-root {
    --lc-primary:  #votre-couleur;   /* boutons, onglet actif     *\/
    --lc-success:  #16a34a;          /* badges "confirmé"          *\/
    --lc-warning:  #d97706;          /* badges "recherché"         *\/
    --lc-danger:   #dc2626;          /* bouton supprimer           *\/
    --lc-border:   #e2e8f0;          /* bordures des cartes        *\/
    --lc-bg:       #f8fafc;          /* fond des zones grises      *\/
    --lc-card:     #ffffff;          /* fond des cartes            *\/
    --lc-radius:   12px;             /* arrondi des coins          *\/
  }
*/

#lachaloupe-admin-root,
#lachaloupe-public-root {
  /* Valeurs par défaut — à surcharger dans Divi */
  --lc-primary:  #2563eb;
  --lc-success:  #16a34a;
  --lc-warning:  #d97706;
  --lc-danger:   #dc2626;
  --lc-neutral:  #6b7280;
  --lc-info:     #0891b2;
  --lc-border:   #e2e8f0;
  --lc-bg:       #f8fafc;
  --lc-card:     #ffffff;
  --lc-radius:   10px;
  --lc-shadow:   0 1px 4px rgba(0,0,0,.07);

  /* Typographie : héritée de Divi, on ne force rien */
  max-width: 1050px;
  margin: 0 auto;
  padding: 20px 0;
}

/* ── Reset typographie : laisser Divi décider ──────────────── */
#lachaloupe-admin-root h1,
#lachaloupe-admin-root h2,
#lachaloupe-admin-root h3,
#lachaloupe-admin-root h4,
#lachaloupe-public-root h2,
#lachaloupe-public-root h3 {
  /* Annule les marges et styles imposés par certains thèmes */
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.35;
  margin-top: 0;
}

/* ── Titre de l'application ────────────────────────────────── */
.lc-admin-title {
  /* Taille et couleur héritées de Divi — on force juste le poids et la marge */
  font-weight: 500;
  opacity: .75;
  margin: 0 0 18px;
  padding: 0;
  border: none;
  background: none;
  display: block;
}

/* ── Onglets ───────────────────────────────────────────────── */
.lc-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--lc-border);
  flex-wrap: wrap;
}
.lc-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: inherit;
  font-weight: 500;
  opacity: .6;
  border-radius: 4px 4px 0 0;
  transition: opacity .15s;
}
.lc-tab:hover    { opacity: 1; background: var(--lc-bg); }
.lc-tab--active  { opacity: 1; border-bottom-color: var(--lc-primary); font-weight: 700; color: var(--lc-primary); }

/* ── Section title ─────────────────────────────────────────── */
.lc-section-title {
  font-weight: 600;
  font-size: 1em;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--lc-border);
}

/* ── États ─────────────────────────────────────────────────── */
.lc-loading { opacity: .6; font-style: italic; }
.lc-empty   { opacity: .6; background: var(--lc-bg); border: 1px dashed var(--lc-border); padding: 20px; border-radius: var(--lc-radius); text-align: center; }
.lc-error   { color: var(--lc-danger); }
.lc-success { color: var(--lc-success); font-weight: 500; }
.lc-hint    { opacity: .65; font-size: .9em; margin: 0 0 14px; font-style: italic; }

/* ── Filtre catégorie ──────────────────────────────────────── */
.lc-filter-bar   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 14px; background: var(--lc-bg); border: 1px solid var(--lc-border); border-radius: var(--lc-radius); }
.lc-filter-label { font-size: .85em; font-weight: 600; opacity: .6; margin-right: 4px; }
.lc-filter-btn   { background: var(--lc-card); border: 1px solid var(--lc-border); padding: 5px 12px; border-radius: 20px; font-size: .85em; cursor: pointer; transition: all .15s; }
.lc-filter-btn:hover  { border-color: var(--lc-primary); color: var(--lc-primary); }
.lc-filter-btn.active { background: var(--lc-filtre-color, var(--lc-primary)); border-color: var(--lc-filtre-color, var(--lc-primary)); color: #fff; font-weight: 600; }

/* ── Cartes ────────────────────────────────────────────────── */
.lc-card           { background: var(--lc-card); border: 1px solid var(--lc-border); border-radius: var(--lc-radius); padding: 20px; margin-bottom: 14px; box-shadow: var(--lc-shadow); }
.lc-card--benevole { border-left: 4px solid var(--lc-warning); }
.lc-card--form     { background: var(--lc-bg); border-style: dashed; }
.lc-card__head     { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lc-card__title    { font-size: 1em; font-weight: 700; margin: 0 0 4px; }
.lc-card__date     { font-size: .875em; opacity: .65; margin: 0 0 8px; }
.lc-card__lieu     { font-size: .875em; opacity: .65; margin: 0 0 8px; }

/* ── Badges ────────────────────────────────────────────────── */
.lc-badge          { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .8em; font-weight: 600; margin: 3px 3px 3px 0; }
.lc-badge--success { background: #dcfce7; color: var(--lc-success); }
.lc-badge--warning { background: #fef3c7; color: #92400e; }   /* texte brun, plus lisible que jaune */
.lc-badge--danger  { background: #fee2e2; color: var(--lc-danger); }
.lc-badge--neutral { background: #f1f5f9; color: var(--lc-neutral); }
.lc-badge--info    { background: #e0f2fe; color: var(--lc-info); }

/* ── Boutons ───────────────────────────────────────────────── */
.lc-btn            { display: inline-block; padding: 8px 18px; border-radius: 6px; font-size: .9em; font-weight: 600; cursor: pointer; border: none; margin: 4px 5px 0 0; transition: opacity .15s, transform .1s; line-height: 1.4; }
.lc-btn:hover      { opacity: .85; }
.lc-btn:active     { transform: scale(.97); }
.lc-btn:disabled   { opacity: .4; cursor: default; }
.lc-btn--primary   { background: var(--lc-primary); color: #fff; }
.lc-btn--secondary { background: var(--lc-bg); border: 1px solid var(--lc-border); color: inherit; }
.lc-btn--success   { background: var(--lc-success); color: #fff; }
.lc-btn--danger    { background: var(--lc-danger);  color: #fff; }

/* ── Formulaires ───────────────────────────────────────────── */
.lc-input           { display: block; width: 100%; padding: 9px 12px; border: 1px solid var(--lc-border); border-radius: 6px; font-size: inherit; margin-bottom: 12px; background: var(--lc-card); box-sizing: border-box; color: inherit; font-family: inherit; }
.lc-input:focus     { outline: 2px solid var(--lc-primary); border-color: var(--lc-primary); }
.lc-input--small    { width: 80px; display: inline-block; margin-bottom: 0; }
.lc-input--textarea { min-height: 80px; resize: vertical; }
.lc-label           { font-size: .9em; font-weight: 600; opacity: .7; margin-bottom: 5px; display: block; }
.lc-label--inline   { display: inline; font-weight: 500; margin-left: 8px; opacity: 1; }
.lc-form            { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--lc-border); }
.lc-checkbox        { width: 16px; height: 16px; cursor: pointer; accent-color: var(--lc-primary); }
.lc-checkbox-wrap   { display: flex; align-items: center; margin: 8px 0 12px; }

/* Honeypot invisible */
.lc-hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ── Paramétrage design ────────────────────────────────────── */
.lc-design-row           { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.lc-design-row .lc-label { margin: 0; min-width: 160px; }
.lc-color-input          { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--lc-border); border-radius: 6px; cursor: pointer; background: none; }

.lc-resa-row-form          { display: flex; gap: 8px; align-items: center; margin-bottom: 0; }
.lc-resa-row-form .lc-input { margin-bottom: 0; }
.lc-input--date            { flex: 1.6; min-width: 130px; }
.lc-input--heure           { flex: 1; min-width: 80px; }
.lc-input--duree           { flex: 1; min-width: 70px; }

/* ── Barre titre + sauvegarde ──────────────────────────────── */
.lc-title-bar     { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.lc-title-bar .lc-admin-title { margin-bottom: 0; }
.lc-backup-badge  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-backup-info   { font-size: .8em; padding: 4px 10px; border-radius: 20px; }
.lc-backup-ok     { background: #dcfce7; color: #15803d; }
.lc-backup-warn   { background: #fef3c7; color: #92400e; }
.lc-backup-dl     { font-size: .8em; padding: 4px 10px; border-radius: 20px; background: var(--lc-bg); border: 1px solid var(--lc-border); text-decoration: none; color: inherit; cursor: pointer; transition: opacity .15s; }
.lc-backup-dl:hover { opacity: .75; }

/* ── Export / impression ───────────────────────────────────── */
.lc-export-bar { margin-bottom: 16px; display: flex; justify-content: flex-end; }

/* ── Événements passés ─────────────────────────────────────── */
.lc-card--past      { opacity: .55; }
.lc-card--focus     { outline: 2px solid var(--lc-primary); outline-offset: 2px; }
.lc-past-bar        { margin-bottom: 12px; }
.lc-past-btn        { background: none; border: 1px dashed var(--lc-border); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: .85em; opacity: .65; transition: opacity .15s; }
.lc-past-btn:hover  { opacity: 1; }
.lc-ev-title-wrap   { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }

/* ── Modale agenda ─────────────────────────────────────────── */
.lc-modal-overlay   { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lc-modal           { background: #fff; border-radius: 12px; padding: 24px; max-width: 420px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.lc-modal__title    { font-weight: 700; font-size: 1.05em; margin-bottom: 14px; line-height: 1.3; }
.lc-modal__body     { margin-bottom: 18px; }
.lc-modal__ligne    { margin: 6px 0; font-size: .9em; opacity: .85; }
.lc-modal__actions  { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Bénévoles / inscrits ──────────────────────────────────── */
.lc-benevole-list      { list-style: none; padding: 0; margin: 8px 0; font-size: .9em; opacity: .75; }
.lc-benevole-list li   { padding: 3px 0; }
.lc-benevole-list li::before { content: '👤 '; }
.lc-edit-besoins       { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--lc-border); flex-wrap: wrap; }
.lc-edit-besoins .lc-label { margin: 0; }

/* ── Candidatures ──────────────────────────────────────────── */
.lc-candidatures        { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 14px; margin: 12px 0; }
.lc-candidatures__title { font-weight: 700; font-size: .95em; margin: 0 0 10px; }
.lc-candidature-row     { background: var(--lc-card); border-radius: 6px; padding: 12px; margin-bottom: 8px; border: 1px solid #fde68a; font-size: .9em; }
.lc-candidature-msg     { display: block; font-size: .875em; opacity: .65; margin: 5px 0; font-style: italic; }
.lc-candidature-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }

/* ── Réservations ──────────────────────────────────────────── */
.lc-resa-group        { margin-bottom: 20px; }
.lc-resa-group__title { font-size: .8em; font-weight: 700; opacity: .5; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
.lc-resa-row          { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; background: var(--lc-card); border: 1px solid var(--lc-border); border-radius: 8px; margin-bottom: 6px; }
.lc-resa-intitule     { font-weight: 700; flex: 1 1 140px; font-size: .95em; }
.lc-resa-dates        { font-size: .85em; opacity: .65; flex: 2 1 200px; }
.lc-resa-resp         { font-size: .85em; opacity: .65; }

/* ── Ressources / table ────────────────────────────────────── */
.lc-table       { display: flex; flex-direction: column; gap: 6px; }
.lc-table__row  { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--lc-card); border: 1px solid var(--lc-border); border-radius: 8px; flex-wrap: wrap; }
.lc-table__cell { flex: 1; font-weight: 600; font-size: .95em; }

/* ── Shortcodes ────────────────────────────────────────────── */
.lc-shortcodes   { margin-top: 8px; }
.lc-shortcodes p { margin: 8px 0 3px; font-size: .85em; opacity: .65; }
.lc-code         { display: block; background: #1e293b; color: #7dd3fc; padding: 8px 14px; border-radius: 5px; font-family: monospace; font-size: .85em; margin-bottom: 4px; user-select: all; cursor: text; }

/* ── Toast notifications ───────────────────────────────────── */
.lc-toast          { position: fixed; bottom: 24px; right: 24px; background: #1e293b !important; color: #ffffff !important; padding: 12px 20px; border-radius: 8px; font-size: .9em; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; z-index: 10000; max-width: 340px; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.lc-toast--visible { opacity: 1; transform: translateY(0); }
.lc-toast--success { background: #16a34a !important; color: #ffffff !important; }
.lc-toast--error   { background: #dc2626 !important; color: #ffffff !important; }

/* ── Calendrier planning salles ────────────────────────────── */
#lc-planning-calendar               { margin-top: 8px; background: var(--lc-card); border: 1px solid var(--lc-border); border-radius: var(--lc-radius); padding: 16px; box-shadow: var(--lc-shadow); }
#lc-planning-calendar .fc           { font-size: inherit; }
#lc-planning-calendar .fc-toolbar-title { font-size: 1.1em; font-weight: 700; }
#lc-planning-calendar .fc-button    { font-size: .85em; padding: 6px 12px; background: var(--lc-primary); border-color: var(--lc-primary); }
#lc-planning-calendar .fc-button:hover   { opacity: .85; }
#lc-planning-calendar .fc-button-active  { background: #1e40af !important; border-color: #1e40af !important; }
#lc-planning-calendar .fc-event     { font-size: .8em; padding: 2px 4px; border-radius: 3px; cursor: pointer; }
#lc-planning-calendar .fc-timegrid-slot { height: 2.5em; }
#lc-planning-calendar .fc-now-indicator-line { border-color: var(--lc-danger); }
.lc-planning-legend                 { margin-bottom: 8px; }

/* ── Calendrier agenda ─────────────────────────────────────── */
#lc-calendar { margin-top: 8px; background: var(--lc-card); border: 1px solid var(--lc-border); border-radius: var(--lc-radius); padding: 16px; box-shadow: var(--lc-shadow); }
#lc-calendar .fc                    { font-size: inherit; }
#lc-calendar .fc-toolbar-title      { font-size: 1.1em; font-weight: 700; }
#lc-calendar .fc-button             { font-size: .85em; padding: 6px 12px; background: var(--lc-primary); border-color: var(--lc-primary); }
#lc-calendar .fc-button:hover       { opacity: .85; }
#lc-calendar .fc-button-active      { background: #1e40af !important; border-color: #1e40af !important; }
#lc-calendar .fc-event              { font-size: .8em; padding: 1px 4px; border-radius: 3px; cursor: pointer; }
#lc-calendar .fc-daygrid-day-number,
#lc-calendar .fc-col-header-cell-cushion { font-size: .85em; font-weight: 600; }

.lc-cal-legend      { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: .85em; opacity: .8; }
.lc-cal-legend-item { display: flex; align-items: center; gap: 6px; }
.lc-cal-legend-dot  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  #lachaloupe-admin-root,
  #lachaloupe-public-root { padding: 12px 0; }
  .lc-tabs         { gap: 2px; }
  .lc-tab          { padding: 8px 10px; font-size: .875em; }
  .lc-resa-row     { flex-direction: column; align-items: flex-start; }
  .lc-edit-besoins { flex-direction: column; align-items: flex-start; }
  #lc-calendar     { padding: 8px; }
}
