/* ============================================================
   PPC Confession — Design
   Thème : Violet nuit · Mystérieux · Intime
   ============================================================ */
:root {
  --fond:      #080810;
  --surface:   #0F0F1C;
  --surface2:  #161626;
  --surface3:  #1E1E35;
  --texte:     #F0EEF8;
  --dim:       #9090B0;
  --mute:      #4A4A70;
  --violet:    #8B5CF6;
  --violet2:   #A78BFA;
  --rose:      #EC4899;
  --or:        #F59E0B;
  --vert:      #10B981;
  --rouge:     #EF4444;
  --bordure:   rgba(139,92,246,0.15);
  --bordure2:  rgba(139,92,246,0.25);
  --grad:      linear-gradient(135deg, #8B5CF6, #EC4899);
  --grad-soft: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(236,72,153,0.1));
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --glow:      0 0 30px rgba(139,92,246,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--fond); color: var(--texte); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--violet2); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--violet); }
img { display: block; max-width: 100%; }

/* ── HEADER ─────────────────────────────────────────────────── */
.header { background: rgba(8,8,16,0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--bordure); padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 100; }
.header__logo { font-size: 1.1rem; font-weight: 900; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-decoration: none; }
.header__nav { display: flex; gap: 4px; }
.header__nav a { padding: 6px 12px; border-radius: var(--radius-sm); font-size: .82rem; font-weight: 500; color: var(--dim); transition: all .15s; }
.header__nav a:hover, .header__nav a.active { background: var(--surface2); color: var(--texte); }
.header__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.header__user { font-size: .82rem; color: var(--dim); }

/* ── HERO ────────────────────────────────────────────────────── */
.hero { padding: 56px 24px 40px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(139,92,246,.15), transparent 65%); pointer-events: none; }
.hero__title { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 900; letter-spacing: -.03em; margin-bottom: 10px; }
.hero__title em { font-style: normal; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero__sub { color: var(--dim); font-size: .95rem; max-width: 480px; margin: 0 auto 28px; line-height: 1.65; }

/* ── CONTAINER ───────────────────────────────────────────────── */
.container { max-width: 780px; margin: 0 auto; padding: 0 20px; }
.container--lg { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ── FILTRES CATÉGORIES ──────────────────────────────────────── */
.cat-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: 20px; font-size: .78rem; font-weight: 600; border: 1px solid var(--bordure); background: var(--surface); color: var(--dim); cursor: pointer; text-decoration: none; transition: all .15s; }
.cat-btn:hover { border-color: var(--violet); color: var(--violet2); }
.cat-btn.active { background: rgba(139,92,246,.15); border-color: var(--violet); color: var(--violet2); }
.cat-btn--all { border-color: var(--bordure2); }

/* ── CONFESSION CARD ─────────────────────────────────────────── */
.confession-card {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 14px;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.confession-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--cat-color, var(--violet));
  border-radius: 3px 0 0 3px;
}
.confession-card:hover { border-color: var(--bordure2); box-shadow: var(--glow); }

.confession-card__header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.confession-card__cat { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700; background: rgba(139,92,246,.1); border: 1px solid var(--bordure2); }
.confession-card__anon { font-size: .78rem; color: var(--dim); }
.confession-card__time { font-size: .72rem; color: var(--mute); margin-left: auto; }

.confession-card__photo { border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; max-height: 300px; }
.confession-card__photo img { width: 100%; max-height: 300px; object-fit: cover; }

.confession-card__text { font-size: .95rem; line-height: 1.7; color: var(--texte); margin-bottom: 16px; white-space: pre-wrap; }

