/*!
 * Soicau — profile.css
 * © 2026 pickles.soicau
 */

.profile-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.5rem;
}

.profile-page p,
.profile-page ul,
.profile-page ol {
    margin: 0;
}

/* ----- Hero ----- */
.profile-hero {
    position: relative;
    background: var(--color-surface);
    overflow: visible;
}

/* ----- 3-dot menu (chặn / báo cáo) ----- */
.profile-hero-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}
.profile-menu-trigger {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: background .15s, color .15s, border-color .15s;
}
.profile-menu-trigger:hover,
.profile-hero-menu.is-open .profile-menu-trigger {
    background: var(--color-bg-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}
.profile-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 4px 0;
    display: none;
}
.profile-hero-menu.is-open .profile-menu-dropdown {
    display: block;
}
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: 0;
    color: var(--color-text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .15s;
}
.profile-menu-item:hover { background: var(--color-bg-alt); }
.profile-menu-item i { width: 16px; color: var(--color-text-muted); }
.profile-menu-item--report { color: #b91c1c; }
.profile-menu-item--report i { color: #b91c1c; }
.profile-menu-item--block i { color: #b91c1c; }
.profile-menu-item--message i { color: var(--color-primary); }
.profile-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px;
}
.profile-avatar {
    position: relative;
    display: inline-block;
    line-height: 0;
    flex: 0 0 auto;
}
.profile-avatar img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--color-border);
    background: #fff;
    display: block;
}

