/* ============================================================
   profile.css – پروفایل کاربری (طرح روشن، آواتار مرزی، استاتیک)
   ============================================================ */

@font-face {
    font-family: 'Vazirmatn';
    src: url('/dgid/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

body {
    overflow-x: hidden;
}

.profile-page {
    margin: 0 auto;
    font-family: 'Vazirmatn', sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    direction: rtl;
    width: 100%;
    max-width: 768px;
    padding-bottom: 120px;
    min-height: 100vh;
    box-sizing: border-box;
}

.profile-page * {
    box-sizing: border-box;
}

/* ===== COVER ===== */
.profile-page .cover {
    height: 150px;
    background: linear-gradient(135deg, #6366f1, #22d3ee);
    position: relative;
    z-index: 1;
    width: 100%;
}

.profile-page .cover-actions-right {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.profile-page .cover-actions-left {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.profile-page .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    text-decoration: none;
    padding: 0;
    line-height: 1;
    overflow: hidden;   /* ★ اضافه شود */
}

.profile-page .icon-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.4);
}

.profile-page .insights-badge {
    position: relative;
}

.profile-page .insights-count {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 8px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

.profile-page .level-badge {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    color: #000;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.profile-page .add-post-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
    line-height: 1;
    text-decoration: none;
}

.profile-page .add-post-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== PROFILE SECTION ===== */
.profile-page .profile {
    padding: 15px;
    margin-top: 0;
    position: relative;
    z-index: 2;
    width: 100%;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
}

.profile-page .header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: -45px;
}

.profile-page .avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: 3px solid #0b1220;
    background: #222;
    object-fit: cover;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    margin-top: -45px;
}

.profile-page .info {
    text-align: right;
    margin-top: 35px;
    flex: 1;
    min-width: 0;
}

.profile-page .name {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: #1a1a2e;
    margin-top: 15px;
}

.profile-page .verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #1d9bf0;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    flex-shrink: 0;
    position: relative;
}

