/* ==================== ریست و پایه ==================== */

@font-face {
    font-family: 'Lalezar';
    src: url('../fonts/Lalezar-Regular.woff2') format('woff2'),
         url('../fonts/Lalezar-Regular.woff')  format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Medium.woff2') format('woff2'),
         url('../fonts/Vazir-Medium.woff')  format('woff');
    font-weight: 900;        /* چون فایل Black است، وزن 900 قرار می‌دهیم */
    font-style: normal;
    font-display: swap;      /* متن تا بارگذاری فونت با فونت سیستمی نمایش داده شود */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Lalezar', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f1f5f9;
  color: #1a202c;
  line-height: 1.8;
  font-size: 16px;
  direction: rtl;
  padding-bottom: 55px;
}
button,
input,
textarea,
select,
.btn-small,
.edit-toggle,
.save-profile-btn,
.auth-btn,
.btn-link {
    font-family: 'Lalezar', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.wiki-wrapper {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: #2c5282;
  text-decoration: none;
}
a:hover {
  color: #0b3b4f;
  text-decoration: underline;
}

/* ==================== هدر ==================== */
.main-header {
  background: #0b3b4f;
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 10px;
}

.brand a {
  color: white;
  text-decoration: none;
}

/* لوگوی تصویری */
.brand-logo-img {
  height: 55px;
  width: auto;
  display: block;
}

@media screen and (max-width: 768px) {
  .brand-logo-img {
    height: 45px;
  }
}

/* جستجو */
.search-area {
  position: relative;
  display: flex;
  align-items: center;
}
.search-toggle-icon {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  color: white;
  transition: background 0.3s, transform 0.2s;
  z-index: 10;
}
.search-toggle-icon:hover {
  background: #f0b354;
  color: #0b3b4f;
  transform: scale(1.05);
}
.search-form {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  background: white;
  border-radius: 30px;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  border: 1px solid #e2e8f0;
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
}
.search-form.active {
  opacity: 1;
  visibility: visible;
  width: 260px;
}
.search-form input {
  border: none;
  outline: none;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
  color: #1a202c;
  background: transparent;
}
.search-form input::placeholder {
  color: #94a3b8;
}
.search-form .search-submit-btn {
  background: #0b3b4f;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.2s;
}
.search-form .search-submit-btn:hover {
  background: #f0b354;
  color: #0b3b4f;
}
.search-close-btn {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 4px;
}

/* ==================== نوار دسکتاپ ==================== */
.nav-bar-desktop {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.nav-bar-desktop a {
  text-decoration: none;
  color: #2d3748;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 12px 16px;
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-bar-desktop a:hover {
  color: #0b3b4f;
  border-bottom-color: #f0b354;
  background: #edf2f7;
}

/* ==================== نوار پایینی موبایل ==================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  z-index: 110;
  padding: 6px 8px;
  justify-content: space-around;
  align-items: center;
}
.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 8px;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
}
.mobile-bottom-nav a i {
  font-size: 1.4rem;
  margin-bottom: 2px;
}
.mobile-bottom-nav a:hover,
.mobile-bottom-nav a.active {
  color: #0b3b4f;
  background: #f1f5f9;
}

/* ==================== منوی همبرگری موبایل ==================== */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s;
}
.mobile-menu-overlay.active {
  visibility: visible;
  opacity: 1;
}
.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: white;
  box-shadow: -4px 0 15px rgba(0,0,0,0.15);
  z-index: 201;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}
.mobile-menu-panel.active {
  right: 0;
}
.mobile-menu-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #2d3748;
  cursor: pointer;
  margin-bottom: 20px;
}
.mobile-menu-section {
  margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 16px;
}
.mobile-menu-section h3 {
  font-size: 1.1rem;
  color: #0b3b4f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
  font-weight: 600;
}
.mobile-menu-section h3 i {
  font-size: 0.9rem;
  transition: transform 0.3s;
}
.mobile-menu-section ul {
  list-style: none;
  margin-top: 8px;
  display: none;
}
.mobile-menu-section.open ul {
  display: block;
}
.mobile-menu-section.open h3 i {
  transform: rotate(180deg);
}
.mobile-menu-section li {
  margin-bottom: 10px;
  padding-right: 8px;
}
.mobile-menu-section a {
  text-decoration: none;
  color: #2c5282;
  font-size: 0.9rem;
}

