/* ================================================================
   LifeStyleMod – Profile Page (v5.9)
   ----------------------------------------------------------------
   شامل:
   ▸ Container + Back link
   ▸ Profile Card (avatar + info + role badge)
   ▸ Stats Row (4 box)
   ▸ Tabs (Packs / Mods)
   ▸ Section Header
   ▸ Empty State
   ▸ Packs/Mods Grid + Card
   ▸ Pagination
   ▸ Role-based color accents
   ▸ Responsive
   
   ⚠️ بدون backdrop-filter — بدون رنگ hardcode
   ================================================================ */

/* ═══════════════════════════════════════════════════════════
   1. CONTAINER
   ═══════════════════════════════════════════════════════════ */
.prof-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-5) var(--s-4) var(--s-8);
    position: relative;
    z-index: var(--z-base);
}

/* ═══════════════════════════════════════════════════════════
   2. BACK LINK
   ═══════════════════════════════════════════════════════════ */
.prof-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    padding: 8px 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
    margin-bottom: var(--s-5);
}

.prof-back-link:hover {
    color: var(--c-text);
    background: var(--c-surface-2);
    border-color: var(--c-border-hover);
}

/* ═══════════════════════════════════════════════════════════
   3. PROFILE CARD
   ═══════════════════════════════════════════════════════════ */
.prof-profile-card {
    display: flex;
    align-items: center;
    gap: var(--s-6);
    padding: var(--s-7) var(--s-6);
    border-radius: var(--r-xl);
    margin-bottom: var(--s-5);
    position: relative;
    overflow: hidden;
}

.prof-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--g-rainbow-line);
    opacity: 0.5;
    pointer-events: none;
}

/* ─── Avatar Section ─── */
.prof-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-3);
    flex-shrink: 0;
}

.prof-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--r-full);
    background: var(--c-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    overflow: hidden;
    border: 3px solid var(--c-border-hover);
    box-shadow: var(--shadow-glow);
    transition: border-color var(--t-base), box-shadow var(--t-base);
}

.prof-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prof-level-badge {
    padding: 5px 16px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    color: var(--c-primary-light);
    white-space: nowrap;
}

/* ─── Profile Info ─── */
.prof-profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.prof-profile-name {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: var(--fw-black);
    color: var(--c-text);
    margin: 0;
    line-height: 1.25;
    letter-spacing: var(--ls-tight);
}

.prof-role-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 5px 16px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--c-text-soft);
    white-space: nowrap;
}

.prof-bio {
    color: var(--c-text-soft);
    font-size: var(--fs-base);
    line-height: 1.85;
    padding: var(--s-3) var(--s-4);
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border-soft);
    border-radius: var(--r-md);
    word-wrap: break-word;
    word-break: break-word;
}

.prof-bio.empty {
    color: var(--c-text-dim);
    font-style: italic;
}

.prof-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-2);
}

.prof-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--r-full);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
    white-space: nowrap;
    border: 1px solid transparent;
}

.prof-btn-edit {
    background: var(--g-primary);
    color: var(--c-text-on-primary);
    box-shadow: var(--shadow-sm);
}

.prof-btn-edit:hover {
    transform: translate3d(0, -1px, 0);
    box-shadow: var(--shadow-md);
    color: var(--c-text-on-primary);
}

.prof-btn-outline {
    background: var(--c-surface-2);
    border-color: var(--c-border);
    color: var(--c-text-soft);
}

.prof-btn-outline:hover {
    background: var(--c-surface-3);
    border-color: var(--c-border-hover);
    color: var(--c-text);
    transform: translate3d(0, -1px, 0);
}

/* ═══════════════════════════════════════════════════════════
   4. STATS ROW
   ═══════════════════════════════════════════════════════════ */
.prof-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-4);
    margin-bottom: var(--s-7);
}

.prof-stat-box {
    padding: var(--s-5) var(--s-4);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
    transition: transform var(--t-base), border-color var(--t-base);
}

.prof-stat-box:hover {
    transform: translate3d(0, -3px, 0);
    border-color: var(--c-border-hover);
}

