/**
 * NovaPress Users — nova-users.css
 * Styles passe-partout pour les pages membres.
 * Hérite des couleurs du thème actif — zéro couleur forcée.
 * Zéro !important — jamais.
 * Préfixe : nova-user-
 *
 * @package NovaPress
 * @since 8.5
 */


/* ============================================================
   1. CSS VARIABLES — fallbacks neutres, écrasées par le thème
   ============================================================ */

:root {
    --nova-user-radius: 8px;
    --nova-user-gap: 1.25rem;
    --nova-user-avatar-size: 120px;
    --nova-user-avatar-size-mobile: 88px;
    --nova-user-max-width: 780px;
    --nova-user-border-color: rgba(128, 128, 128, 0.15);
    --nova-user-bg-subtle: rgba(128, 128, 128, 0.04);
    --nova-user-text-muted: rgba(128, 128, 128, 0.65);
}


/* ============================================================
   2. PROFILE — Container principal
   ============================================================ */

.nova-user-profile {
    max-width: var(--nova-user-max-width);
    margin: 2rem auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--nova-user-radius);
}


/* ============================================================
   3. PROFILE HEADER — Avatar + identité
   ============================================================ */

.nova-user-header {
    display: flex;
    align-items: flex-start;
    gap: var(--nova-user-gap);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--nova-user-border-color);
}

.nova-user-avatar {
    flex-shrink: 0;
    width: var(--nova-user-avatar-size);
    height: var(--nova-user-avatar-size);
    border-radius: 50%;
    object-fit: cover;
}

.nova-user-identity {
    flex: 1;
    min-width: 0;
}

.nova-user-display-name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.25rem;
}

.nova-user-role {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15em 0.6em;
    border-radius: 3px;
    border: 1px solid var(--nova-user-border-color);
    color: inherit;
    opacity: 0.7;
}

.nova-user-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: inherit;
    opacity: 0.6;
}

.nova-user-meta-line span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Followers / Following — conditionnel NovaFeed */
.nova-user-social-counts {
    display: flex;
    gap: 1rem;
    margin-top: 0.6rem;
    font-size: 0.875rem;
}

.nova-user-social-counts a {
    text-decoration: none;
    color: inherit;
}

.nova-user-social-counts a:hover {
    text-decoration: underline;
}

.nova-user-social-counts strong {
    font-weight: 700;
}

/* Follow button — conditionnel NovaFeed */
.nova-user-follow-btn {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.35em 1.1em;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--nova-user-radius);
    border: 1px solid currentColor;
    color: inherit;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.nova-user-follow-btn:hover {
    opacity: 0.75;
}

.nova-user-follow-btn.nova-user-following {
    opacity: 0.5;
}


/* ============================================================
   4. BIO
   ============================================================ */

.nova-user-bio {
    padding: 1.25rem 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

.nova-user-bio:empty {
    display: none;
}


/* ============================================================
   5. NETWORK — Website, Mastodon, Lemmy (icon-based)
   ============================================================ */

.nova-user-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.nova-user-network {
    padding: 1rem 0;
    border-top: 1px solid var(--nova-user-border-color);
}

.nova-user-network-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nova-user-network-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.nova-user-network-item:hover {
    opacity: 1;
}

.nova-user-network-item img {
    border-radius: 4px;
}


/* ============================================================
   6. SECTIONS — Stats, Recent posts, etc.
   ============================================================ */

.nova-user-section {
    padding: 1.25rem 0;
    border-top: 1px solid var(--nova-user-border-color);
}

.nova-user-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.75rem;
    opacity: 0.55;
}


/* ============================================================
   7. STATS GRID — Topics, Replies, Comments, etc.
   ============================================================ */

.nova-user-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.nova-user-stat {
    flex: 1 1 auto;
    min-width: 100px;
    padding: 0.75rem 1rem;
    border-radius: var(--nova-user-radius);
    background: var(--nova-user-bg-subtle);
    text-align: center;
}

.nova-user-stat-value {
    display: block;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.2;
}

.nova-user-stat-label {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.15rem;
    opacity: 0.6;
}


/* ============================================================
   8. ACTIVITY LISTS — Recent topics, replies, comments
   ============================================================ */

.nova-user-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nova-user-activity-list li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
    border-bottom: 1px solid var(--nova-user-border-color);
}

.nova-user-activity-list li:last-child {
    border-bottom: none;
}

.nova-user-activity-list a {
    text-decoration: none;
}

.nova-user-activity-list a:hover {
    text-decoration: underline;
}