/* ==================== گرید اصلی (دسکتاپ) ==================== */
.main-grid {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex: 1;
  flex-direction: row-reverse;
}

.sidebar {
  width: 240px;
  background: #f1f5f9;
  border-left: 1px solid #e2e8f0;
  padding: 24px 16px;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.sidebar-widget {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid #e9edf2;
}
.sidebar-widget h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0b3b4f;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #f0b354;
  display: inline-block;
}
.sidebar-widget ul {
  list-style: none;
  margin-top: 8px;
}
.sidebar-widget li {
  margin-bottom: 8px;
}

.article {
  flex: 1;
  padding: 32px 36px;
  background: white;
  min-width: 0;
}
.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0b3b4f;
  border-bottom: 3px solid #f0b354;
  display: inline-block;
  padding-bottom: 6px;
  margin-bottom: 24px;
}

.article-content {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


.article-content h2 {
  font-size: 1.6rem;
  color: #0b3b4f;
  margin: 28px 0 14px;
  clear: both;
  border-right: 4px solid #f0b354;
  padding-right: 12px;
}
.article-content p {
  margin-bottom: 16px;
  text-align: justify;
}

/* لیست مقالات */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.article-card {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.article-card h2 {
  font-size: 1.3rem;
  margin-bottom: 5px;
}
.article-card time {
  font-size: 0.8rem;
  color: #64748b;
}

/* ==================== فوتر ==================== */
.footer-modern {
  background: #f1f5f9;
  color: rgb(11, 59, 79);
  text-align: center;
  padding: 20px 16px;
  border-top: 3px solid rgb(11, 59, 79);
  margin-top: 40px;
  font-size: 0.95rem;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-content p {
  margin: 0;
  line-height: 1.8;
}
.footer-content a {
  color: #191970;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}
.footer-content a:hover {
  color: #1a6b8a;
}
@media screen and (max-width: 768px) {
  .footer-modern {
    padding: 16px 12px;
    font-size: 0.9rem;
  }
}

/* کلیرفیکس */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ==================== ریسپانسیو (موبایل) ==================== */
@media screen and (max-width: 768px) {
  .menu-toggle-btn {
    display: block;
  }
  .brand-text {
    font-size: 1.2rem;
  }
  .nav-bar-desktop {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .sidebar {
    display: none;
  }
  .main-grid {
    flex-direction: column;
  }
  .article {
    padding: 20px 16px;
  }
  .article-title {
    font-size: 1.7rem;
    display: block;
  }
  .search-form.active {
    width: calc(100vw - 70px);
    max-width: 400px;
  }
  .search-close-btn {
    display: block;
  }
}

/* ==================== بخش نظرات ==================== */
.comments-section {
  margin-top: 40px;
  border-top: 2px solid #e2e8f0;
  padding-top: 30px;
}
.comments-section h2 {
  font-size: 1.5rem;
  color: #0b3b4f;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment {
  display: flex;
  gap: 15px;
  background: #ffffff;
  border: 1px solid #e9edf2;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s;
}
.comment:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.comment-avatar {
  flex-shrink: 0;
}
.comment-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0b354;
}
.comment-avatar i {
  font-size: 48px;
  color: #a0aec0;
}
.comment-body {
  flex: 1;
  min-width: 0;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.comment-author {
  font-weight: 700;
  color: #0b3b4f;
  font-size: 0.95rem;
}
.comment-date {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-right: auto;
}
.comment-text {
  color: #2d3748;
  line-height: 1.7;
  text-align: justify;
  word-wrap: break-word;
}
.comment-text p {
  margin-bottom: 6px;
}
.comment-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.comment-actions a,
.comment-actions button {
  font-size: 0.8rem;
  color: #2c5282;
  text-decoration: none;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 20px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.comment-actions a:hover,
.comment-actions button:hover {
  background: #e2e8f0;
  color: #0b3b4f;
}

/* فرم ارسال نظر */
.comment-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
}
.comment-form h3 {
  font-size: 1.2rem;
  color: #0b3b4f;
  margin-bottom: 15px;
}
.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}
.comment-form textarea:focus {
  outline: none;
  border-color: #f0b354;
  box-shadow: 0 0 0 3px rgba(240,179,84,0.25);
}
.comment-form button {
  margin-top: 10px;
  padding: 10px 24px;
  background: #0b3b4f;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.comment-form button:hover {
  background: #1a6b8a;
}
.comment-login-prompt {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 20px;
}
.comment-login-prompt a {
  color: #0b3b4f;
  font-weight: 600;
  text-decoration: none;
}
.comment-login-prompt a:hover {
  text-decoration: underline;
}

/* وضعیت‌ها */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pending {
  background: #fef3c7;
  color: #92430e;
}
.status-approved {
  background: #dcfce7;
  color: #166534;
}
.status-needs_edit {
  background: #fee2e2;
  color: #991b1b;
}

@media screen and (max-width: 768px) {
  .comment {
    flex-direction: column;
    gap: 10px;
  }
  .comment-avatar img {
    width: 40px;
    height: 40px;
  }
  .comment-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .comment-form textarea {
    font-size: 0.9rem;
  }
}

/* ==================== داشبورد و پروفایل ==================== */
.profile-dashboard {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.profile-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
}

.avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f0b354;
}

.profile-avatar-icon {
  font-size: 80px;
  color: #a0aec0;
  border: none;
  border-radius: 50%;
  display: block;
  width: 80px;
  height: 80px;
  line-height: 80px;
  text-align: center;
  background: #f8fafc;
}

.user-role {
  background: #e2e8f0;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #2d3748;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.avatar-upload input[type="file"] {
  font-size: 0.9rem;
}

.profile-links {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-link {
  padding: 8px 16px;
  background: #f1f5f9;
  border-radius: 8px;
  text-decoration: none;
  color: #2d3748;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.btn-link:hover {
  background: #e2e8f0;
  color: #0b3b4f;
}

.logout-btn {
  background: #fee2e2;
  color: #991b1b;
}

.logout-btn:hover {
  background: #fecaca;
}

.error-msg {
  color: #e53e3e;
  width: 100%;
  margin-top: 5px;
}

/* کارت‌های داشبورد */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.dash-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: #2d3748;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: box-shadow 0.2s, transform 0.2s;
  text-align: center;
}

.dash-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  border-color: #f0b354;
}

.dash-card i {
  font-size: 2rem;
  color: #0b3b4f;
}

.dash-card span {
  font-weight: 600;
  font-size: 1.1rem;
}

.dash-card small {
  color: #64748b;
  font-size: 0.8rem;
}

/* ==================== جداول مدیریتی ==================== */
.admin-table,
.articles-table,
.users-table,
.comments-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.admin-table th, .admin-table td,
.articles-table th, .articles-table td,
.users-table th, .users-table td,
.comments-table th, .comments-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: right;
}

.admin-table th,
.articles-table th,
.users-table th,
.comments-table th {
  background: #0b3b4f;
  color: white;
}

/* دکمه‌های کوچک */
.btn-small,
.btn-small.publish,
.btn-small.reject {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
  background: #e2e8f0;
  color: #2d3748;
}

.btn-small.publish {
  background: #d4edda;
  color: #155724;
}

.btn-small.reject {
  background: #f8d7da;
  color: #721c24;
}

.btn-small:hover {
  opacity: 0.85;
}

/* ==================== نشست‌های فعال ==================== */
.sessions-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.sessions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.session-item.current {
  background-color: #e6fffa;
  border-right: 4px solid #319795;
}

.session-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.badge,
.badge-current {
  background-color: #81e6d9;
  color: #234e52;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: bold;
}

.btn-delete,
.btn-delete-session {
  color: #e53e3e;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ==================== صفحات ورود و ثبت‌نام ==================== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 20px;
}

.auth-box {
  background: white;
  border-radius: 16px;
  padding: 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
}

.auth-box h2 {
  text-align: center;
  color: #0b3b4f;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.4rem;
}

.auth-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #2d3748;
  font-size: 0.9rem;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: #f0b354;
  box-shadow: 0 0 0 3px rgba(240,179,84,0.25);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: #0b3b4f;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
}

