/* ═══════════════════════════════════════════════════════════════
   GoSortir — Design system
   Charte : Violet #6C4CF7 (principal) · Corail #FF6B6B · Jaune #FFC857
   Titres Poppins 700 · Texte Inter · Radius 20/16/14/999
   Ombres très douces · Espacement multiples de 8 · Mode sombre natif
   Esprit : convivial, spontané, vivant — "ce soir il se passe quelque chose"
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Couleurs de marque */
  --violet: #6C4CF7;
  --violet-600: #5B3EE6;
  --violet-700: #4B32C4;
  --violet-soft: #EEEAFE;
  --coral: #FF6B6B;
  --coral-soft: #FFECEC;
  --yellow: #FFC857;
  --yellow-soft: #FFF6E2;
  --success: #22C55E;
  --success-soft: #E4F8EC;
  --error: #EF4444;
  --error-soft: #FDECEC;

  /* Dégradé principal — Hero / CTA / onboarding UNIQUEMENT */
  --gradient: linear-gradient(135deg, #6C4CF7 0%, #8B5CF6 50%, #A855F7 100%);

  /* Surfaces (mode clair) */
  --bg: #FAFAFC;
  --card: #FFFFFF;
  --ink: #111827;
  --muted: #6B7280;
  --line: #ECECF2;
  --hover: #F4F4F8;

  /* Rayons */
  --r-card: 20px;
  --r-btn: 16px;
  --r-input: 14px;
  --r-pill: 999px;

  /* Ombres — très douces, jamais Bootstrap */
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, .05);
  --shadow: 0 8px 24px rgba(17, 24, 39, .07);
  --shadow-lg: 0 18px 44px rgba(17, 24, 39, .12);
  --shadow-violet: 0 10px 24px rgba(108, 76, 247, .28);

  --maxw: 1120px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --card: #1F2937;
    --ink: #F9FAFB;
    --muted: #9CA3AF;
    --line: #374151;
    --hover: #273244;
    --violet-soft: #2A2350;
    --coral-soft: #3A2430;
    --yellow-soft: #3A3320;
    --success-soft: #17301F;
    --error-soft: #3A2222;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: none; opacity: .85; }

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ink);
}
h1 { font-size: clamp(30px, 5.5vw, 52px); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 19px; }
p { margin: 0 0 12px; }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--r-btn); border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600; line-height: 1;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: 1; }
.btn-primary { background: var(--violet); color: #fff; box-shadow: var(--shadow-violet); }
.btn-primary:hover { background: var(--violet-600); transform: scale(1.03); }
.btn-primary:active { transform: scale(.99); }
.btn-secondary { background: var(--hover); color: var(--ink); }
.btn-secondary:hover { background: var(--line); transform: scale(1.03); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--hover); border-color: var(--violet); }
.btn-danger { background: transparent; color: var(--error); border: 1.5px solid rgba(239, 68, 68, .35); }
.btn-danger:hover { background: var(--error); color: #fff; border-color: var(--error); }
.btn-gradient { background: var(--gradient); color: #fff; box-shadow: var(--shadow-violet); }
.btn-gradient:hover { transform: scale(1.03); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 15px; font-size: 13px; border-radius: 12px; }
.btn-lg { padding: 16px 30px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-google {
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); width: 100%;
}
.btn-google:hover { background: var(--hover); }
.btn-google svg { width: 18px; height: 18px; }

.btn-microsoft {
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); width: 100%;
}
.btn-microsoft:hover { background: var(--hover); }
.btn-microsoft svg { width: 18px; height: 18px; }

.btn-apple {
  background: #000; color: #fff; border: 1.5px solid #000; width: 100%;
}
.btn-apple:hover { background: #1a1a1a; }
.btn-apple svg { width: 16px; height: 16px; }

/* Empile les boutons sociaux avec un léger espacement. */
.btn-google + .btn-microsoft,
.btn-google + .btn-apple,
.btn-microsoft + .btn-apple { margin-top: 10px; }

/* ── Cartes ──────────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--r-card);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line); overflow: hidden;
}
.card-body { padding: 22px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  border-radius: var(--r-pill); font-size: 13px; font-weight: 600;
  background: var(--violet-soft); color: var(--violet);
}
.badge-coral { background: var(--coral-soft); color: var(--coral); }
.badge-yellow { background: var(--yellow-soft); color: #B8860B; }
.badge-muted { background: var(--hover); color: var(--muted); }
.badge-danger { background: var(--error-soft); color: var(--error); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-glass { background: rgba(255,255,255,.92); color: var(--ink); backdrop-filter: blur(6px); }

/* ── Formulaires ─────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; color: var(--ink); }
.input, .textarea, .select {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--r-input);
  font-family: inherit; font-size: 15px; background: var(--card); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(108, 76, 247, .14);
}
.textarea { resize: vertical; min-height: 120px; }
.field-error { color: var(--error); font-size: 13px; margin-top: 6px; }
.field-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.input-invalid { border-color: var(--error); }

/* ── Navigation ──────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 21px; color: var(--ink); letter-spacing: -.03em; }
.brand:hover { opacity: 1; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gradient); color: #fff; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 21px;
  box-shadow: var(--shadow-violet);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { color: var(--ink); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 12px; }
.nav-links a:hover { background: var(--hover); opacity: 1; }
.nav-links a.active { color: var(--violet); }
.nav-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--ink); line-height: 1; }

/* ── Grille & cartes de sorties ──────────────────────────────── */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.event-card {
  display: flex; flex-direction: column; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.event-cover {
  aspect-ratio: 16 / 10; background: var(--gradient); position: relative; overflow: hidden;
}
.event-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.event-card:hover .event-cover img { transform: scale(1.05); }
.event-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(17,24,39,.38), transparent 45%); }
.event-cover .cover-top { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.event-card .card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 20px; }
.event-card h3 { margin: 0; font-size: 18px; }
.event-meta { color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 3px; margin-top: auto; padding-top: 6px; }
.event-meta .row { display: flex; align-items: center; gap: 6px; }
.event-meta strong { color: var(--ink); font-weight: 600; }

/* ── Filtres ─────────────────────────────────────────────────── */
.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: var(--r-pill);
  background: var(--card); border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--violet); transform: translateY(-1px); opacity: 1; }
