/* Reset و تنظیمات پایه */
:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #3f37c9;
  --success: #4cc9f0;
  --danger: #f72585;
  --warning: #f8961e;
  --info: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --white: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* فونت و تایپوگرافی */
@font-face {
  font-family: 'Vazir';
  src: url('../fonts/Vazir-FD-WOL.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazir';
  src: url('../fonts/Vazir-Bold-FD-WOL.woff2') format('woff2');
  font-weight: bold;
  font-display: swap;
}

body {
  font-family: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f5f7fb;
  color: #333;
  line-height: 1.6;
  font-size: 0.9rem;
  direction: rtl;
}

/* طرح‌بندی اصلی */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* کارت‌ها */
.card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: none;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.card-header {
  background-color: var(--primary);
  color: white;
  border-bottom: none;
  padding: 1.25rem 1.5rem;
  border-radius: 12px 12px 0 0 !important;
  font-weight: bold;
}

.card-body {
  padding: 1.5rem;
}

/* کارت‌های آمار */
.stat-card {
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card .bi {
  font-size: 2rem;
  opacity: 0.7;
}

/* نمودار */
.chart-container {
  position: relative;
  height: 300px;
  padding: 15px;
}

/* جدول‌ها */
.table-responsive {
  border-radius: 12px;
  overflow: hidden;
}

.table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  background-color: var(--primary);
  color: white;
  padding: 1rem;
  font-weight: 600;
  border: none;
}

.table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-top: 1px solid #f0f0f0;
}

.table tr:last-child td {
  border-bottom: none;
}

/* فرم‌ها */
.form-control,
.form-select {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* دکمه‌ها */
.btn {
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* ناوبری */
.navbar {
  background-color: white;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  padding: 0.75rem 1rem;
}

.navbar-brand {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.25rem;
}

/* تم تاریک و روشن*/
body.dark-theme {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

.dark-theme .card {
  background: #2c2c2c;
}

.dark-theme .navbar {
  background: #2c2c2c;
}

.dark-theme .table th {
  background: #3a3a3a;
}

/* انیمیشن‌های نرم‌تر: برای جداول و کارت‌ها */
.table tbody tr {
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.table tbody tr:hover {
  background-color: #f1f3f5;
  transform: scale(1.01);
}

/* واکنش‌گرایی */
@media (max-width: 992px) {
  .dashboard-container {
    padding: 1rem;
  }

  .chart-container {
    height: 250px;
  }
}

/* واکنش‌گرایی */
@media (max-width: 768px) {
  .card {
    border-radius: 10px;
  }

  .table-responsive {
    border: 1px solid #dee2e6;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
  }

  .table tbody td {
    display: block;
    text-align: left;
  }

  .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    display: inline-block;
    width: 120px;
    color: var(--gray);
  }
}
/* کاستوم کردن نوتیفیکیشن showtoast  */
.swal-success-toast {
  background-color: #28a745 !important; /* سبز */
  color: white !important;
}
.swal-success-toast .swal2-icon.swal2-success {
  border-color: white !important;
  color: white !important;
}
.swal-error-toast {
  background-color: #dc3545 !important; /* قرمز */
  color: white !important;
}
.swal-info-toast {
  background-color: #17a2b8 !important; /* آبی */
  color: white !important;
}

#connectionResult .alert {
  margin-top: 10px;
  padding: 10px;
}
#submitBtn:disabled {
  opacity: 0.6;
}