/* =========================================================================
   MatchHub — CSS Global (variables, reset partiel, utilitaires)
   ========================================================================= */

:root {
  --mh-bg:            #0f0f1a;
  --mh-bg-card:       #1a1a2e;
  --mh-bg-elevated:   #1e1e3a;
  --mh-border:        rgba(255,255,255,.08);
  --mh-text:          #e2e8f0;
  --mh-text-muted:    #94a3b8;
  --mh-text-faint:    #64748b;
  --mh-primary:       #7c3aed;
  --mh-primary-light: #a78bfa;
  --mh-secondary:     #2563eb;
  --mh-accent:        #ec4899;
  --mh-success:       #10b981;
  --mh-warning:       #f59e0b;
  --mh-danger:        #ef4444;
  --mh-radius:        12px;
  --mh-radius-sm:     8px;
  --mh-shadow:        0 4px 24px rgba(0,0,0,.4);
  --mh-transition:    .2s ease;
  --mh-gradient:      linear-gradient(135deg, var(--mh-primary), var(--mh-secondary));
}

/* ---- Boutons ---- */
.mh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--mh-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--mh-transition), transform var(--mh-transition);
  white-space: nowrap;
}
.mh-btn:hover  { opacity: .88; transform: translateY(-1px); }
.mh-btn:active { transform: translateY(0); }
.mh-btn:disabled, .mh-btn--disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.mh-btn--primary { background: var(--mh-gradient); color: #fff; }
.mh-btn--ghost   { background: transparent; color: var(--mh-text); border: 1px solid var(--mh-border); }
.mh-btn--ghost:hover { border-color: var(--mh-primary-light); color: var(--mh-primary-light); }
.mh-btn--danger  { background: var(--mh-danger); color: #fff; }
.mh-btn--sm      { padding: 6px 14px; font-size: 13px; }
.mh-btn--lg      { padding: 14px 28px; font-size: 16px; }
.mh-btn--full    { width: 100%; }

/* ---- Champs ---- */
.mh-field { display: flex; flex-direction: column; gap: 6px; }
.mh-field label { font-size: 13px; font-weight: 600; color: var(--mh-text-muted); }
.mh-field input,
.mh-field select,
.mh-field textarea {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-sm);
  color: var(--mh-text);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: border-color var(--mh-transition);
  box-sizing: border-box;
}
.mh-field input:focus,
.mh-field select:focus,
.mh-field textarea:focus {
  outline: none;
  border-color: var(--mh-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
.mh-field select option { background: #1e1e2e; }
.mh-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mh-required { color: var(--mh-accent); }

/* ---- Cartes ---- */
.mh-card {
  background: var(--mh-bg-card);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  padding: 20px;
  box-shadow: var(--mh-shadow);
}

/* ---- Badges ---- */
.mh-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.mh-badge--online     { background: rgba(16,185,129,.2); color: #10b981; }
.mh-badge--offline    { background: rgba(100,116,139,.15); color: #64748b; }
.mh-badge--generation { background: rgba(124,58,237,.2); color: var(--mh-primary-light); }
.mh-badge--online-text { background: rgba(16,185,129,.2); color: #10b981; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.mh-badge--tag  { font-size: 12px; }
.mh-badge--dot {
  width: 10px; height: 10px; border-radius: 50%;
  padding: 0; border: 2px solid var(--mh-bg-card);
}
.mh-badge--dot.mh-badge--online  { background: #10b981; }
.mh-badge--dot.mh-badge--offline { background: #64748b; }
.mh-badge--dot.mh-badge--sm { width: 8px; height: 8px; }
.mh-badge--dot.mh-badge--lg { width: 14px; height: 14px; border-width: 3px; }

/* ---- Chips / Tags ---- */
.mh-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--mh-border);
  background: rgba(255,255,255,.04);
  color: var(--mh-text-muted);
  cursor: pointer;
  transition: all var(--mh-transition);
  user-select: none;
  min-height: 44px;
}
.mh-chip:hover { border-color: var(--mh-primary); color: var(--mh-text); }
.mh-chip.is-selected { background: rgba(124,58,237,.25); border-color: var(--mh-primary); color: var(--mh-primary-light); }
.mh-chip.is-readonly { cursor: default; }
.mh-chip__input { display: none; }

.mh-interest-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }

/* ---- Tags ---- */
.mh-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--mh-border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--mh-text-muted);
}

/* ---- Spinner ---- */
.mh-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(124,58,237,.2);
  border-top-color: var(--mh-primary);
  border-radius: 50%;
  animation: mh-spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes mh-spin { to { transform: rotate(360deg); } }

/* ---- État vide ---- */
.mh-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--mh-text-muted);
}
.mh-empty-state__icon { display: block; font-size: 48px; margin-bottom: 16px; }
.mh-empty-state p { margin: 8px 0; }

/* ---- Alertes ---- */
.mh-alert {
  padding: 12px 16px;
  border-radius: var(--mh-radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.mh-alert--warning { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.3); color: #fbbf24; }
.mh-alert--success { background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.3); color: #34d399; }
.mh-alert--error   { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.3);  color: #f87171; }
.mh-alert a { color: inherit; text-decoration: underline; }

/* ---- Toast ---- */
.mh-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--mh-bg-elevated);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-sm);
  padding: 12px 20px;
  color: var(--mh-text);
  font-size: 14px;
  box-shadow: var(--mh-shadow);
  z-index: 9999;
  animation: mh-toast-in .2s ease;
}
.mh-toast--success { border-color: var(--mh-success); }
.mh-toast--error   { border-color: var(--mh-danger); }
@keyframes mh-toast-in { from { opacity:0; transform:translateY(12px); } }

/* ---- Modal ---- */
.mh-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 16px;
}
.mh-modal__inner {
  background: var(--mh-bg-card);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  padding: 28px;
  max-width: 480px;
  width: 100%;
}
.mh-modal__inner h3 { margin: 0 0 20px; font-size: 20px; }