.prof-stat-icon {
    font-size: 26px;
    line-height: 1;
    opacity: 0.85;
}

.prof-stat-number {
    font-family: var(--font-mono);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: var(--fw-black);
    color: var(--c-primary-light);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.prof-stat-label {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════
   5. TABS
   ═══════════════════════════════════════════════════════════ */
.prof-tab-bar {
    display: inline-flex;
    gap: 4px;
    margin: 0 auto var(--s-6);
    padding: 5px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    max-width: 360px;
    width: 100%;
}

.prof-tab-btn {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--r-full);
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    font-family: inherit;
    font-weight: var(--fw-bold);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
    white-space: nowrap;
}

.prof-tab-btn:hover {
    color: var(--c-text);
}

.prof-tab-btn.active {
    background: var(--g-primary);
    color: var(--c-text-on-primary);
    box-shadow: var(--shadow-sm);
}

.prof-tab-content {
    display: none;
}

.prof-tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* ═══════════════════════════════════════════════════════════
   6. SECTION HEADER
   ═══════════════════════════════════════════════════════════ */
.prof-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
    margin-bottom: var(--s-5);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--c-border-soft);
}

.prof-section-title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-black);
    color: var(--c-text);
    margin: 0;
    letter-spacing: var(--ls-tight);
    line-height: 1.35;
}

.prof-gradient-warm {
    background: var(--g-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.prof-packs-count {
    display: inline-flex;
    align-items: center;
    padding: 5px 16px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--c-primary-light);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   7. EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
.prof-empty-packs {
    text-align: center;
    padding: var(--s-8) var(--s-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-3);
    color: var(--c-text-muted);
}

.prof-empty-icon {
    font-size: 56px;
    line-height: 1;
    opacity: 0.6;
    display: block;
}

.prof-empty-packs h3 {
    color: var(--c-text);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    margin: 0;
}

.prof-empty-packs p {
    font-size: var(--fs-sm);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   8. PACKS / MODS GRID
   ═══════════════════════════════════════════════════════════ */
.prof-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--s-4);
    margin-bottom: var(--s-5);
    align-items: stretch;
}

/* ─── Hidden page (برای pagination جاوااسکریپتی) ─── */
.prof-pack-card.prof-hidden-page {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   9. PACK CARD
   ═══════════════════════════════════════════════════════════ */
.prof-pack-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
    position: relative;
    height: 100%;
}

.prof-pack-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--g-rainbow-line);
    opacity: 0.4;
    pointer-events: none;
    transition: opacity var(--t-base);
    z-index: 2;
}

.prof-pack-card:hover {
    transform: translate3d(0, -4px, 0);
    box-shadow: var(--shadow-md);
    border-color: var(--c-border-hover);
}

.prof-pack-card:hover::before {
    opacity: 0.7;
}

/* ─── Image ─── */
.prof-pack-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--c-bg-alt);
    position: relative;
}

.prof-pack-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--t-slow);
}

.prof-pack-card:hover .prof-pack-img {
    transform: scale(1.05);
}

.prof-pack-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 60%);
    opacity: 0;
    transition: opacity var(--t-base);
    pointer-events: none;
}

.prof-pack-card:hover .prof-pack-img-overlay {
    opacity: 1;
}

.prof-pack-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    background: var(--c-bg-alt);
    color: var(--c-text-dim);
}

/* ─── Body ─── */
.prof-pack-body {
    padding: var(--s-4);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.prof-pack-code {
    display: inline-block;
    align-self: flex-start;
    font-size: var(--fs-xs);
    color: var(--c-primary-light);
    background: var(--c-surface-2);
    padding: 3px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
    font-weight: var(--fw-semi);
    letter-spacing: 0.03em;
}

.prof-pack-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prof-pack-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    padding-top: var(--s-3);
    margin-top: auto;
    border-top: 1px solid var(--c-border-soft);
}

/* ═══════════════════════════════════════════════════════════
   10. PAGINATION
   ═══════════════════════════════════════════════════════════ */
.prof-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: var(--s-6);
    flex-wrap: wrap;
}