.chip.active { background: var(--violet); color: #fff; border-color: var(--violet); box-shadow: var(--shadow-violet); }

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar { border-radius: 50%; object-fit: cover; background: var(--violet-soft); }
.avatar-fallback {
  border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; color: #fff;
  font-family: 'Poppins', sans-serif; background: var(--gradient);
}

/* ── Flash ───────────────────────────────────────────────────── */
.flash-stack { position: fixed; top: 80px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.alert {
  padding: 14px 18px; border-radius: var(--r-input); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: slideIn .3s var(--ease);
}
.alert-success { background: var(--success-soft); color: #15803D; border: 1px solid rgba(34,197,94,.3); }
.alert-error { background: var(--error-soft); color: #B91C1C; border: 1px solid rgba(239,68,68,.3); }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── Chat ────────────────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; height: 460px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 10px; max-width: 82%; }
.msg .bubble { background: var(--hover); padding: 10px 14px; border-radius: 16px; border-top-left-radius: 5px; }
.msg .author { font-size: 12px; font-weight: 700; color: var(--violet); margin-bottom: 2px; }
.msg .time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--violet); color: #fff; border-radius: 16px; border-top-right-radius: 5px; }
.msg.mine .author { display: none; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--card); }
.chat-form .input { border-radius: var(--r-pill); }

/* Message système grisé (X a rejoint / a quitté la salle). */
.msg-system {
  align-self: center; max-width: 90%; text-align: center;
  font-size: 12.5px; color: var(--muted); background: var(--hover);
  padding: 5px 12px; border-radius: var(--r-pill);
}
/* Indicateur « en train d'écrire ». */
.chat-typing { padding: 4px 18px; font-size: 12.5px; color: var(--muted); font-style: italic; min-height: 8px; }
.chat-muted { padding: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center; }

/* ── Couverture par défaut (dégradé + emoji par catégorie) ───── */
.cover-default { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cover-emoji { font-size: 64px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(17,24,39,.25)); }
.event-cover[style*="220px"] .cover-emoji { font-size: 88px; }

/* ── Réseaux sociaux (profil) ────────────────────────────────── */
.social-row { display: flex; flex-wrap: wrap; gap: 10px; }
.social-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--hover); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: var(--r-pill); font-size: 14px;
}
.social-chip .social-emoji { font-size: 18px; }
.social-chip .social-label { font-weight: 600; }
.social-chip a { color: var(--violet); font-weight: 600; }

/* ── Petits contrôles de formulaire (admin) ──────────────────── */
.select-sm, .input-sm { padding: 7px 10px; font-size: 13px; border-radius: 10px; }

/* ── Divers ──────────────────────────────────────────────────── */
.section { padding: 44px 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty .emoji { font-size: 52px; margin-bottom: 12px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stat { text-align: center; }
.stat .num { font-family: 'Poppins', sans-serif; font-size: 30px; font-weight: 800; color: var(--violet); }
.stat .lbl { font-size: 13px; color: var(--muted); }

/* ── Modale ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17,24,39,.55); z-index: 80; backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .2s var(--ease); }
.modal { background: var(--card); border-radius: var(--r-card); max-width: 460px; width: 100%; box-shadow: var(--shadow-lg); animation: popUp .25s var(--ease); }
.modal-head { padding: 22px 22px 0; }
.modal-body { padding: 22px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popUp { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Tables (admin) ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:hover td { background: var(--hover); }

/* ── Animations d'entrée (Fade Up) ───────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); animation: fadeUp .5s var(--ease) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
.reveal-1 { animation-delay: .05s; } .reveal-2 { animation-delay: .12s; } .reveal-3 { animation-delay: .19s; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 780px) {
  .nav-links { position: fixed; inset: 66px 0 auto 0; background: var(--bg); flex-direction: column; align-items: stretch; padding: 12px 20px; border-bottom: 1px solid var(--line); display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .flash-stack { left: 20px; right: 20px; max-width: none; }
}