.profile-page .verified::after {
    content: '\2713';
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.profile-page .referral-code {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-top: 4px;
}

/* ===== STATS ===== */
.profile-page .stats {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 4%;
    margin-top: 24px;
    flex-wrap: nowrap;
    padding: 0 2%;
}

.profile-page .stat-item,
.profile-page a.stat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.profile-page .stat-item .material-icons {
    font-size: 28px;
    color: #555;
    flex-shrink: 0;
}

.profile-page .stat-item strong {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
    white-space: nowrap;
}

.profile-page .stat-item span:last-child {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

/* ===== BIO CARD ===== */
.profile-page .bio-card {
    margin-top: 12px;
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.profile-page .play-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.profile-page .play-icon-btn {
    background: transparent;
    border: none;
    color: #333;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

.profile-page .play-icon-btn:hover {
    transform: scale(1.2);
}

.profile-page .divider-line {
    width: 1px;
    height: 24px;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.profile-page .bio-content {
    flex: 1;
    min-width: 0;
}

.profile-page .bio-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    font-weight: 500;
    word-break: break-word;
    text-align: right;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.2em;
}

.profile-page .bio-more {
    color: #555;
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: none;
}

.profile-page .bio-more.visible {
    display: inline;
}

/* ===== ACTIONS ===== */
.profile-page .actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.profile-page .actions-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* استایل پایه برای همه دکمه‌ها و لینک‌های داخل actions */
.profile-page .actions button,
.profile-page .actions .btn-add,
.profile-page .actions a.btn-add {
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    padding: 12px 10px;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    flex: 1;
    text-decoration: none;
}

.profile-page .actions button:hover,
.profile-page .actions .btn-add:hover,
.profile-page .actions a.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* رنگ‌های اختصاصی هر دکمه */
.profile-page .follow { background: linear-gradient(45deg, #3b82f6, #2563eb); font-weight: 700; }
.profile-page .btn-msg { background: linear-gradient(45deg, #ec4899, #be185d); }
.profile-page .btn-channel { background: linear-gradient(45deg, #f59e0b, #d97706); }
.profile-page .btn-add,
.profile-page a.btn-add { background: linear-gradient(45deg, #14b8a6, #0f766e); }
.profile-page .btn-send-msg { background: linear-gradient(45deg, #8b5cf6, #6d28d9); width: 100%; }

/* ===== TABS ===== */
.profile-page .tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: 0;
    border-bottom: 1px solid #e5e7eb;
    gap: 2px;
    width: 100%;
    background: #fff;
}

.profile-page .tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 12px 6px;
    font-size: 15px;
    font-weight: 700;
    color: #444;
    cursor: pointer;
    transition: color 0.2s;
    border-bottom: 3px solid transparent;
    min-width: 50px;
}

.profile-page .tab.active {
    color: #0096f5;
    border-bottom: 3px solid #0096f5;
    font-weight: 800;
}

/* ===== CONTENT ===== */
.profile-page .section {
    display: none;
    padding: 10px;
    width: 100%;
    background: #fff;
    min-height: 200px;
}

.profile-page .section.active {
    display: block;
    padding-bottom: 25px;
}

.profile-page .post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    width: 100%;
}

.profile-page .post-grid img,
.profile-page .grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    background: #e0e0e0;
}

.profile-page .grid-item { cursor: pointer; transition: transform 0.15s; }
.profile-page .grid-item:hover { transform: scale(1.02); }

.profile-page .card,
.profile-page .single-card {
    background: #f8fafc;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 8px;
}

.profile-page .mixed-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.profile-page .feed-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.profile-page .feed-row-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-page .feed-row-title span {
    background: rgba(0,0,0,0.05);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

/* ===== کارت حالت خالی ===== */
.profile-page .empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.profile-page .empty-state-card h3 {
    margin: 16px 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #555;
}

.profile-page .empty-state-card p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* ===== مودال پیام ===== */
.profile-page .profile-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.profile-page .profile-modal {
    background: #fff;
    border-radius: 14px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.profile-page .profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #eee;
}

.profile-page .profile-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1a1a2e;
}

.profile-page .profile-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
}

.profile-page .profile-modal-body {
    padding: 20px;
}

.profile-page .profile-modal-body textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px;
    font-family: inherit;
    resize: vertical;
}

.profile-page .profile-modal-footer {
    padding: 12px 20px;
    text-align: left;
}

.profile-page .profile-modal-footer .btn-send-msg {
    background: linear-gradient(45deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.profile-page .profile-modal-footer .btn-send-msg:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ===== مودال تأیید (Confirm) ===== */
.profile-page .confirm-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.profile-page .confirm-modal {
    background: #fff;
    border-radius: 14px;
    width: 85%;
    max-width: 360px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    text-align: center;
}

.profile-page .confirm-modal-body {
    padding: 24px 20px 16px;
}

.profile-page .confirm-modal-body p {
    font-size: 15px;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

.profile-page .confirm-modal-footer {
    display: flex;
    border-top: 1px solid #eee;
}

.profile-page .confirm-modal-footer button {
    flex: 1;
    padding: 14px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.profile-page .confirm-modal-footer button:hover {
    background: #f5f5f5;
}

.profile-page .confirm-btn-cancel {
    color: #888;
    border-left: 1px solid #eee;
}

.profile-page .confirm-btn-ok {
    color: #e74c3c;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 1024px) {
    .profile-page { max-width: 100%; }
    .profile-page .post-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-page .stats { gap: 5%; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .profile-page { max-width: 100%; }
    .profile-page .post-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-page .stats { gap: 4%; }
    .profile-page .stat-item .material-icons { font-size: 28px; }
    .profile-page .stat-item strong { font-size: 20px; }
    .profile-page .stat-item span:last-child { font-size: 16px; }
}

@media (max-width: 767px) {
    .profile-page { max-width: 100%; padding-bottom: 100px; }
    .profile-page .avatar { width: 75px; height: 75px; }
    .profile-page .header { margin-top: -37px; }
    .profile-page .info { margin-top: 15px; }
    .profile-page .name { font-size: 20px; }
    .profile-page .stats { gap: 16px; }
    .profile-page .stat-item .material-icons { font-size: 24px; }
    .profile-page .stat-item strong { font-size: 18px; }
    .profile-page .stat-item span:last-child { font-size: 14px; }
    .profile-page .tab { font-size: 14px; }
}

@media (max-width: 480px) {
    .profile-page .avatar { width: 65px; height: 65px; }
    .profile-page .header { margin-top: -32px; }
    .profile-page .info { margin-top: 12px; }
    .profile-page .name { font-size: 18px; }
    .profile-page .actions button,
    .profile-page .actions .btn-add,
    .profile-page .actions a.btn-add { font-size: 13px; padding: 10px 6px; }
    .profile-page .tab { flex: 1 1 30%; font-size: 12px; padding: 10px 2px; }
    .profile-page .stat-item .material-icons { font-size: 20px; }
    .profile-page .stat-item strong { font-size: 16px; }
    .profile-page .stat-item span:last-child { font-size: 13px; }
    .profile-page .bio-text { font-size: 13px; }
    .profile-page .feed-row-title { font-size: 14px; }
}

@media (max-width: 375px) {
    .profile-page .stat-item .material-icons { font-size: 18px; }
    .profile-page .stat-item strong { font-size: 14px; }
    .profile-page .stat-item span:last-child { font-size: 11px; }
    .profile-page .stat-item { gap: 2px; }
    .profile-page .stats { gap: 1%; }
}
.success-toast {
    background: #e8f5e9;
    color: #2e7d32;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #c8e6c9;
}
/* پخش‌کنندهٔ صوتی */
.voice-player {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 200px;
}

.voice-player .play-icon-btn {
    background: transparent;
    border: none;
    color: #333;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.voice-player .play-icon-btn:hover {
    transform: scale(1.2);
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.profile-page .icon-btn .material-icons {
    font-size: 20px;    /* اندازهٔ مناسب برای دایره ۳۶px */
}
/* تنظیم اختصاصی دکمه QR */
#qrCodeBtn {
    padding: 6px;           /* فاصله داخلی برای آیکن بزرگ */
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrCodeBtn .material-icons {
    font-size: 20px;        /* اندازه مناسب برای دایره ۳۶px */
    line-height: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}