.auth-btn:hover {
  background: #1a6b8a;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  color: #64748b;
  font-size: 0.9rem;
}

.auth-link a {
  color: #0b3b4f;
  font-weight: 600;
}

@media (max-width: 480px) {
  .auth-box {
    padding: 20px;
    border-radius: 12px;
  }
}

/* ==================== اسکرول‌بار ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #0b3b4f;
  border-radius: 10px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: #1a6b8a;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #0b3b4f #f1f5f9;
}

/* ==================== بهبود آپلود و ویرایش پروفایل ==================== */
.avatar-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
}

.upload-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-label {
    background: #0b3b4f;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.upload-label:hover {
    background: #1a6b8a;
}

.upload-btn {
    background: #f0b354;
    color: #0b3b4f;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.upload-btn:hover {
    background: #e09e3c;
    color: #0b3b4f;
}

.delete-avatar-btn {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.delete-avatar-btn:hover {
    background: #fecaca;
}

/* فرم ویرایش مشخصات */
.profile-edit {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}

.profile-edit h3 {
    margin-bottom: 15px;
    color: #0b3b4f;
}

.edit-form .form-group {
    margin-bottom: 12px;
}

.edit-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2d3748;
}

.edit-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
}

.edit-form input:focus {
    border-color: #f0b354;
    outline: none;
    box-shadow: 0 0 0 2px rgba(240,179,84,0.3);
}

