/* CSS Reset و تنظیمات پایه */
:root {
  --primary: #2c3e50;      /* آبی تیره برای عناوین */
  --secondary: #2980b9;    /* آبی آسمانی برای دکمه‌ها */
  --success: #27ae60;      /* سبز برای دکمه‌های مثبت */
  --warning: #f39c12;      /* نارنجی طلایی برای هشدارها */
  --danger: #e74c3c;       /* قرمز برای دکمه‌های حذف */
  --light: #f5f6fa;        /* پس‌زمینه روشن */
  --dark: #2d3436;         /* متن اصلی */
  --border: #dcdde1;       /* خطوط جداکننده */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Vazir', 'Segoe UI', Tahoma, sans-serif;
}

body {
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  padding: 20px;
}

/* ساختار اصلی */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
}

/* بخش‌ها */
.section {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.section:hover {
  transform: translateY(-2px);
}

/* تایپوگرافی */
h1, h2, h3 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--secondary);
}

/* فرم‌ها و ورودی‌ها */
.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-weight: 500;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

input, select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  transition: all 0.3s ease;
}

input:focus, select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 8px rgba(41, 128, 185, 0.15);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232980b9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-position: left 12px center;
  background-repeat: no-repeat;
  padding-right: 12px;
  direction: rtl;
}

/* جدول‌ها */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
}

th {
  background: var(--secondary);
  color: white;
  padding: 12px;
  font-size: 0.9rem;
}

td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

tr:hover td {
  background: #f8f9fa;
}

/* دکمه‌ها */
button {
  all: unset;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: center;
}

.add-btn {
  background: var(--success);
  color: white;
}

.remove-btn {
  background: var(--danger);
  color: white;
  padding: 8px 16px;
}

.calc-btn {
  background: var(--warning);
  color: white;
}

button:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

/* واکنشگرایی */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
    margin: 1rem;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .section {
    padding: 1rem;
  }

  button {
    width: 100%;
    padding: 14px;
  }
}