/* ═══════════════════════════════════════════════════════════
   Collectif des Payeurs — Widget Discord (style Discord natif)
   ═══════════════════════════════════════════════════════════ */

.cdpd-wrap {
    /* Palette Discord */
    --dc-bg:        #313338;
    --dc-bg2:       #2b2d31;
    --dc-bg3:       #1e1f22;
    --dc-surface:   #383a40;
    --dc-border:    rgba(255,255,255,.06);
    --dc-text:      #dbdee1;
    --dc-muted:     #949ba4;
    --dc-blurple:   #5865F2;
    --dc-green:     #23a55a;
    --dc-online:    #23a55a;
    --dc-offline:   #80848e;
    --dc-total:     #949ba4;
    --r:            8px;
    --shadow:       0 8px 32px rgba(0,0,0,.4);

    font-family: 'Inter', 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    color: var(--dc-text);
}

.cdpd-wrap *, .cdpd-wrap *::before, .cdpd-wrap *::after { box-sizing: border-box; }

/* Reset boutons Elementor */
.cdpd-wrap [type="button"],
.cdpd-wrap button {
    background-color: transparent !important;
    border: none !important;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border-radius: 0 !important;
}

/* ════════════════════════════════════════════════════════════
   CARTE PRINCIPALE
════════════════════════════════════════════════════════════ */
.cdpd-card {
    background: var(--dc-bg2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--dc-border);
    max-width: 320px;
}

/* ── Barre de titre ────────────────────────────────────────── */
.cdpd-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--dc-bg3);
    padding: 14px 16px;
    border-bottom: 1px solid var(--dc-border);
}

.cdpd-titlebar-ico {
    width: 36px;
    height: 36px;
    background: var(--dc-blurple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cdpd-titlebar-ico svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.cdpd-titlebar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cdpd-server-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cdpd-server-tag {
    font-size: 11px;
    color: var(--dc-muted);
    font-weight: 500;
}

.cdpd-refresh-btn {
    width: 28px;
    height: 28px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--dc-surface) !important;
    border-radius: 6px !important;
    flex-shrink: 0;
    transition: background .15s;
}

.cdpd-refresh-btn svg {
    width: 13px;
    height: 13px;
    stroke: var(--dc-muted);
    transition: transform .3s;
}

.cdpd-refresh-btn:hover { background: rgba(255,255,255,.1) !important; }
.cdpd-refresh-btn:hover svg { stroke: var(--dc-text); }
.cdpd-refresh-btn.is-spinning svg { animation: cdpd-spin .7s linear infinite; }
@keyframes cdpd-spin { to { transform: rotate(360deg); } }

/* ── Corps ─────────────────────────────────────────────────── */
.cdpd-body {
    padding: 20px 16px 16px;
}

/* Compteurs */
.cdpd-counters {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    background: var(--dc-bg3);
    border-radius: var(--r);
    overflow: hidden;
}

.cdpd-counter {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 16px 12px;
}

.cdpd-counter-sep {
    width: 1px;
    height: 40px;
    background: var(--dc-border);
    flex-shrink: 0;
}

.cdpd-counter-val {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -.02em;
}

.cdpd-counter-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--dc-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Points de statut */
.cdpd-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cdpd-dot--online { background: var(--dc-online); box-shadow: 0 0 0 2px rgba(35,165,90,.25); }
.cdpd-dot--total  { background: var(--dc-total); }

/* Barre de membres avatars factices */
.cdpd-member-bar {
    position: relative;
    height: 32px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.cdpd-member-avatar {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--dc-bg2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    z-index: 1;
}

/* Z-index décroissant pour effet pile */
.cdpd-member-avatar:nth-child(1) { z-index: 7; }
.cdpd-member-avatar:nth-child(2) { z-index: 6; }
.cdpd-member-avatar:nth-child(3) { z-index: 5; }
.cdpd-member-avatar:nth-child(4) { z-index: 4; }
.cdpd-member-avatar:nth-child(5) { z-index: 3; }
.cdpd-member-avatar:nth-child(6) { z-index: 2; }
.cdpd-member-avatar:nth-child(7) { z-index: 1; }

.cdpd-member-more {
    position: absolute;
    left: calc(7 * 22px);
    background: var(--dc-surface);
    color: var(--dc-muted);
    border: 2px solid var(--dc-bg2);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    white-space: nowrap;
    z-index: 0;
    line-height: 22px;
}

/* Erreur */
.cdpd-error-msg {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--dc-muted);
    margin: 0;
    padding: 12px 0;
}
.cdpd-error-msg svg { flex-shrink: 0; stroke: var(--dc-muted); }

/* ── Pied de carte ─────────────────────────────────────────── */
.cdpd-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--dc-bg3);
    border-top: 1px solid var(--dc-border);
}

.cdpd-footer-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--dc-muted);
}

.cdpd-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.cdpd-status--ok  { background: var(--dc-online); }
.cdpd-status--err { background: #ed4245; }

.cdpd-footer-refresh {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--dc-muted);
}

/* ════════════════════════════════════════════════════════════
   MODE COMPACT (pill)
════════════════════════════════════════════════════════════ */
.cdpd-compact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--dc-bg2);
    border: 1px solid var(--dc-border);
    border-radius: 40px;
    padding: 7px 14px 7px 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.cdpd-compact-icon {
    width: 28px;
    height: 28px;
    background: var(--dc-blurple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cdpd-compact-icon svg {
    width: 15px;
    height: 15px;
    fill: #ffffff;
}

.cdpd-compact-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cdpd-compact-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.cdpd-compact-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--dc-muted);
}

.cdpd-unavail { font-style: italic; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
    .cdpd-card { max-width: 100%; }
    .cdpd-counter-val { font-size: 20px; }
    .cdpd-member-bar { display: none; }
}