.save-profile-btn {
    background: #0b3b4f;
    color: white;
    border: none;
    margin-top: 5px;
}

.save-profile-btn:hover {
    background: #1a6b8a;
}

.success-msg {
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* ==================== ویرایش درجا (inline edit) ==================== */
.inline-edit {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.inline-edit span {
    font-size: 1rem;
    color: #2d3748;
    flex: 1;
    padding: 8px 0;
}
.inline-edit input {
    width: auto;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    flex: 1;
}
.edit-toggle {
    background: #edf2f7;
    color: #2d3748;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}
.edit-toggle:hover {
    background: #e2e8f0;
}
.save-profile-btn {
    background: #0b3b4f;
    color: white;
    border: none;
}
.save-profile-btn:hover {
    background: #1a6b8a;
}

/* دکمه‌های فیلتر */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}
.filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    background: #e2e8f0;
    color: #2d3748;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
    border: 1px solid transparent;
}
.filter-btn:hover,
.filter-btn.active {
    background: #0b3b4f;
    color: white;
    border-color: #0b3b4f;
}

/* مودال */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-box {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}
.modal-message {
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.6;
}
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.modal-close-btn, .modal-login-btn {
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
}
.modal-close-btn {
    background: #e2e8f0;
    color: #2d3748;
}
.modal-login-btn {
    background: #0b3b4f;
    color: white;
}
.modal-login-btn:hover {
    background: #1a6b8a;
}
.modal-close-btn:hover {
    background: #cbd5e1;
}

.article-stats {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 15px;
    margin: 15px 0;
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #2d3748;
}


/* آمار صفحات – چیدمان عمودی */
.stats-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}