.nova-user-activity-date {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-left: 0.5rem;
}


/* ============================================================
   9. EDIT PROFILE BUTTON (on public profile)
   ============================================================ */

.nova-user-edit-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5em 1.25em;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--nova-user-radius);
    border: 1px solid currentColor;
    color: inherit;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.nova-user-edit-btn:hover {
    opacity: 0.75;
}


/* ============================================================
   10. FORUM SIGNATURE — conditionnel NovaFlow
   ============================================================ */

.nova-user-signature {
    padding: 1rem 0;
    border-top: 1px solid var(--nova-user-border-color);
    font-size: 0.8125rem;
    font-style: italic;
    opacity: 0.65;
}

.nova-user-signature:empty {
    display: none;
}


/* ============================================================
   11. RESPONSIVE — Profil
   ============================================================ */

@media (max-width: 600px) {
    .nova-user-profile {
        padding: 1.5rem 0.75rem;
        margin: 0 auto;
        border-radius: 0;
    }

    .nova-user-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .nova-user-avatar {
        width: var(--nova-user-avatar-size-mobile);
        height: var(--nova-user-avatar-size-mobile);
    }

    .nova-user-display-name {
        font-size: 1.25rem;
    }

    .nova-user-meta-line {
        justify-content: center;
    }

    .nova-user-social-counts {
        justify-content: center;
    }

    .nova-user-links {
        justify-content: center;
    }

    .nova-user-stats {
        gap: 0.5rem;
    }

    .nova-user-stat {
        min-width: 80px;
        padding: 0.6rem 0.75rem;
    }

    .nova-user-stat-value {
        font-size: 1.125rem;
    }
}


/* ============================================================
   12. MEMBERS DIRECTORY — Annuaire
   ============================================================ */

.nova-user-members {
    max-width: var(--nova-user-max-width);
    margin: 2rem auto;
    padding: 1.5rem;
}

.nova-user-members h1 {
    margin: 0 0 1.25rem;
}

.nova-user-members-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.nova-user-members-filters input,
.nova-user-members-filters select {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--nova-user-border-color);
    border-radius: var(--nova-user-radius);
    font-size: 0.875rem;
    box-sizing: border-box;
    background: #fff;
}

.nova-user-members-filters .nova-user-btn {
    padding: 8px 20px;
    background: #096e09;
    color: #fff;
    border: none;
    border-radius: var(--nova-user-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.nova-user-members-filters .nova-user-btn:hover {
    background: #065206;
}

.nova-user-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.nova-user-member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: #fff;
    border: 1px solid var(--nova-user-border-color);
    border-radius: var(--nova-user-radius);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.nova-user-member-card:hover {
    border-color: #096e09;
    box-shadow: 0 2px 12px rgba(9, 110, 9, 0.08);
}

.nova-user-member-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.nova-user-member-info {
    text-align: center;
    margin-top: 10px;
}

.nova-user-member-name {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
}

.nova-user-member-role {
    display: block;
    font-size: 0.75rem;
    margin-top: 2px;
    opacity: 0.55;
}

.nova-user-no-results {
    text-align: center;
    opacity: 0.55;
    padding: 2.5rem 0;
}

.nova-user-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 1.5rem;
}

.nova-user-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--nova-user-border-color);
    border-radius: var(--nova-user-radius);
    text-decoration: none;
    color: inherit;
    font-size: 0.875rem;
}

.nova-user-page-link:hover {
    border-color: #096e09;
    color: #096e09;
}

.nova-user-page-current {
    background: #096e09;
    color: #fff;
    border-color: #096e09;
}

.nova-user-page-current:hover {
    color: #fff;
}


/* ============================================================
   13. RESPONSIVE — Members Directory
   ============================================================ */

@media (max-width: 600px) {
    .nova-user-members {
        padding: 1rem 0.75rem;
        margin: 0 auto;
    }

    .nova-user-members-filters {
        flex-direction: column;
    }

    .nova-user-members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .nova-user-member-card {
        padding: 14px 8px;
    }
}


/* ============================================================
   14. EDIT PROFILE FORM
   ============================================================ */

.nova-user-edit-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.nova-user-edit-notice {
    padding: 10px 14px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: var(--nova-user-radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.nova-user-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nova-user-edit-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nova-user-edit-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.7;
}

.nova-user-edit-field input[type="text"],
.nova-user-edit-field input[type="url"],
.nova-user-edit-field input[type="password"],
.nova-user-edit-field textarea,
.nova-user-edit-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--nova-user-border-color);
    border-radius: var(--nova-user-radius);
    font-size: 0.875rem;
    box-sizing: border-box;
    background: #fff;
    font-family: inherit;
}

