/* ------------------ فونت‌ها ------------------ */
@font-face {
  font-family: 'Vazir';
  src: url('/static/fonts/Vazir-Regular.ttf') format('truetype');
  font-weight: normal;
}
@font-face {
  font-family: 'Vazir';
  src: url('/static/fonts/Vazir-Bold.ttf') format('truetype');
  font-weight: bold;
}

/* ------------------ رنگ‌ها و متغیرها ------------------ */
:root {
  --admin-color: #388e3c;     /* سبز اصلی برند */
  --student-color: #7e57c2;   /* بنفش برند */
  --guest-color: #757575;
  --border-color: #e0e0e0;
  --bg-reply: #ede7f6;
  --bg-comment: #ffffff;
  --font-main: 'Vazir', sans-serif;
}

/* ------------------ ساختار کلی ------------------ */
body {
  font-family: var(--font-main);
  background: #fafafa;
  color: #333;
  line-height: 1.7;
}

.comments-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.comments-title {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--student-color);
  margin-bottom: 20px;
  border-bottom: 3px solid var(--student-color);
  padding-bottom: 5px;
}

/* ------------------ کارت نظر ------------------ */
.comment-box {
  background: var(--bg-comment);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease;
}
.comment-box:hover {
  transform: translateY(-2px);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: bold;
  color: #222;
}

.comment-date {
  font-size: 0.85rem;
  color: #777;
}

.comment-text {
  margin-top: 10px;
  font-size: 0.95rem;
}

/* ------------------ پاسخ‌ها ------------------ */
.comment-reply {
  margin-top: 12px;
  margin-right: 20px;
  padding: 12px 15px;
  border-right: 4px solid var(--student-color);
  background: var(--bg-reply);
  border-radius: 10px;
}

.reply-author {
  color: var(--admin-color);
  font-weight: bold;
}

.reply-text {
  margin-top: 4px;
  color: #333;
  font-size: 0.93rem;
}

/* ------------------ برچسب‌ها ------------------ */
.badge {
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 6px;
  color: #fff;
  margin-right: 6px;
}
.badge.admin { background: var(--admin-color); }
.badge.student { background: var(--student-color); }
.badge.guest { background: var(--guest-color); }

/* ------------------ فرم ارسال نظر ------------------ */
.comment-form {
  background: #f9f9ff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.comment-form h3 {
  color: var(--student-color);
  font-weight: bold;
  margin-bottom: 15px;
}

.comment-form label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  color: #333;
}

.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
  border-color: var(--student-color);
  box-shadow: 0 0 5px rgba(126, 87, 194, 0.3);
}
.comment-form textarea {
  min-height: 90px;
  resize: vertical;
}

/* ------------------ کپچا ------------------ */
.captcha-wrapper {
  background: #ffffff;
  border: 1px solid var(--student-color);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: inset 0 0 6px rgba(126, 87, 194, 0.2);
}

.captcha-question {
  background: linear-gradient(135deg, #7e57c2 20%, #388e3c 90%);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.comment-form input[name="captcha"] {
  text-align: center;
  width: 120px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
}

/* ------------------ دکمه ارسال ------------------ */
.submit-btn {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--student-color), var(--admin-color));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.submit-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

/* ------------------ پیام‌ها ------------------ */
.django-messages {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
}
.msg {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
}
.msg.success { background: #e8f5e9; border: 1px solid #a5d6a7; }
.msg.error { background: #ffebee; border: 1px solid #ef9a9a; }

/* ------------------ صفحه‌بندی ------------------ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.page-btn {
  background: #f5f5f5;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  transition: background 0.2s ease;
}
.page-btn:hover {
  background: #e0e0e0;
}
.page-info {
  font-size: 0.9rem;
  color: #666;
}

/* ------------------ واکنش‌گرایی ------------------ */
@media (max-width: 768px) {
  .comments-container { padding: 15px; }
  .comment-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .comment-box { padding: 14px; }
  .comment-reply { margin-right: 10px; padding: 10px; }
  .captcha-wrapper { padding: 10px; }
  .captcha-question { font-size: 1rem; padding: 6px 12px; }
  .submit-btn { width: 100%; }
}
/* --- فقط بخش نمایش نظرات اسکرولی شود --- */
.comments-scroll-area {
  max-height: 70vh;
  overflow-y: auto;
  background: #fafafa;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  margin-top: 15px;
  margin-bottom: 20px;
}

/* استایل اسکرول */
.comments-scroll-area::-webkit-scrollbar {
  width: 8px;
}
.comments-scroll-area::-webkit-scrollbar-thumb {
  background-color: var(--student-color);
  border-radius: 4px;
}
.comments-scroll-area::-webkit-scrollbar-track {
  background: #eee;
}

/* اصلاح نهایی ارتفاع باکس نظرات در موبایل */
@media (max-width: 768px) {
  .comments-scroll-area {
    max-height: 900px !important; /* یا به دلخواه مثلاً 75vh */
    padding: 14px !important;
  }
}


