/* ═══════════════════════════════════════════════
   Buildeurs.com — Feuille de style partagée
   ═══════════════════════════════════════════════ */

:root {
  --primary:       #7c3aed;
  --primary-dark:  #5b21b6;
  --primary-light: #8b5cf6;
  --primary-bg:    #ede9fe;
  --accent:        #f59e0b;
  --green:         #10b981;
  --red:           #ef4444;
  --blue:          #3b82f6;
  --amber:         #f59e0b;  /* alias de --accent */
  --text:          #1e1b4b;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --bg:            #f8f7ff;
  --white:         #ffffff;
  --shadow:        0 4px 24px rgba(91,33,182,.1);
  --shadow-hover:  0 8px 32px rgba(91,33,182,.18);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     5px;
  --nav-h:         64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text); background: var(--white); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ── Utilitaires ── */
.container    { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 860px;  margin: 0 auto; padding: 0 24px; }
.section      { padding: 72px 0; }
.section-alt  { background: var(--bg); }

.section-header { margin-bottom: 40px; }
.section-header.center { text-align: center; }
.section-label  { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); background: var(--primary-bg); padding: 4px 12px; border-radius: 99px; margin-bottom: 12px; }
.section-title  { font-size: clamp(24px, 3vw, 34px); font-weight: 900; color: var(--text); margin-bottom: 10px; }
.section-sub    { font-size: 16px; color: var(--text-muted); max-width: 560px; }
.section-header.center .section-sub { margin: 0 auto; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-purple { background: var(--primary-bg); color: var(--primary); }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* ── Boutons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; transition: all .2s; cursor: pointer; border: none; }
.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 14px 28px; font-size: 15px; }
.btn-xl  { padding: 16px 36px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary  { background: var(--primary-light); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(91,33,182,.3); }
.btn-outline  { background: transparent; color: var(--primary); border: 2px solid var(--primary-light); }
.btn-outline:hover  { background: var(--primary-light); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); }
.btn-ghost:hover    { background: var(--bg); color: var(--text); }
.btn-white    { background: #fff; color: var(--primary); font-weight: 700; }
.btn-white:hover    { background: var(--primary-bg); }
.btn-accent   { background: var(--accent); color: #fff; }
.btn-accent:hover   { background: #d97706; transform: translateY(-1px); }
.btn-green    { background: var(--green); color: #fff; }
.btn-green:hover    { background: #059669; }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover   { background: #dc2626; }

/* ── Formulaires ── */
.form-group    { margin-bottom: 18px; }
.form-label    { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-label span { color: var(--red); margin-left: 2px; }
.form-control  { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; color: var(--text); background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.form-control:focus  { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
.form-control::placeholder { color: #9ca3af; }
textarea.form-control { resize: vertical; min-height: 110px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.form-control.error { border-color: var(--red); }
.form-control.error + .form-error { display: block; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.logo { font-size: 20px; font-weight: 900; color: var(--primary); letter-spacing: -.5px; flex-shrink: 0; }
.logo span { color: var(--accent); }
.nav-sep { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
.nav-links { display: flex; gap: 4px; }
.nav-link { font-size: 14px; font-weight: 500; color: var(--text-muted); padding: 6px 12px; border-radius: var(--radius-xs); transition: all .2s; }
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-bg); }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-publish { font-size: 13px; font-weight: 700; color: #fff; background: var(--primary-light); padding: 8px 18px; border-radius: var(--radius-sm); transition: all .2s; }
.nav-publish:hover { background: var(--primary-dark); }
.nav-login  { font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 8px 14px; border-radius: var(--radius-sm); transition: all .2s; }
.nav-login:hover { background: var(--bg); color: var(--primary); }
.nav-register { font-size: 13px; font-weight: 600; color: var(--primary); border: 1.5px solid var(--primary-light); padding: 7px 14px; border-radius: var(--radius-sm); transition: all .2s; }
.nav-register:hover { background: var(--primary-light); color: #fff; }
/* Badge messages non lus */
.nav-msgs { position: relative; padding: 6px 10px !important; }
.msg-badge { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; }
/* Notifications */
.notif-wrap { position: relative; }
.notif-bell { background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: var(--radius-xs); font-size: 18px; line-height: 1; position: relative; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.notif-bell:hover { background: var(--bg); }
.notif-badge { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; pointer-events: none; }
.notif-panel { display: none; position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.12); z-index: 300; overflow: hidden; }
.notif-panel.open { display: block; }
.notif-head { padding: 12px 16px; font-size: 12px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background .15s; align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #f5f3ff; }
.notif-item.unread:hover { background: #ede9fe; }
.notif-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 12px; font-weight: 700; line-height: 1.4; margin-bottom: 2px; }
.notif-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.notif-empty { padding: 28px 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.notif-footer { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); font-size: 12px; }

/* hamburger mobile */
.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 6px; cursor: pointer; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s; }
/* Animation burger → X */
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Footer ── */
footer { background: var(--text); color: rgba(255,255,255,.75); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3,1fr); gap: 40px; margin-bottom: 40px; }
.footer-brand .logo { font-size: 22px; color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; color: rgba(255,255,255,.5); line-height: 1.7; max-width: 220px; }
.footer-col h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.9); margin-bottom: 14px; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: rgba(255,255,255,.55); transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.35); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12px; color: rgba(255,255,255,.35); }
.footer-links a:hover { color: rgba(255,255,255,.7); }
/* ── Cards génériques ── */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: box-shadow .2s, border-color .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); border-color: #c4b5fd; }
.card-clickable { cursor: pointer; }
.card-clickable:hover { transform: translateY(-2px); }

/* ── Filtres latéraux ── */
.filter-sidebar { width: 240px; flex-shrink: 0; }
.filter-block { margin-bottom: 24px; }
.filter-block h4 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 13px; color: var(--text-muted); transition: color .2s; }
.filter-option:hover { color: var(--primary); }
.filter-option input[type=checkbox], .filter-option input[type=radio] { accent-color: var(--primary); width: 14px; height: 14px; cursor: pointer; }
.filter-option.active { color: var(--primary); font-weight: 600; }
.filter-count { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 1px 7px; border-radius: 99px; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 40px; }
.page-btn { width: 36px; height: 36px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; }
.page-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.page-btn.active { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 28px; }
.tab-btn { padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Avatar ── */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; background: var(--primary-light); color: #fff; flex-shrink: 0; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.avatar-lg { width: 72px; height: 72px; font-size: 28px; }
.avatar-xl { width: 96px; height: 96px; font-size: 36px; }

/* ── Stars ── */
.stars { color: var(--accent); letter-spacing: 1px; }
.rating { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.rating-num { font-weight: 700; }
.rating-count { color: var(--text-muted); }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1e1b4b; color: #fff; padding: 12px 22px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,.2); transform: translateY(24px); opacity: 0; transition: all .35s cubic-bezier(.34,1.56,.64,1); pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

/* ── Scroll top ── */
#scrollTop { position: fixed; bottom: 28px; right: 28px; z-index: 200; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-light); color: #fff; border: none; cursor: pointer; font-size: 18px; box-shadow: 0 4px 16px rgba(91,33,182,.35); opacity: 0; pointer-events: none; transition: all .3s; display: flex; align-items: center; justify-content: center; }
#scrollTop.visible { opacity: 1; pointer-events: all; }
#scrollTop:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ── Page hero interne ── */
.page-hero { background: linear-gradient(135deg, #1e1b4b 0%, var(--primary-dark) 100%); padding: 48px 0; color: #fff; }
.page-hero h1 { font-size: clamp(24px,3vw,36px); font-weight: 900; margin-bottom: 8px; }
.page-hero p  { color: rgba(255,255,255,.75); font-size: 15px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filter-sidebar { width: 100%; }
}
@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .container, .container-sm { padding: 0 16px; }
}
@media (max-width: 640px) {
  .section { padding: 40px 0; }
  /* Masquer la nav desktop, afficher le burger */
  .nav-links, .nav-sep, .nav-register, .nav-login { display: none; }
  .nav-burger { display: flex; }
  /* Sur mobile : cacher "Mon espace", "Publier", avatar dans la barre — restent dans le menu burger */
  .nav-actions .nav-link:not(.nav-msgs), .nav-publish, .nav-user-av { display: none !important; }
  /* Footer mono-colonne sur mobile */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  /* Hero page interne plus compact */
  .page-hero { padding: 32px 0; }
  .page-hero h1 { font-size: 22px; }
  /* Boutons pleine largeur sur petits écrans */
  .btn-block-mobile { width: 100%; }
  /* Formulaires */
  .form-row { grid-template-columns: 1fr; }
  /* Tables scroll horizontal */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Menu hamburger — liens en pleine largeur */
  .mobile-auth a { display: block !important; padding: 10px 12px !important; font-size: 14px !important; font-weight: 600 !important; border-radius: 6px; transition: background .15s; }
  .mobile-auth a:hover { background: var(--bg); }
}
@media (max-width: 400px) {
  .container, .container-sm { padding: 0 12px; }
  .btn-lg { padding: 12px 20px; font-size: 14px; }
  .section-title { font-size: 20px; }
}