.nova-user-edit-field textarea {
    resize: vertical;
    min-height: 60px;
}

.nova-user-edit-row {
    display: flex;
    gap: 1rem;
}

.nova-user-edit-row .nova-user-edit-field {
    flex: 1;
}

.nova-user-edit-submit {
    align-self: flex-start;
    padding: 10px 28px;
    background: #096e09;
    color: #fff;
    border: none;
    border-radius: var(--nova-user-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

.nova-user-edit-submit:hover {
    background: #065206;
}

.nova-user-edit-counter {
    font-size: 0.8125rem;
    color: #666;
    font-weight: 400;
    margin-left: 0.5rem;
}

.nova-user-edit-row-3 {
    display: flex;
    gap: 0.5rem;
}

.nova-user-edit-row-3 input {
    flex: 1;
    min-width: 0;
}

.nova-user-edit-skill {
    text-transform: capitalize;
}

.nova-user-edit-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: var(--nova-user-radius);
    font-size: 0.9375rem;
    background: #fff;
}

.nova-user-edit-back {
    display: inline-block;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: inherit;
    opacity: 0.6;
}

.nova-user-edit-back:hover {
    opacity: 1;
}

/* NovaLock keyboard inside edit form — inherits from novalock-auth styles */
.nova-user-edit-field .nl-dots {
    text-align: left;
    margin: 6px 0;
    font-size: 20px;
    letter-spacing: 5px;
}

.nova-user-edit-field .nl-dots .d {
    color: #ccc;
    transition: .15s;
}

.nova-user-edit-field .nl-dots .d.on {
    color: #096e09;
}

.nova-user-edit-field .nl-keys {
    text-align: left;
    margin: 6px 0;
}

.nova-user-edit-field .nl-k {
    display: inline-block;
    margin: 3px;
    padding: 0;
    border: 1px solid var(--nova-user-border-color);
    border-radius: var(--nova-user-radius);
    cursor: pointer;
    background: #fff;
    vertical-align: top;
}

.nova-user-edit-field .nl-k img {
    width: 48px;
    height: 48px;
    display: block;
    pointer-events: none;
}

.nova-user-edit-field .nl-k:hover {
    background: var(--nova-user-bg-subtle);
}

.nova-user-edit-field .nl-kba {
    text-align: left;
    margin: 4px 0;
}

.nova-user-edit-field .nl-btn-sm {
    padding: 4px 12px;
    background: var(--nova-user-bg-subtle);
    color: inherit;
    border: 1px solid var(--nova-user-border-color);
    border-radius: var(--nova-user-radius);
    cursor: pointer;
    font-size: 0.8125rem;
}


.nova-user-admin-reset-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--nova-user-border-color);
}


/* ============================================================
   15. ADMIN SECTION — on profile page
   ============================================================ */

.nova-user-admin-section {
    background: var(--nova-user-bg-subtle);
    padding: 1.25rem;
    border-radius: var(--nova-user-radius);
    margin-top: 1rem;
}

.nova-user-admin-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nova-user-admin-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.nova-user-admin-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nova-user-admin-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.7;
}

.nova-user-admin-field select,
.nova-user-admin-field input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--nova-user-border-color);
    border-radius: var(--nova-user-radius);
    font-size: 0.8125rem;
    background: #fff;
    min-width: 160px;
}

.nova-user-admin-btn {
    display: inline-block;
    padding: 7px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: var(--nova-user-radius);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.nova-user-admin-btn:hover {
    opacity: 0.85;
}

.nova-user-admin-btn-warning {
    background: #e65100;
    color: #fff;
}

.nova-user-admin-btn-danger {
    background: #c62828;
    color: #fff;
}

.nova-user-admin-ban {
    padding-top: 0.75rem;
    border-top: 1px solid var(--nova-user-border-color);
}


/* ============================================================
   16. RESPONSIVE — Edit Form + Admin
   ============================================================ */

@media (max-width: 600px) {
    .nova-user-edit-row {
        flex-direction: column;
    }

    .nova-user-edit-row-3 {
        flex-direction: column;
    }

    .nova-user-admin-form {
        flex-direction: column;
        align-items: stretch;
    }

    .nova-user-admin-field select,
    .nova-user-admin-field input[type="text"] {
        min-width: 0;
        width: 100%;
    }
}
