:root {
  --primary-color: #7c4dff; /* بنفش روشن */
  --primary-dark: #512da8; /* بنفش تیره */
  --accent-color: rgba(124, 77, 255, 0.15);
  --danger-color: #e53935;
  --danger-dark: #ab000d;
  --success-color: #00c853;
  --success-dark: #00b34e;
  --gray-light: #1a002d;
  --text-light: #f0f0f0;
  --text-muted: #bdbdbd;
  --shadow: 0 4px 16px rgba(124, 77, 255, 0.3);
  --transition: all 0.4s ease-in-out;
  --glass-bg: rgba(26, 0, 45, 0.65);
}

body {
  background: linear-gradient(to bottom, #000000, #1a002d);
  margin: 0;
  font-family: 'Vazir', sans-serif;
  direction: rtl;
  color: var(--text-light);
}

/* =============== POS APP =============== */
#pos-app {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  animation: fadeIn 0.5s ease;
}

/* دسته‌بندی‌ها */
.category-nav {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

.category-nav button {
  background-color: var(--accent-color);
  border: 1px solid var(--primary-dark);
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  color: var(--text-light);
  backdrop-filter: blur(10px);
}

.category-nav button:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
  color: #fff;
}

/* محصولات */
.product-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
  border-radius: 16px;
  background: var(--glass-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.product-card {
  flex: 0 0 140px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  animation: fadeInUp 0.4s ease;
}

.product-card:hover {
  background: rgba(124, 77, 255, 0.1);
  box-shadow: 0 0 12px rgba(124, 77, 255, 0.5);
}

.product-card img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  margin-bottom: 10px;
  pointer-events: none;
  border-radius: 8px;
}

.product-card h4 {
  margin: 0;
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-light);
}

.product-card p {
  margin: 4px 0 0;
  font-weight: bold;
  color: var(--primary-color);
  font-size: 0.9rem;
}

/* سفارشات */
.order-section {
  background: var(--glass-bg);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.order-section h3 {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 18px;
}

#order-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  color: var(--text-light);
}

#order-table th,
#order-table td {
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px;
  text-align: center;
  font-size: 0.95rem;
}

#order-table th {
  background-color: var(--primary-dark);
  color: #fff;
  font-weight: bold;
}

.qty-btn,
#order-table td:nth-child(2) button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.qty-btn:hover {
  background-color: var(--primary-dark);
}

input[type="text"] {
  width: 40px;
  text-align: center;
  border: 1px solid #555;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

/* دکمه حذف */
.delete-btn,
#order-table td:last-child button {
  background-color: var(--danger-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.delete-btn:hover {
  background-color: var(--danger-dark);
}

#total-price {
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--text-light);
  text-align: left;
  padding-left: 10px;
}

/* دکمه خرید */
#buy-btn {
  background: var(--primary-color);
  color: white;
  font-size: 1rem;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

#buy-btn:hover {
  background-color: var(--primary-dark);
}

/* =============== Popup =============== */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.popup-box {
  background: var(--glass-bg);
  padding: 28px;
  border-radius: 16px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  direction: rtl;
  font-family: inherit;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.4s ease;
  backdrop-filter: blur(12px);
}

.popup-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 16px;
}

