/* ============================================
   مودست استایل - استایل اصلی
   ============================================ */

/* ─── فونت وزیرمتن ─── */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ─── متغیرها ─── */
:root {
    --primary: #2e9e5b;
    --primary-dark: #217a44;
    --primary-light: #d4f0dd;
    --accent: #c9a961;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #e4e6eb;
    --text: #1c1e21;
    --text-muted: #65676b;
    --text-light: #8a8d91;
    --danger: #e41e3f;
    --success: #2e9e5b;
    --warning: #f7b928;

    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.12);

    --header-h: 62px;
    --container: 1200px;

    --font: 'Vazirmatn', 'Tahoma', sans-serif;
}

/* ─── ریست ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ─── لایه‌ها ─── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── هدر ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--header-h);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.logo:hover { color: #fff; opacity: .9; }
.logo .logo-dot { color: var(--accent); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background .15s;
    position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.22); }

.nav-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 700;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.5);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── دکمه‌ها ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all .15s;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    text-align: center;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); color: var(--text); }

.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f0f0f0; color: var(--primary-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c4183a; color: #fff; }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ─── فرم‌ها ─── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.form-label .req { color: var(--danger); }

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.form-error {
    background: #fde8ec;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border-right: 3px solid var(--danger);
}

.form-success {
    background: #e5f6ec;
    color: var(--success);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border-right: 3px solid var(--success);
}

/* ─── کارت ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

/* ─── صفحه احراز هویت ─── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #e8f5ee 0%, #f7f8fa 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 6px;
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
}
.auth-logo .logo-dot { color: var(--accent); }

.auth-title {
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 26px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a { font-weight: 600; }

/* ─── اعلان ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}
.alert-error { background: #fde8ec; color: #a01030; }
.alert-success { background: #e5f6ec; color: #17603a; }
.alert-info { background: #e7f0ff; color: #1a4a9e; }

/* ─── لودر ─── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── کمکی ─── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ─── فوتر ─── */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ─── واکنش‌گرا ─── */
@media (max-width: 768px) {
    .site-header .container { gap: 10px; }
    .logo { font-size: 17px; }
    .nav-link span.nav-text { display: none; }
    .nav-link { padding: 8px 10px; }
    .auth-card { padding: 28px 22px; }
    .form-control { font-size: 16px; } /* جلوگیری از زوم iOS */
}

/* ============================================
   کارت پست
   ============================================ */
.post-card { padding: 0; overflow: hidden; }
.post-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}
.post-avatar {
    width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
}
.post-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.post-name { font-weight: 600; color: var(--text); }
.post-username { font-size: 12px; color: var(--text-muted); }
.post-del { font-size: 18px; opacity: .5; }
.post-del:hover { opacity: 1; }
.post-content { padding: 0 16px 12px; line-height: 1.9; word-wrap: break-word; }
.post-content .hashtag { font-weight: 600; }
.post-image img { width: 100%; max-height: 600px; object-fit: cover; cursor: pointer; }
.post-actions {
    display: flex; gap: 4px; padding: 10px 16px;
    border-top: 1px solid var(--border);
}
.action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    background: none; color: var(--text-muted); font-size: 14px;
    font-family: inherit; cursor: pointer; transition: background .15s;
}
.action-btn:hover { background: var(--surface-2); color: var(--text); }
.action-btn .icon { font-size: 16px; }
.like-btn.liked { color: var(--danger); }
.like-btn.liked .icon { animation: pop .3s; }
@keyframes pop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.3)} }

/* ============================================
   کامنت
   ============================================ */
.comment {
    display: flex; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.comment:last-child { border: none; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.comment-body { flex: 1; }
.comment-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.comment-name { font-weight: 600; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; line-height: 1.7; }

/* ============================================
   پروفایل
   ============================================ */
.profile-head { padding: 0; overflow: hidden; }
.profile-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    background-size: cover;
    background-position: center;
}
.profile-main { padding: 0 20px 20px; }
.profile-avatar {
    width: 96px; height: 96px; border-radius: 50%;
    border: 4px solid var(--surface); object-fit: cover;
    margin-top: -48px; position: relative;
}
.profile-info { margin-top: 8px; }
.profile-name { font-size: 20px; margin-bottom: 2px; }
.profile-username { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.profile-bio { margin-bottom: 12px; font-size: 14px; line-height: 1.7; }
.profile-stats { display: flex; gap: 24px; margin: 12px 0; }
.profile-stats > * { display: flex; flex-direction: column; align-items: center; }
.profile-stats a { color: var(--text); }
.profile-stats strong { font-size: 17px; }
.profile-stats span { font-size: 12px; color: var(--text-muted); }
.profile-extra { margin: 8px 0; }
.profile-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ============================================
   کاوش
   ============================================ */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.user-card { text-align: center; padding: 16px 12px; }
.user-card-avatar {
    width: 70px; height: 70px; border-radius: 50%;
    object-fit: cover; margin: 0 auto 8px;
    border: 2px solid var(--primary-light);
}
.user-card-name { font-weight: 600; font-size: 14px; display: block; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 20px;
    font-size: 13px; color: var(--text);
}
.tag-chip:hover { background: var(--primary-light); border-color: var(--primary); }

/* ============================================
   چت
   ============================================ */
.chat-item { transition: background .15s; }
.chat-item:hover { background: var(--surface-2); }
.msg { display: flex; flex-direction: column; margin-bottom: 12px; }
.msg.mine { align-items: flex-start; }
.msg.theirs { align-items: flex-end; }
.msg-bubble {
    max-width: 75%; padding: 10px 14px; border-radius: 14px;
    font-size: 14px; line-height: 1.6; word-wrap: break-word;
}
.msg.mine .msg-bubble {
    background: var(--primary); color: #fff; border-bottom-left-radius: 4px;
}
.msg.theirs .msg-bubble {
    background: var(--surface-2); color: var(--text); border-bottom-right-radius: 4px;
}
.msg-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; padding: 0 6px; }

/* ============================================
   اعلان
   ============================================ */
.notif-item.unread { background: var(--primary-light); }
.notif-item:hover { background: var(--surface-2); }