/* ==========================================================
   components.css — Composants réutilisables front-end
   ========================================================== */

/* --- Badges ----------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.badge-user          { background: rgba(99,88,197,.12); color: #5247b0; }
.badge-professional  { background: rgba(16,185,129,.12); color: #065f46; }
.badge-collectivity  { background: rgba(245,158,11,.12); color: #92400e; }
.badge-influencer    { background: rgba(236,72,153,.12); color: #9d174d; }

/* --- Alertes ---------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm, 6px);
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: .1rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: rgba(99,88,197,.08); color: #3730a3; border: 1px solid rgba(99,88,197,.25); }

/* --- Tooltip ---------------------------------------------- */
[data-tooltip] {
    position: relative;
    cursor: help;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-fg, #1a1a2e);
    color: white;
    padding: .3rem .7rem;
    border-radius: 6px;
    font-size: .75rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* --- Skeleton loader -------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-anim 1.5s infinite;
    border-radius: 6px;
}
@keyframes skeleton-anim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Divider espace -------------------------------------- */
.divider {
    border: none;
    border-top: 1px solid var(--color-border, #e5e7eb);
    margin-block: 2rem;
}

/* --- Tag de segment visible sur les cartes ---------------- */
.segment-tag {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: .5rem;
}
.segment-tag-user          { background: rgba(99,88,197,.1);  color: var(--color-accent, #6358c5); }
.segment-tag-professional  { background: rgba(16,185,129,.1); color: #059669; }
.segment-tag-collectivity  { background: rgba(245,158,11,.1); color: #d97706; }

/* --- Bouton icône ----------------------------------------- */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm, 6px);
    border: none;
    cursor: pointer;
    transition: background .2s, transform .15s;
    background: transparent;
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon:hover { transform: scale(1.08); }
.btn-danger { color: #ef4444; }
.btn-danger:hover { background: #fee2e2; }

/* --- Progress bar ----------------------------------------- */
.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: var(--color-border, #e5e7eb);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--color-accent, #6358c5);
    transition: width .5s ease;
}

/* --- Pagination ------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .4rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.page-btn {
    padding: .4rem .75rem;
    border-radius: var(--radius-sm, 6px);
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-accent, #6358c5);
    background: white;
    border: 1.5px solid var(--color-border, #e5e7eb);
    text-decoration: none;
    transition: background .2s, border-color .2s;
}
.page-btn:hover, .page-btn.active {
    background: var(--color-accent, #6358c5);
    border-color: var(--color-accent, #6358c5);
    color: white;
}
