/* base.css - استایل‌های پایه و مشترک برای تمام صفحات */

:root {
  /* رنگ‌های اصلی با پالت مدرن‌تر */
  --primary-blue: #3b82f6;
  --light-blue: #dbeafe;
  --dark-blue: #1e3a8a;
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
  --sidebar-width: 80px;
  --sidebar-expanded-width: 260px;

  /* رنگ‌های سرویس‌ها */
  --blue: #3b82f6;
  --blue-light: #bfdbfe;
  --green: #10b981;
  --green-light: #d1fae5;
  --purple: #a855f7;
  --purple-light: #f3e8ff;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --yellow: #eab308;
  --yellow-light: #fef9c3;
  --red: #ef4444;
  --red-light: #fee2e2;
  --teal: #14b8a6;
  --teal-light: #ccfbf1;
  --indigo: #4f46e5;
  --indigo-light: #e0e7ff;
  --pink: #ec4899;
  --pink-light: #fce7f3;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(12px);

  /* متغیرهای فوتر */
  --footer-height: 60px;
  --footer-text: rgba(31, 41, 55, 0.95);
  --footer-bg: rgba(255, 255, 255, 0.85);
  --footer-accent: #7c3aed;
  --footer-hover: #a78bfa;

  /* متغیرهای چت */
  --purple-primary: #7c3aed;
  --purple-secondary: #3b82f6;
  --gradient-purple: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  --light-purple: #f5f3ff;
  --dark-purple: #4c1d95;

  --color-hadith: #2E7D32;
  --color-quest: #6A1B9A;
  --color-docs: #5E35B1;
  --color-chat: #D32F2F;
  --color-ocr: #455A64;
  --color-wiki: #00897B;
  --color-search: #2563EB;
  /* رنگ‌های اختصاصی برای زیرسرویس‌های سوال از خبره */
  --color-quest-parsa: #4F46E5;
  /* indigo */
  --color-quest-haditha: #6A1B9A;
  /* purple */
  --color-quest-embedding: #F59E0B;
  /* amber */
  --color-quest-freechat: #D32F2F;
  /* red */
  --color-quest-shared-rag: #22C55E;
  /* green */
  --gradient-blue: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);

  --navbar-height: 60px;
  --navbar-z-index: 1000;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, sans-serif;
  background: linear-gradient(to bottom, #f8fafc, #e0e7ff);
  color: #1f2937;
  line-height: 1.7;
  overflow-x: hidden;
  font-size: 1rem;
  transition: overflow 0.3s ease;
}

/* کنترل overflow در حالت منوی موبایل */
body.menu-open {
  overflow: hidden;
}

/* استایل‌های عمومی برای کارت‌ها */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-title {
  color: var(--dark-blue);
  font-weight: 700;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--light-blue);
  margin-bottom: 24px;
  font-size: 1.25rem;
}

/* استایل‌های دکمه‌ها */
.btn-primary {
  background: var(--gradient-blue);
  border: none;
  padding: 12px 30px;
  border-radius: 10px;
  font-weight: 600;
  color: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  transition: left 0.4s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border: none;
  padding: 12px 30px;
  border-radius: 10px;
  font-weight: 600;
  color: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-success:hover {
  background: linear-gradient(135deg, #047857 0%, #10b981 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* استایل‌های فرم */
.form-control,
.form-select {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  transition: all 0.3s ease;
  font-family: 'Vazirmatn', sans-serif;
  background: rgba(255, 255, 255, 0.9);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
  background: white;
}

/* استایل‌های مارک‌داون عمومی */
.markdown-content {
  text-align: justify;
  line-height: 1.9;
  direction: rtl;
  font-family: 'Vazirmatn', sans-serif;
  color: #1f2937;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  text-align: right;
  color: var(--dark-blue);
  font-weight: 700;
}

.markdown-content h1 {
  font-size: 2rem;
}

.markdown-content h2 {
  font-size: 1.5rem;
}

.markdown-content p {
  margin-bottom: 1.25rem;
  text-align: justify;
}

.markdown-content ul,
.markdown-content ol {
  padding-right: 2rem;
  margin-bottom: 1.25rem;
  text-align: right;
}

.markdown-content li {
  margin-bottom: 0.75rem;
}

.markdown-content blockquote {
  border-right: 5px solid var(--light-blue);
  padding-right: 1.5rem;
  margin-right: 0;
  color: #4b5563;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 1.5rem;
  border-radius: 8px;
}

.markdown-content pre {
  font-family: 'Vazirmatn', sans-serif;
  text-align: justify;
  white-space: normal;
  background: var(--glass-bg);
  border: 1px solid #e5e7eb;
  padding: 1rem;
  border-radius: 8px;
}

/* استایل زمان پردازش */
.processing-time {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: left;
  margin-top: 1.25rem;
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
}

/* انیمیشن‌های پایه */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
  }

  100% {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
  }
}

/* رسپانسیو */
@media (max-width: 768px) {
  .card {
    margin-bottom: 20px;
  }

  .markdown-content {
    text-align: right;
  }

  .markdown-content p {
    text-align: right;
  }
}

.full-width {
  margin-right: 0 !important;
  width: 100% !important;
}

.toast-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1055;
  /* بالاتر از سایر عناصر */
  min-width: 300px;
  /* عرض حداقل برای خوانایی */
  max-width: 90%;
  /* جلوگیری از سرریز در صفحه‌های کوچک */
}

/* استایل‌های اضافی برای سازگاری و زیبایی */
.toast-center .toast-body {
  font-size: 1rem;
  text-align: center;
}

@media (max-width: 576px) {
  .toast-center {
    min-width: 80%;
    /* عرض بیشتر در صفحه‌های کوچک */
  }
}