.confession-card__footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vote-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 20px; font-size: .82rem; font-weight: 600; border: 1px solid var(--bordure2); background: var(--surface2); cursor: pointer; transition: all .18s; font-family: inherit; }
.vote-btn:hover { border-color: var(--violet); }
.vote-btn--like.voted { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.4); color: #34D399; }
.vote-btn--dislike.voted { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #FCA5A5; }
.comment-link { font-size: .8rem; color: var(--dim); padding: 6px 10px; border-radius: 20px; transition: color .15s; }
.comment-link:hover { color: var(--violet2); }
.report-btn { font-size: .75rem; color: var(--mute); padding: 4px 8px; background: none; border: none; cursor: pointer; margin-left: auto; font-family: inherit; transition: color .15s; }
.report-btn:hover { color: var(--rouge); }

/* ── CONFESSION UNIQUE ───────────────────────────────────────── */
.confession-full { background: var(--surface); border: 1px solid var(--bordure2); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px; }

/* ── COMMENTAIRES ────────────────────────────────────────────── */
.comments-section { margin-top: 8px; }
.comments-section h3 { font-size: .95rem; font-weight: 700; margin-bottom: 14px; color: var(--dim); }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface3); display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.comment__body { flex: 1; }
.comment__header { font-size: .75rem; color: var(--dim); margin-bottom: 4px; }
.comment__pseudo { font-weight: 700; color: var(--violet2); }
.comment__text { font-size: .875rem; line-height: 1.6; }

.comment-form { margin-top: 20px; }
.comment-form textarea { width: 100%; padding: 12px 14px; background: var(--surface2); border: 1px solid var(--bordure2); border-radius: var(--radius-sm); color: var(--texte); font-family: inherit; font-size: .875rem; resize: vertical; min-height: 80px; outline: none; transition: border-color .2s; }
.comment-form textarea:focus { border-color: var(--violet); }
.comment-form textarea::placeholder { color: var(--mute); }

/* ── FORMULAIRE NOUVELLE CONFESSION ──────────────────────────── */
.new-confession-card { background: var(--surface); border: 1px solid var(--bordure2); border-radius: var(--radius-lg); padding: 28px; }
.new-confession-card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--dim); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px;
  background: var(--surface2); border: 1px solid var(--bordure2);
  border-radius: var(--radius-sm); color: var(--texte);
  font-family: inherit; font-size: .875rem; outline: none;
  transition: border-color .2s; -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.1); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--mute); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-hint { font-size: .72rem; color: var(--mute); margin-top: 4px; }
.char-count { font-size: .72rem; color: var(--mute); text-align: right; margin-top: 3px; }
.char-count.warn { color: var(--rouge); }

/* Cat selector grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.cat-option { padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--bordure2); background: var(--surface2); cursor: pointer; text-align: center; transition: all .15s; font-size: .82rem; font-weight: 600; }
.cat-option:hover { border-color: var(--violet); }
.cat-option.selected { background: rgba(139,92,246,.12); border-color: var(--violet); color: var(--violet2); }
.cat-option input { display: none; }

/* Anon toggle */
.anon-toggle { display: flex; gap: 8px; }
.anon-option { flex: 1; padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--bordure2); background: var(--surface2); cursor: pointer; text-align: center; transition: all .15s; font-size: .82rem; font-weight: 600; }
.anon-option.selected { background: rgba(139,92,246,.12); border-color: var(--violet); color: var(--violet2); }
.anon-option input { display: none; }

/* ── BOUTONS ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 22px; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 700; border: none; cursor: pointer; text-decoration: none; transition: all .18s; font-family: inherit; white-space: nowrap; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 4px 20px rgba(139,92,246,.3); }
.btn--primary:hover { opacity: .9; transform: translateY(-1px); }
.btn--ghost { background: var(--surface2); border: 1px solid var(--bordure2); color: var(--texte); }
.btn--ghost:hover { border-color: var(--violet); }
.btn--sm { padding: 7px 14px; font-size: .8rem; }
.btn--full { width: 100%; }

/* ── ALERTS ──────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 16px; }
.alert--success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6EE7B7; }
.alert--error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #FCA5A5; }

/* ── VIDE ────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 20px; }
.empty__icon { font-size: 3rem; margin-bottom: 14px; }
.empty h3 { font-size: 1.1rem; margin-bottom: 8px; }
.empty p { color: var(--dim); font-size: .875rem; }

/* ── PAGINATION ──────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 28px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: var(--radius-sm); font-size: .82rem; text-decoration: none; }
.pagination a { background: var(--surface); border: 1px solid var(--bordure); color: var(--texte); }
.pagination a:hover { border-color: var(--violet); }
.pagination span { background: var(--violet); color: #fff; font-weight: 700; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header__nav { display: none; }
  .hero { padding: 40px 16px 28px; }
  .container, .container--lg { padding: 0 14px; }
  .confession-card { padding: 16px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
