@font-face {
  font-family: 'IranSans';
  src: url('../fonts/IranSans.woff2') format('woff2'),
       url('../fonts/IranSans.woff') format('woff'),
       url('../fonts/IranSans.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'IranSans';
  src: url('../fonts/IranSansBold.woff2') format('woff2'),
       url('../fonts/IranSansBold.woff') format('woff'),
       url('../fonts/IranSansBold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

:root {
  --bs-body-font-family: 'IranSans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 14px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
    margin-bottom: 60px;
    background-color: #f8f9fa;
    font-family: 'IranSans','Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  background-color: #f8f9fa;
  border-color: #e9ecef !important;
}

/* Cards */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  transition: transform 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-5px);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0,0,0,.05);
  border-radius: 10px 10px 0 0 !important;
  font-size: 0.95rem;
}

.card-title {
  font-size: 1.1rem;
}

/* Tables */
.table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  font-size: 0.85rem;
}

.table thead th {
  border-top: none;
  background-color: #f8f9fa;
  font-weight: 600;
}

/* Buttons */
.btn {
  border-radius: 5px;
 /* padding: 0.5rem 1rem;*/
  transition: all 0.2s ease-in-out;
  font-size: 0.85rem;
}

.btn-primary {
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  transform: translateY(-2px);
}

/* Navbar */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
  font-weight: 600;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: all 0.2s ease-in-out;
}

.nav-link:hover {
  transform: translateY(-2px);
}

.nav-link i {
  margin-left: 0.5rem;
}

/* Forms */
.form-control {
  border-radius: 5px;
  border: 1px solid #ced4da;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

/* Stats Cards */
.stats-card {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: white;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.stats-card h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stats-card p {
  margin-bottom: 0;
  opacity: 0.8;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Loading Spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tooltips */
.tooltip {
  font-size: 0.875rem;
}

/* Badges */
.badge {
  padding: 0.5em 0.75em;
  border-radius: 5px;
  font-weight: 500;
}

/* Alert Messages */
.alert {
  border-radius: 10px;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

/* Modal */
.modal-content {
  border-radius: 10px;
  border: none;
}

.modal-header {
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.modal-footer {
  border-top: 1px solid rgba(0,0,0,.05);
}

/* Improve readability */
.text-right {
  text-align: right !important;
}

.text-left {
  text-align: left !important;
}

/* RTL support */
[dir="rtl"] .dropdown-menu {
  text-align: right;
}

/* a.navbar-brand {
  white-space: normal;
  text-align: center;
  word-break: break-all;
}*/

/* Provide sufficient contrast against white background */
a {
  color: #0366d6;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

/* Add Persian date picker improvements */
.datepicker-plot-area {
    font-family: 'IranSans', 'Vazirmatn', Tahoma, sans-serif !important;
    font-size: 0.85rem !important;
}

/* Toast container for notifications */
.toast-container {
  position: fixed;
  bottom: 15px;
  right: 15px;
  z-index: 999999;
}

/* Improve table responsiveness */
@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.8rem;
  }
  
  .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }
}

/* Headings size reduction */
h1, .h1 {
  font-size: 1.8rem;
}

h2, .h2 {
  font-size: 1.6rem;
}

h3, .h3 {
  font-size: 1.4rem;
}

h4, .h4 {
  font-size: 1.2rem;
}

h5, .h5 {
  font-size: 1rem;
}

h6, .h6 {
  font-size: 0.9rem;
}