.profile-avatar--rank1 img { box-shadow: 0 0 0 3px #fbbf24; }
.profile-avatar--rank2 img { box-shadow: 0 0 0 3px #cbd5e1; }
.profile-avatar--rank3 img { box-shadow: 0 0 0 3px #d97706; }
.profile-avatar--vip   img { box-shadow: 0 0 0 3px #f5b400; }
.profile-avatar--admin img { box-shadow: 0 0 0 3px var(--color-primary); }

.profile-avatar-pill {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--color-primary);
    border-radius: 999px;
    box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0, 0, 0, .15);
    letter-spacing: .5px;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 2;
}
.profile-avatar-pill--top1  { background: linear-gradient(135deg, var(--soicau-warning, #f59e0b) 0%, color-mix(in srgb, var(--soicau-warning, #f59e0b) 80%, #000) 100%); }
.profile-avatar-pill--top2  { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); }
.profile-avatar-pill--top3  { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); }
.profile-avatar-pill--vip   { background: var(--color-primary); }
.profile-avatar-pill--admin { background: var(--color-primary); }

.profile-identity {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}
.profile-name {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.15;
    word-break: break-word;
    letter-spacing: -.3px;
}
.profile-status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    vertical-align: middle;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.profile-status-dot--online {
    background: #22c55e;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 0 6px rgba(34, 197, 94, .55);
}
.profile-status-dot--offline {
    background: #9ca3af;
}
.profile-verified {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--soicau-success, #16a34a);
    font-weight: 600;
}
.profile-verified i { color: var(--soicau-success, #16a34a); font-size: 13px; }
.profile-verified--admin { color: var(--color-primary); }
.profile-verified--admin i { color: var(--color-primary); }
.profile-role {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.profile-info-card {
    border-top: 1px solid var(--color-border);
}
.profile-info-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}
.profile-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.profile-info-row:last-child { border-bottom: 0; }
.profile-info-row-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    font-weight: 500;
    flex: 0 0 auto;
}
.profile-info-row-label i {
    width: 18px;
    text-align: center;
    color: var(--color-text);
    font-size: 14px;
}
.profile-info-row-value {
    color: var(--color-text);
    font-weight: 400;
    text-align: left;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}
.profile-info-row-value--num { font-size: 14px; }

/* ----- Body grid ----- */
.profile-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 0;
    align-items: start;
}
.profile-body:not(:has(.profile-sidebar)) {
    grid-template-columns: minmax(0, 1fr);
}

.profile-card {
    background: var(--color-surface);
}
.profile-card-title {
    margin: 0;
    padding: 12px 16px;
    background: var(--color-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-blocked-note {
    font-style: normal;
    font-size: 14px;
    color: #b91c1c;

    line-height: 1.5;
}
.profile-blocked-note i { font-size: 16px; margin-right: 6px; vertical-align: -2px; }

/* ----- History table ----- */
.profile-table-scroll {
    width: 100%;
    overflow-x: auto;
}
.profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.profile-table th,
.profile-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #f1f1f1;
    vertical-align: middle;
}
.profile-table thead th {
    background: var(--color-bg-alt);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.profile-col-date { white-space: nowrap; font-weight: 600; }
.profile-col-num  { white-space: nowrap; font-weight: 600; }

.profile-num {
    display: inline-block;
    min-width: 28px;
    padding: 2px 6px;
    margin: 1px 2px 1px 0;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.profile-num--hit {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.profile-num-boi {
    font-size: 9px;
    font-weight: 700;
    color: #b91c1c;
    margin-left: 2px;
    line-height: 1;
    vertical-align: super;
}
.profile-dash { color: var(--color-text-muted); }

/* ----- Comment history ----- */
.profile-comments {
    list-style: none;
    margin: 0;
    padding: 0;
}
.profile-comment {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
}
.profile-comment:last-child { border-bottom: 0; }
.profile-comment-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}
.profile-comment-place {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}
.profile-comment-place:hover { text-decoration: underline; color: var(--color-primary); }

.profile-comment-head-left {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.profile-comment-reply-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px;
    background: #eef2f7;
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.5;
}
.profile-comment-reply-tag i { font-size: 10px; opacity: .7; }
.profile-comment-reply-tag b {
    font-weight: 600;
    color: var(--color-text);
}

.profile-comment--reply {
    border-left: 3px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
    background: var(--color-bg-alt);
}
.profile-comment-time {
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.profile-comment-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    word-break: break-word;
}
.profile-comment-body .cs-chat-emoji {
    display: inline-block;
    height: 20px;
    width: auto;
    vertical-align: middle;
    margin: 0 1px;
}
.profile-comment-img-link {
    display: block;
    margin-top: 6px;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 120px;
}
.profile-comment-img {
    display: block;
    max-width: 120px;
    max-height: 120px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    object-fit: cover;
    cursor: zoom-in;
}

.profile-img-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    cursor: zoom-out;
}
.profile-img-lightbox.is-open { display: flex; }
.profile-img-lightbox-img {
    max-width: 95vw;
    max-height: 92vh;
    object-fit: contain;
    box-shadow: 0 6px 32px rgba(0, 0, 0, .6);
    cursor: default;
    background: #111;
}
.profile-img-lightbox-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profile-img-lightbox-close:hover { background: rgba(0, 0, 0, .8); }
body.profile-img-lock { overflow: hidden; }

/* ----- Load more ----- */
.profile-load-more {
    padding: 10px 16px 14px;
    text-align: center;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-alt);
}

.profile-table tbody tr:last-child td { border-bottom: 0; }
.profile-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--color-primary);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.profile-load-more-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
}
.profile-load-more-btn:disabled { cursor: wait; opacity: .6; }
.profile-load-more-btn.is-loading i {
    animation: profile-spin .8s linear infinite;
}
@keyframes profile-spin {
    to { transform: rotate(360deg); }
}

/* ----- Sidebar ----- */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.profile-info-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}
.profile-info-list li:last-child { border-bottom: 0; }
.profile-info-label {
    color: var(--color-text-muted);
    font-weight: 500;
}
.profile-info-value {
    color: var(--color-text);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.profile-info-link {
    margin: 0;
    padding: 12px 16px;
    font-size: 13px;
    word-break: break-all;
}
.profile-info-link a { color: var(--color-link); }

.profile-bio {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
}
.profile-bio p { margin: 0 0 .75em; }
.profile-bio p:last-child { margin-bottom: 0; }

/* ----- Responsive ----- */

@media (max-width: 1024px) {
    .profile-body { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .profile-page { gap: 8px; }
    .profile-body { gap: 8px; }

    .profile-hero-inner { padding: 14px; gap: 14px; }
    .profile-avatar img { width: 84px; height: 84px; border-width: 3px; }
    .profile-name { font-size: 21px; }
    .profile-info-row { padding: 10px 12px; font-size: 13.5px; }

    .profile-card-title { padding: 10px 12px; font-size: 13px; }

    .profile-table { font-size: 12px; }
    .profile-table th,
    .profile-table td { padding: 8px 8px; }
    .profile-table thead th { font-size: 11px; }
    .profile-num {
        min-width: 24px;
        padding: 1px 4px;
        font-size: 12px;
    }
    .profile-info-list li,
    .profile-info-link,
    .profile-bio { padding: 10px 12px; }

    .profile-comment { padding: 10px 12px; }
    .profile-comment-body { font-size: 13px; }

    .profile-comment-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 600px) {
    .profile-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px 14px;
    }
    .profile-identity { align-items: center; }
    .profile-role { text-align: center; }
    .profile-name { font-size: 20px; }
    .profile-avatar img { width: 88px; height: 88px; }

    .profile-table-scroll { overflow-x: visible; }
    .profile-table { border: 0; }
    .profile-table thead { display: none; }
    .profile-table,
    .profile-table tbody,
    .profile-table tr { display: block; width: 100%; }
    .profile-table tr {
        padding: 10px 12px;
        border-top: 1px solid var(--color-border);
    }
    .profile-table tbody tr:first-child { border-top: 0; }
    .profile-table tbody tr:hover { background: transparent; }
    .profile-table td {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 4px 0;
        border: 0;
        text-align: left !important;
        white-space: normal;
    }
    .profile-table td::before {
        content: attr(data-label);
        flex: 0 0 78px;
        color: var(--color-text-muted);
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .3px;
    }
    .profile-table .profile-col-date,
    .profile-table tbody tr:last-child .profile-col-date {
        font-size: 14px;
        font-weight: 700;
        color: var(--color-primary);
        padding-bottom: 6px;
        margin-bottom: 4px;
        border-bottom: 1px dashed var(--color-border);
    }
    .profile-table .profile-col-date::before {
        display: none;
    }
    .profile-num {
        min-width: auto;
        padding: 1px 6px;
        font-size: 12px;
        margin: 0 2px 0 0;
    }
}

@media (max-width: 380px) {
    .profile-name { font-size: 17px; }
}