/* ---- Bannière invitée ---- */
.mh-guest-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--mh-gradient);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 9990;
  box-shadow: 0 -4px 24px rgba(0,0,0,.3);
}
.mh-guest-banner__text { flex: 1; font-size: 14px; margin: 0; }
.mh-guest-banner__close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  opacity: .7;
}
.mh-guest-banner__close:hover { opacity: 1; }

/* ---- Lightbox ---- */
.mh-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.mh-lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}
.mh-lightbox__close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: .8;
}

/* ---- CTA blocs ---- */
.mh-cta-block {
  background: var(--mh-bg-elevated);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  padding: 32px;
  text-align: center;
}
.mh-cta-block__title { font-size: 22px; font-weight: 700; color: var(--mh-text); margin-bottom: 8px; }
.mh-cta-block__text  { color: var(--mh-text-muted); margin-bottom: 20px; }

/* ---- Navigation notif + avatar ---- */
.mh-nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ---- Btn like ---- */
.mh-btn--like {
  background: rgba(236,72,153,.1);
  border: 1px solid rgba(236,72,153,.3);
  color: #f9a8d4;
  padding: 10px 18px;
  border-radius: var(--mh-radius-sm);
  transition: all var(--mh-transition);
}
.mh-btn--like:hover,
.mh-btn--like.is-liked {
  background: rgba(236,72,153,.25);
  border-color: var(--mh-accent);
  color: var(--mh-accent);
}

/* ---- Section titre ---- */
.mh-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--mh-text);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--mh-border);
}
.mh-page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--mh-text);
  margin: 0 0 24px;
}

/* ---- Galerie ---- */
.mh-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mh-gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--mh-radius-sm);
  background: rgba(255,255,255,.04);
}
.mh-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.mh-gallery-item:hover img { transform: scale(1.05); }
.mh-gallery-add {
  aspect-ratio: 1;
  border: 2px dashed var(--mh-border);
  border-radius: var(--mh-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--mh-text-faint);
  transition: border-color var(--mh-transition);
  gap: 4px;
}
.mh-gallery-add:hover { border-color: var(--mh-primary); color: var(--mh-primary); }
.mh-gallery-add span { font-size: 28px; }
.mh-gallery-delete {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,.7);
  border: none;
  color: #fff;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.mh-gallery-item:hover .mh-gallery-delete { display: flex; }

/* ---- Verifié badge ---- */
.mh-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--mh-success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}

/* ---- Responsive global ---- */
@media (max-width: 600px) {
  .mh-field-row { grid-template-columns: 1fr; }
  .mh-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .mh-guest-banner { flex-wrap: wrap; }
  .mh-guest-banner__text { flex: 1 1 100%; }
}

/* ---- Match popup ---- */
.mh-match-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: mh-fade-in .3s ease;
}
.mh-match-popup__inner {
  background: var(--mh-bg-card);
  border: 1px solid var(--mh-border);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 60px rgba(124,58,237,.3);
}
.mh-match-popup__confetti { font-size: 48px; margin-bottom: 8px; }
.mh-match-popup__title {
  font-size: 28px;
  font-weight: 800;
  background: var(--mh-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 20px;
}
.mh-match-popup__avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.mh-match-popup__avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--mh-primary);
}
.mh-match-popup__heart { font-size: 32px; }
.mh-match-popup__text { color: var(--mh-text-muted); margin-bottom: 24px; }
.mh-match-popup__actions { display: flex; flex-direction: column; gap: 10px; }

@keyframes mh-fade-in { from { opacity: 0; } }

/* ---- sr-only ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
