@font-face {
  font-family: 'IRANSansWeb';
  src: url('/static/font/IRANSansWeb_Light.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'IRANSansWeb', sans-serif;
  padding-bottom: 70px; /* Space for mobile menu */
}

.latin-numbers {
  font-family: 'Roboto', sans-serif;
}

.navbar-brand img {
  width: 50px;
}

.drawer-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1050;
}

.theme-toggle i.fa-sun {
  color: #333; /* Dark sun in light mode */
}

.dark-mode .theme-toggle i.fa-moon {
  color: #f0f0f0; /* Bright moon in dark mode */
}

.dark-mode {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

.dark-mode .bg-light {
  background-color: #2c2c2c !important;
}

.dark-mode .card {
  background-color: #343a40;
  color: #f0f0f0;
  border-color: #555;
}

.dark-mode .form-control {
  background-color: #2c2c2c;
  color: #f0f0f0;
  border-color: #555;
}

.dark-mode .form-control:focus {
  background-color: #2c2c2c;
  color: #f0f0f0;
  border-color: #777;
  box-shadow: 0 0 0 0.25rem rgba(119, 119, 119, 0.25);
}

.dark-mode .offcanvas {
  background-color: #2c2c2c;
  color: #f0f0f0;
}

.dark-mode .offcanvas .nav-link {
  color: #f0f0f0;
}

/* Mobile Bottom Menu */
.mobile-menu {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-top: 1px solid #ddd;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  padding: 10px 0;
}

.mobile-menu .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
  padding: 8px;
  color: #333;
}

.mobile-menu .nav-link i {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.mobile-menu .nav-link:hover,
.mobile-menu .nav-link.active {
  color: #007bff;
}

.dark-mode .mobile-menu {
  background-color: #2c2c2c;
  border-top: 1px solid #555;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.dark-mode .mobile-menu .nav-link {
  color: #f0f0f0;
}

.dark-mode .mobile-menu .nav-link:hover,
.dark-mode .mobile-menu .nav-link.active {
  color: #66b0ff;
}

@media (max-width: 767px) {
  .drawer-btn {
    display: none;
  }
  .mobile-menu {
    display: flex;
  }
}

/* Common Table Styles */
.table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.table th,
.table td {
  vertical-align: middle;
  padding: 10px;
  border-color: #e0e0e0;
}

.dark-mode .table {
  background-color: #2c2c2c;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.dark-mode .table th,
.dark-mode .table td {
  border-color: #555;
  color: #f0f0f0;
  background-color: #2c2c2c;
}

/* Common Quantity Control */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-control input {
  width: 80px; /* بزرگ‌تر کردن اینپوت */
  height: 36px;
  text-align: center;
  border-radius: 6px;
  font-family: 'Roboto', sans-serif;
  padding: 0.6rem;
  border: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 1.1rem;
}

.quantity-control input:focus {
  border-color: #007bff;
  background-color: #fff;
  outline: none;
}

.dark-mode .quantity-control input {
  background-color: #2c2c2c;
  border-color: #555;
  color: #f0f0f0;
}

.dark-mode .quantity-control input:focus {
  border-color: #66b0ff;
  background-color: #343a40;
}

.quantity-control button {
  border: none;
  background-color: #f1f3f5;
  color: #333;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.quantity-control button:hover {
  background-color: #007bff;
  color: #fff;
}

.dark-mode .quantity-control button {
  background-color: #495057;
  color: #f0f0f0;
}

.dark-mode .quantity-control button:hover {
  background-color: #66b0ff;
}

/* Order Section */
.order-section {
  padding: 2rem 0;
}

.customer-form {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
}

.dark-mode .customer-form {
  background-color: #343a40;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.customer-form .form-label {
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.customer-form .form-control,
.customer-form .form-select {
  padding: 0.4rem 1.5rem 0.4rem 0.5rem;
  font-size: 0.9rem;
  border-radius: 5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.5rem center;
  background-size: 12px;
}

.dark-mode .customer-form .form-select {
  background-color: #2c2c2c;
  border-color: #555;
  color: #f0f0f0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f0f0f0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

.dark-mode .customer-form .form-select:focus {
  border-color: #66b0ff;
  box-shadow: 0 0 0 0.25rem rgba(102, 176, 255, 0.25);
}

.nav-tabs {
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 10px;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 15px;
  color: #333;
  font-weight: 500;
}

.nav-tabs .nav-link.active {
  background-color: #007bff;
  color: #fff;
}

.nav-tabs .nav-link:hover {
  background-color: #e9ecef;
}

.dark-mode .nav-tabs {
  border-bottom: 2px solid #555;
}

.dark-mode .nav-tabs .nav-link {
  color: #f0f0f0;
}

.dark-mode .nav-tabs .nav-link.active {
  background-color: #66b0ff;
}

.dark-mode .nav-tabs .nav-link:hover {
  background-color: #495057;
}

.search-input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  padding: 12px 40px 12px 20px;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid #ced4da;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 24px;
}

.search-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

.dark-mode .search-input {
  border-color: #555;
  background-color: #2c2c2c;
  color: #f0f0f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f0f0f0'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

.dark-mode .search-input:focus {
  border-color: #66b0ff;
  box-shadow: 0 0 10px rgba(102, 176, 255, 0.3);
}

/* Orders Section */
.orders-section {
  padding: 2rem 0;
}

.action-btn {
  font-size: 1rem;
  padding: 5px;
  margin: 0 5px;
  border: none;
  background: none;
  color: #333;
}

.dark-mode .action-btn {
  color: #f0f0f0;
}

.actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
}

/* Inventory Section */
.inventory-section {
  padding: 2rem 0;
}

.modal-content {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.dark-mode .modal-content {
  background-color: #343a40;
  color: #f0f0f0;
  border-color: #555;
}

.modal-table {
  margin-bottom: 0;
}

.modal-table th,
.modal-table td {
  padding: 8px;
}

/* استایل‌های پرینت */
@media print {
  body {
    margin: 0;
    padding: 20px;
    font-family: 'IRANSansWeb', sans-serif;
    color: #333;
    background-color: #fff;
  }
  .print-content {
    max-width: 800px;
    margin: auto;
    font-size: 16px;
  }
  .print-details p {
    margin: 5px 0;
    font-size: 16px;
  }
  .print-table {
    border-collapse: collapse;
    width: 100%;
  }
  .print-table th, .print-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
  }
  .print-table th {
    background-color: #f8f9fa;
  }
  h2, h4, h5 {
    font-weight: bold;
    text-align: center;
  }
  .latin-numbers {
    font-family: 'Roboto', sans-serif;
  }
  /* مخفی کردن عناصر غیرضروری موقع پرینت */
  .theme-toggle, .drawer-btn, .mobile-menu, .modal-footer, .btn-close, .action-btn, .actions {
    display: none !important;
  }
  /* اطمینان از نمایش فقط محتوای پرینت */
  body * {
    visibility: hidden;
  }
  .print-content,
  .print-content * {
    visibility: visible;
  }
  .print-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }
}