.popup-content {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.popup-btn {
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.popup-btn.yes {
  background-color: var(--primary-color);
  color: white;
}

.popup-btn.yes:hover {
  background-color: var(--primary-dark);
}

.popup-btn.no {
  background-color: var(--danger-color);
  color: white;
}

.popup-btn.no:hover {
  background-color: var(--danger-dark);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}


.discount-input {
  background-color: rgba(124, 77, 255, 0.1);
  border: 1px solid var(--primary-dark);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-light);
  font-weight: bold;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.discount-input:focus {
  outline: none;
  box-shadow: 0 0 10px var(--primary-color);
}




.order-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

#order-table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}




/* تغییر تم  */


body[data-theme="light"] {
  --primary-color: #7c4dff; /* بنفش روشن */
  --primary-dark: #4a3f8a; /* بنفش تیره‌تر برای روشن */
  --accent-color: rgba(124, 77, 255, 0.15);
  --danger-color: #d32f2f;
  --danger-dark: #9a2424;
  --success-color: #388e3c;
  --success-dark: #2e7030;
  --gray-light: #e0e0e0;
  --text-light: #3a3a5a; /* متن تیره برای روشن */
  --text-muted: #7a7a9e;
  --shadow: 0 4px 16px rgba(124, 77, 255, 0.2);
  --transition: all 0.4s ease-in-out;
  --glass-bg: rgba(255, 255, 255, 0.85);
  
  background: linear-gradient(to bottom, #f5f5f5, #dcdcff);
  color: var(--text-light);
  font-family: 'Vazir', sans-serif;
  direction: rtl;
}

/* دکمه‌های فرم */
body[data-theme="light"] .form-buttons button {
  color: #3a3a5a;
  box-shadow: 0 0 15px transparent;
}

/* دسته‌بندی‌ها */
body[data-theme="light"] .category-nav button {
  background-color: var(--accent-color);
  border: 1px solid var(--primary-dark);
  color: var(--text-light);
  backdrop-filter: none;
}

body[data-theme="light"] .category-nav button:hover {
  background: var(--primary-color);
  box-shadow: var(--shadow);
  color: #fff;
}

/* محصولات */
body[data-theme="light"] .product-list {
  background: var(--glass-bg);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  color: var(--gray-light);
}

body[data-theme="light"] .product-card {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
  transition: var(--transition);
}

body[data-theme="light"] .product-card:hover {
  background: var(--primary-color);
  box-shadow: 0 0 12px rgba(124, 77, 255, 0.5);
  color: rgb(18, 18, 18);
}

body[data-theme="light"] .product-card h4 {
  color: #333;
}

body[data-theme="light"] .product-card p {
  color: #500000;
}

/* سفارشات */
body[data-theme="light"] .order-section {
  background: var(--glass-bg);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
  color: #333;
}

body[data-theme="light"] #order-table {
  border-color: #ccc;
  color: #333;
}

body[data-theme="light"] #order-table th {
  background-color: var(--primary-dark);
  color: #020202;
}

body[data-theme="light"] .qty-btn,
body[data-theme="light"] #order-table td:nth-child(2) button {
  background-color: var(--primary-color);
  color: rgb(7, 7, 7);
}

body[data-theme="light"] .qty-btn:hover {
  background-color: var(--primary-dark);
}

body[data-theme="light"] input[type="text"] {
  background-color: #fff;
  color: #3a3a5a;
  border: 1px solid #aaa;
}

/* دکمه حذف */
body[data-theme="light"] .delete-btn,
body[data-theme="light"] #order-table td:last-child button {
  background-color: var(--danger-color);
  color: white;
}

body[data-theme="light"] .delete-btn:hover {
  background-color: var(--danger-dark);
}

/* دکمه خرید */
body[data-theme="light"] #buy-btn {
  background: var(--primary-color);
  color: white;
}

body[data-theme="light"] #buy-btn:hover {
  background-color: var(--primary-dark);
}

/* Popup */
body[data-theme="light"] .popup-overlay {
  background: rgba(255, 255, 255, 0.8);
}

body[data-theme="light"] .popup-box {
  background: var(--glass-bg);
  color: #333;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

body[data-theme="light"] .popup-title {
  color: var(--primary-dark);
}

body[data-theme="light"] .popup-content {
  color: var(--text-muted);
}

body[data-theme="light"] .popup-btn.yes {
  background-color: var(--primary-color);
  color: white;
}

body[data-theme="light"] .popup-btn.yes:hover {
  background-color: var(--primary-dark);
}

body[data-theme="light"] .popup-btn.no {
  background-color: var(--danger-color);
  color: white;
}

body[data-theme="light"] .popup-btn.no:hover {
  background-color: var(--danger-dark);
}

/* discount input */
body[data-theme="light"] .discount-input {
  background-color: rgba(124, 77, 255, 0.1);
  border: 1px solid var(--primary-dark);
  color: #3a3a5a;
}

body[data-theme="light"] .discount-input:focus {
  box-shadow: 0 0 10px var(--primary-color);
}