.stats-section h2 {
    font-size: 1.2rem;
    color: #0b3b4f;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-line {
    background: #f1f5f9;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-top: 20px; }
.category-card {
    background: white; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 20px; text-align: center; text-decoration: none;
    color: #0b3b4f; font-weight: 600; transition: 0.2s;
}
.category-card:hover { background: #f8fafc; border-color: #f0b354; }

.auth-msg {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.auth-success {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}


/* صفحه عمومی پروفایل */
.public-profile {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.profile-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0b354;
}

.profile-avatar-large i {
    font-size: 120px;
    color: #a0aec0;
}

.profile-details h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: #0b3b4f;
}

.username {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.member-since {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 8px;
}

.profile-bio {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.profile-bio h2 {
    font-size: 1.2rem;
    color: #0b3b4f;
    margin-bottom: 10px;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    font-size: 1.2rem;
    color: #0b3b4f;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
}

.comment-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* ==================== بخش «دربارهٔ من» در پنل کاربری ==================== */
.profile-about-section {
    background: #f8fafc;
    border-radius: 14px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9edf2;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-about-section:hover {
    border-color: #cbd5e1;
}

.profile-about-section h4 {
    font-size: 1.1rem;
    color: #0b3b4f;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.profile-about-section textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Lalezar', 'Segoe UI', Tahoma, sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    resize: vertical;
    min-height: 100px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-about-section textarea:focus {
    outline: none;
    border-color: #f0b354;
    box-shadow: 0 0 0 3px rgba(240,179,84,0.2);
    background: #fff;
}

.profile-about-section small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* هماهنگ‌سازی textarea در حالت inline-edit */
.inline-edit textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Lalezar', 'Segoe UI', Tahoma, sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inline-edit textarea:focus {
    outline: none;
    border-color: #f0b354;
    box-shadow: 0 0 0 2px rgba(240,179,84,0.25);
}

/* استایل disabled برای textarea (مات) */
.inline-edit textarea.disabled-input {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ddd;
}

/* خطوط جداکننده بین فیلدهای ویرایش پروفایل */
.profile-edit .form-group {
    border-bottom: 1px solid #e9edf2;
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.profile-edit .form-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}



/* ==================== دکمه‌های ویرایش inline ==================== */
.edit-toggle {
    background: #f0b354;
    color: #0b3b4f;
    border: none;
    cursor: pointer;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.edit-toggle:hover {
    background: #e09e3c;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.edit-toggle i {
    font-size: 0.7rem;
}

/* ==================== دکمهٔ ذخیره تغییرات ==================== */
.save-profile-btn {
    background: #0b3b4f;
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px 18px;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.save-profile-btn:hover {
    background: #1a6b8a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* ==================== مودال کراپ تصویر ==================== */
.crop-modal-box {
    max-width: 500px;
    width: 95%;
    padding: 20px;
}

.crop-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.crop-viewport {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #f0b354;
    background: #f1f5f9;
    position: relative;
}

.crop-viewport img {
    display: block;
    transform-origin: 0 0;   /* خیلی مهم */
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    max-width: none;
    max-height: none;
}

.crop-controls {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

.crop-controls input[type="range"] {
    width: 80%;
    accent-color: #0b3b4f;
}

.cancel-crop-btn {
    background: #e2e8f0;
    color: #2d3748;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'Lalezar', 'Segoe UI', Tahoma, sans-serif;
}

.save-crop-btn {
    background: #0b3b4f;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin-right: 10px;
    font-family: 'Lalezar', 'Segoe UI', Tahoma, sans-serif;
}

.save-crop-btn:hover { background: #1a6b8a; }


/* ==================== صفحهٔ ۴۰۴ ==================== */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.error-content {
    max-width: 550px;
    width: 100%;
}

.error-icon {
    font-size: 5rem;
    color: #f0b354;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    color: #0b3b4f;
    line-height: 1;
    margin-bottom: 10px;
    letter-spacing: -2px;
}

.error-title {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 15px;
    font-weight: 700;
}

.error-message {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.8;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.error-btn {
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Lalezar', 'Segoe UI', Tahoma, sans-serif;
}

.primary-btn {
    background: #0b3b4f;
    color: white;
}

.primary-btn:hover {
    background: #1a6b8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(11, 59, 79, 0.3);
}

.secondary-btn {
    background: #f1f5f9;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

.secondary-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.error-help {
    font-size: 0.85rem;
    color: #94a3b8;
}

.error-help a {
    color: #0b3b4f;
    font-weight: 600;
}

/* واکنش‌گرایی برای موبایل */
@media (max-width: 480px) {
    .error-code {
        font-size: 4rem;
    }
    .error-title {
        font-size: 1.3rem;
    }
    .error-icon {
        font-size: 3.5rem;
    }
}