.prof-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    font-family: inherit;
    font-weight: var(--fw-semi);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast), background var(--t-fast),
                border-color var(--t-fast), transform var(--t-fast);
}

.prof-page-btn:hover:not(:disabled) {
    color: var(--c-text);
    border-color: var(--c-border-hover);
    background: var(--c-surface-2);
}

.prof-page-btn.active {
    background: var(--c-primary);
    color: var(--c-text-on-primary);
    border-color: var(--c-primary);
}

.prof-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   11. ROLE-BASED ACCENTS
   ═══════════════════════════════════════════════════════════ */
/* ─── Owner ─── */
body.profile-role-owner .prof-avatar {
    border-color: var(--c-role-owner);
    box-shadow: 0 0 40px rgba(149, 188, 215, 0.30);
}

body.profile-role-owner .prof-role-badge {
    background: rgba(149, 188, 215, 0.15);
    color: var(--c-role-owner);
    border-color: rgba(149, 188, 215, 0.30);
}

body.profile-role-owner .prof-level-badge {
    background: rgba(149, 188, 215, 0.15);
    color: var(--c-role-owner);
    border-color: rgba(149, 188, 215, 0.30);
}

/* ─── Admin ─── */
body.profile-role-admin .prof-avatar {
    border-color: var(--c-role-admin);
    box-shadow: 0 0 40px rgba(109, 159, 201, 0.30);
}

body.profile-role-admin .prof-role-badge {
    background: var(--c-info-bg);
    color: var(--c-role-admin);
    border-color: var(--c-info-border);
}

body.profile-role-admin .prof-level-badge {
    background: var(--c-info-bg);
    color: var(--c-role-admin);
    border-color: var(--c-info-border);
}

/* ─── Pack Creator ─── */
body.profile-role-pack_creator .prof-avatar {
    border-color: var(--c-role-creator);
    box-shadow: 0 0 40px rgba(95, 184, 154, 0.30);
}

body.profile-role-pack_creator .prof-role-badge {
    background: var(--c-success-bg);
    color: var(--c-role-creator);
    border-color: var(--c-success-border);
}

body.profile-role-pack_creator .prof-level-badge {
    background: var(--c-success-bg);
    color: var(--c-role-creator);
    border-color: var(--c-success-border);
}

/* ─── User (عادی) ─── */
body.profile-role-user .prof-avatar {
    border-color: var(--c-border-hover);
}

/* ═══════════════════════════════════════════════════════════
   12. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ─── تبلت ─── */
@media (max-width: 992px) {
    .prof-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── موبایل بزرگ ─── */
@media (max-width: 768px) {
    .prof-container {
        padding: var(--s-3) var(--s-3) var(--s-6);
    }

    .prof-profile-card {
        flex-direction: column;
        text-align: center;
        padding: var(--s-6) var(--s-4);
        gap: var(--s-4);
    }

    .prof-avatar {
        width: 100px;
        height: 100px;
        font-size: 46px;
    }

    .prof-profile-info {
        align-items: center;
    }

    .prof-role-badge {
        align-self: center;
    }

    .prof-profile-actions {
        justify-content: center;
    }

    .prof-tab-bar {
        max-width: 100%;
    }

    .prof-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .prof-packs-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--s-3);
    }

    .prof-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--s-3);
    }

    .prof-stat-box {
        padding: var(--s-4) var(--s-3);
    }
}

/* ─── موبایل کوچک ─── */
@media (max-width: 480px) {
    .prof-profile-name {
        font-size: var(--fs-xl);
    }

    .prof-stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .prof-packs-grid {
        grid-template-columns: 1fr;
    }

    .prof-pack-body {
        padding: var(--s-3);
    }

    .prof-pack-title {
        font-size: var(--fs-base);
    }

    .prof-tab-btn {
        font-size: var(--fs-xs);
        padding: 8px 10px;
    }

    .prof-profile-actions {
        flex-direction: column;
        width: 100%;
    }

    .prof-profile-actions .prof-btn {
        width: 100%;
        justify-content: center;
    }
}