/* ==========================================================================
   Members — community directory matching the wiki/rules/recruitment theme
   --------------------------------------------------------------------------
   Clean centered header, a stats row, a search bar, and a responsive grid of
   member cards. Tokens (--qr-*) come from qubitrp.css.
   ========================================================================== */

.members-page {
    background: #0b0f13;
    padding: 56px 0 96px;
    min-height: calc(100vh - 78px);
}

/* -------------------------------------------------------------------- Header */
.members-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 48px;
}

.members-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(43, 189, 246, 0.4);
    border-radius: 999px;
    background: var(--qr-green-soft);
    color: var(--qr-green-bright);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.members-title {
    margin: 0 0 16px;
    color: #ffffff;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.5px;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
}
.members-title span { color: var(--qr-green); }

.members-subtitle {
    margin: 0 auto;
    color: rgba(233, 246, 255, 0.55);
    font-size: 1.08rem;
    line-height: 1.65;
}

/* Secondary section heading */
.members-section-head { text-align: center; margin-bottom: 32px; }
.members-section-head h2 {
    margin: 0 0 10px;
    color: #ffffff;
    font-weight: 800;
    font-size: clamp(1.6rem, 3.4vw, 2.1rem);
}
.members-section-head p { margin: 0; color: #98a2ac; font-size: 1rem; }

/* --------------------------------------------------------------- Statistics */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    background: linear-gradient(180deg, #141a20 0%, #0f141a 100%);
    border: 1px solid var(--qr-border);
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover { transform: translateY(-4px); border-color: rgba(43, 189, 246, 0.35); }

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    background: var(--qr-green-soft);
    border: 1px solid rgba(43, 189, 246, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--qr-green-bright);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    color: #8b939c;
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ------------------------------------------------------------- Members block */
.members-block {
    margin-top: 72px;
}

/* Search Bar */
.search-container { position: relative; max-width: 520px; margin: 0 auto 36px; }
.search-input-wrapper { position: relative; display: flex; align-items: center; }

.search-input {
    width: 100%;
    padding: 13px 46px;
    background: #0e141a;
    border: 1px solid var(--qr-border);
    border-radius: 12px;
    color: #eaf1f8;
    font-size: 0.98rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.search-input:focus {
    border-color: var(--qr-green);
    box-shadow: 0 0 0 3px rgba(43, 189, 246, 0.15);
}
.search-input::placeholder { color: #5f6871; }

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--qr-green);
    font-size: 1rem;
    z-index: 2;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #8b939c;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease;
    z-index: 2;
}
.clear-search-btn:hover { color: var(--qr-green-bright); background: var(--qr-green-soft); }

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #12181f;
    border: 1px solid var(--qr-border);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.search-loading { padding: 18px; text-align: center; color: #8b939c; }

.search-result-item {
    padding: 12px 18px;
    border-bottom: 1px solid var(--qr-border);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}
.search-result-item:hover,
.search-result-item.highlighted { background: var(--qr-green-soft); }
.search-result-item:last-child { border-bottom: none; }

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(43, 189, 246, 0.4);
    object-fit: cover;
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { color: #ffffff; font-weight: 600; margin-bottom: 2px; }
.search-result-role { color: #8b939c; font-size: 0.85rem; }
.search-result-name mark,
.member-name mark {
    background: rgba(43, 189, 246, 0.25) !important;
    color: var(--qr-green-bright) !important;
    padding: 1px 2px;
    border-radius: 2px;
}
.no-results { padding: 18px; text-align: center; color: #8b939c; }

/* Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.member-card {
    background: linear-gradient(180deg, #141a20 0%, #0f141a 100%);
    border: 1px solid var(--qr-border);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.member-card:hover { transform: translateY(-4px); border-color: rgba(43, 189, 246, 0.35); }

.member-avatar-container { position: relative; display: inline-block; margin-bottom: 18px; }

.member-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 2px solid var(--qr-border);
    object-fit: cover;
    transition: border-color 0.2s ease;
}
.member-card:hover .member-avatar { border-color: var(--qr-green); }

.online-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #22c55e;
    border: 3px solid #10161d;
    border-radius: 50%;
    animation: member-pulse 2s infinite;
}
@keyframes member-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.member-name { color: #ffffff; font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.member-username { color: #7c848d !important; font-size: 0.85rem; margin-bottom: 12px; }

.member-role {
    color: var(--qr-green-bright);
    font-weight: 600;
    margin-bottom: 18px;
    font-size: 0.88rem;
}

.member-dates { margin-bottom: 20px; }
.member-date {
    color: #98a2ac;
    font-size: 0.8rem;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-date i { color: var(--qr-green); margin-right: 8px; width: 12px; }

/* Profile button (overrides main.css .btn-orange) */
.members-page .member-card .btn-orange {
    background: var(--qr-green);
    border: none;
    color: #03212e;
    font-weight: 700;
    border-radius: 10px;
    padding: 9px 16px;
    transition: background 0.2s ease, transform 0.2s ease;
}
.members-page .member-card .btn-orange:hover {
    background: var(--qr-green-bright);
    color: #03212e;
    transform: translateY(-1px);
}

/* Pagination */
.pagination-container {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--qr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}
.pagination-info { color: #8b939c; }

/* Empty State */
.members-empty { text-align: center; padding: 70px 20px; }
.members-empty .empty-state-icon {
    width: 92px;
    height: 92px;
    margin: 0 auto 26px;
    background: var(--qr-green-soft);
    border: 1px solid rgba(43, 189, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: var(--qr-green-bright);
}
.members-empty .empty-state-title { color: #ffffff; font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.members-empty .empty-state-description { color: #8b939c; font-size: 1.05rem; max-width: 480px; margin: 0 auto; }

/* ------------------------------------------------------------------ Mobile */
@media (max-width: 768px) {
    .members-page { padding: 40px 0 72px; }
    .stats-row { grid-template-columns: 1fr; }
    .members-grid { grid-template-columns: 1fr; }
    .pagination-container { flex-direction: column; text-align: center; }
    .stat-value { font-size: 2rem; }
}
