/* ریست پایه */
* {
  box-sizing: border-box;
  font-family: "Vazir", Tahoma, sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* پس‌زمینه کلی و رنگ متن */
#main-content {
  background: linear-gradient(135deg, #000000 0%, #000000F6 100%);
  color: #eee;
  min-height: 100vh;
  padding: 1.5rem 2rem;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* عناوین */
h2, h3 {
  margin-bottom: 1rem;
  font-weight: 700;
  color: #d7c5ec;
  text-shadow: 0 0 10px #a855f7cc;
  letter-spacing: 0.04em;
}

/* آکاردئون */
.accordion-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.accordion {
  margin-bottom: 1.25rem;
  background: rgba(30, 0, 60, 0.45);
  border-radius: 18px;
  box-shadow:
    3px 3px 3px 3px rgba(157, 59, 248, 0.35),
    inset 0 0 0px rgba(168, 85, 247, 0.3);
  backdrop-filter: blur(14px);
  border: 1.5px solid #6b21a8cc;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.accordion:hover {
  box-shadow:
    0 5px 5px rgba(216, 180, 254, 0.7),
    inset 0 0 14px rgba(216, 180, 254, 0.5);
}

/* هدر آکاردئون */
.accordion-header {
  padding: 1.2rem 1.6rem;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(90deg, #3b0764, #5b21b6);
  color: #f3e8ff;
  box-shadow: inset 0 -3px 10px #a855f7cc;
  user-select: none;
  border-radius: 18px 18px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.accordion-header:hover {
  background: linear-gradient(90deg, #5b21b6, #7c3aed);
}

/* آیکون باز و بسته */
.accordion-header::after {
  content: "▼";
  font-size: 1rem;
  transition: transform 0.3s ease, color 0.3s ease;
  color: #d8b4fe;
  user-select: none;
}
.accordion-header.open::after {
  transform: rotate(-180deg);
  color: #f0dbff;
}

/* بدنه آکاردئون */
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.35s ease;
  padding: 0 1.6rem;
  background: rgba(20, 0, 50, 0.4);
  border-top: 1.5px solid #6b21a8cc;
  border-radius: 0 0 18px 18px;
}
.accordion-body.open {
  max-height: 1100px;
  padding: 1.25rem 1.6rem 1.75rem;
}

/* فرم ثبت هزینه */
form#expense-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  color: #000000;
  user-select: text;
}
form#expense-form label {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 1rem;
  color: #e9e9e9;
  letter-spacing: 0.02em;
}

/* استایل مشترک برای select, input, textarea */
form#expense-form select,
form#expense-form input[type="number"],
form#expense-form textarea {
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 15px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #eee;
  font-size: 1rem;
  font-weight: 600;
  box-shadow:
    inset 0 0 3px #7c3aedcc,
    0 0 10px transparent;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  cursor: pointer;
  user-select: text;
}

/* استایل انتخابگر سفارشی برای select */
form#expense-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #3b0764;
  color: #eee;
  background-image:
    linear-gradient(45deg, transparent 50%, #a855f7 50%),
    linear-gradient(135deg, #a855f7 50%, transparent 50%),
    radial-gradient(#a855f7 70%, transparent 72%);
  background-position:
    calc(100% - 25px) calc(1em + 2px),
    calc(100% - 20px) calc(1em + 2px),
    calc(100% - 15px) 1.3em;
  background-size: 7px 5px, 7px 5px, 10px 10px;
  background-repeat: no-repeat;
  padding-right: 3rem;
  border: none;
  border-radius: 15px;
  box-shadow: inset 0 0 8px #7c3aedcc;
}

/* فقط رنگ متن option ها */
form#expense-form select option {
  background-color: #2a004a;
  color: #ddd;
}

/* برخی مرورگرها ممکن است این را پشتیبانی نکنند */
form#expense-form select option:hover,
form#expense-form select option:checked {
  background-color: #5b21b6;
  color: #fff;
}


/* فیدبک فوکوس و هاور */
form#expense-form select:hover,
form#expense-form input[type="number"]:hover,
form#expense-form textarea:hover,
form#expense-form select:focus,
form#expense-form input[type="number"]:focus,
form#expense-form textarea:focus {
  background: rgba(255 255 255 / 0.2);
  outline: none;
  box-shadow:
    0 0 12px #a855f7cc,
    inset 0 0 14px #d8b4feaa;
  color: #fff;
}

/* textarea */
form#expense-form textarea {
  resize: vertical;
  min-height: 55px;
  max-height: 140px;
  font-family: inherit;
  letter-spacing: 0.01em;
}

/* دکمه ارسال */
form#expense-form button[type="submit"] {
  padding: 0.75rem 1.6rem;
  background: linear-gradient(45deg, #7c3aed, #a855f7);
  border-radius: 20px;
  border: none;
  color: white;
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow:
    0 6px 18px #a855f7dd;
  transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
  align-self: flex-start;
  user-select: none;
  letter-spacing: 0.03em;
}
form#expense-form button[type="submit"]:hover {
  background: linear-gradient(45deg, #a855f7, #d8b4fe);
  transform: scale(1.07);
  box-shadow:
    0 10px 25px #d8b4feee;
}
form#expense-form button[type="submit"]:active {
  transform: scale(0.95);
  box-shadow: 0 4px 14px #a855f7bb;
}

/* پیام وضعیت فرم */
#form-status {
  font-weight: 600;
  margin-top: 0.55rem;
  min-height: 1.4rem;
  user-select: text;
  color: #d8b4fe;
}

/* فیلترها */
.expense-filters,
.income-filters,
.summary-filters {
  margin-bottom: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  color: #ddd;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  user-select: none;
}
.expense-filters select,
.expense-filters input,
.income-filters input,
.summary-filters input {
  padding: 0.45rem 0.9rem;
  border-radius: 15px;
  border: none;
  background: rgba(255 255 255 / 0.12);
  color: #eee;
  box-shadow:
    inset 0 0 8px #7c3aedcc;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease;
  appearance: none;
  user-select: text;
}
.expense-filters select:hover,
.expense-filters input:hover,
.income-filters input:hover,
.summary-filters input:hover,
.expense-filters select:focus,
.expense-filters input:focus,
.income-filters input:focus,
.summary-filters input:focus {
  background: rgba(255 255 255 / 0.22);
  outline: none;
  box-shadow:
    0 0 14px #a855f7cc,
    inset 0 0 16px #d8b4fecc;
  color: #fff;
}

/* دکمه‌های فیلتر */
.expense-filters button,
.income-filters button,
.summary-filters button {
  padding: 0.55rem 1.3rem;
  border-radius: 20px;
  border: none;
  background: linear-gradient(45deg, #7c3aed, #a855f7);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 5px 14px #a855f7cc;
  transition: background 0.3s ease, transform 0.15s ease;
  user-select: none;
}
.expense-filters button:hover,
.income-filters button:hover,
.summary-filters button:hover {
  background: linear-gradient(45deg, #a855f7, #d8b4fe);
  transform: scale(1.06);
}
.expense-filters button:active,
.income-filters button:active,
.summary-filters button:active {
  transform: scale(0.96);
}

/* جدول‌ها */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-size: 1rem;
  color: #ddd;
  user-select: text;
  letter-spacing: 0.02em;
}
thead th {
  background: linear-gradient(90deg, #5b21b6, #7c3aed);
  color: #f3e8ff;
  font-weight: 700;
  padding: 0.9rem
}

.scrollable {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #444;
  padding: 10px;
  border-radius: 8px;
}

/* اسکرول برای کروم، اج و سافاری */
.scrollable::-webkit-scrollbar {
  width: 8px;
}

.scrollable::-webkit-scrollbar-track {
  background: #222;  /* پس‌زمینه‌ی اسکرول‌بار */
}

.scrollable::-webkit-scrollbar-thumb {
  background-color: #555; /* دسته‌ی اسکرول */
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
  background-color: #888;
}

/* اسکرول برای فایرفاکس */
.scrollable {
  scrollbar-width: thin;
  scrollbar-color: #555 #222;
}



/* تغییر تم */

/* تم روشن */
body[data-theme="light"] #main-content {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  color: #222;
}

body[data-theme="light"] h2,
body[data-theme="light"] h3 {
  color: #4b0082;
  text-shadow: 0 0 6px #a855f755;
}

body[data-theme="light"] .accordion {
  background: rgba(240, 240, 255, 0.6);
  box-shadow: 2px 2px 8px rgba(100, 100, 255, 0.15);
  border: 1px solid #ccc;
}

body[data-theme="light"] .accordion:hover {
  box-shadow: 0 5px 15px rgba(120, 120, 255, 0.4);
}

body[data-theme="light"] .accordion-header {
  background: linear-gradient(90deg, #e0dfff, #c6c3ff);
  color: #333;
  box-shadow: inset 0 -2px 6px #a855f755;
}

body[data-theme="light"] .accordion-header:hover {
  background: linear-gradient(90deg, #c6c3ff, #a6a3ff);
}

body[data-theme="light"] .accordion-header::after {
  color: #6b21a8;
}

body[data-theme="light"] .accordion-header.open::after {
  color: #5b21b6;
}

body[data-theme="light"] .accordion-body {
  background: rgba(250, 250, 255, 0.9);
  border-top: 1px solid #ccc;
}

body[data-theme="light"] form#expense-form label {
  color: #333;
}

body[data-theme="light"] form#expense-form select,
body[data-theme="light"] form#expense-form input[type="number"],
body[data-theme="light"] form#expense-form textarea {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  box-shadow:
    inset 0 0 3px #ccc;
}

body[data-theme="light"] form#expense-form select {
  background-color: #e4e4ff;
  color: #333;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b21a8 50%),
    linear-gradient(135deg, #6b21a8 50%, transparent 50%),
    radial-gradient(#6b21a8 70%, transparent 72%);
}

body[data-theme="light"] form#expense-form select option {
  background-color: #fff;
  color: #222;
}

body[data-theme="light"] form#expense-form select option:hover,
body[data-theme="light"] form#expense-form select option:checked {
  background-color: #dcdcff;
  color: #000;
}

body[data-theme="light"] form#expense-form select:hover,
body[data-theme="light"] form#expense-form input[type="number"]:hover,
body[data-theme="light"] form#expense-form textarea:hover,
body[data-theme="light"] form#expense-form select:focus,
body[data-theme="light"] form#expense-form input[type="number"]:focus,
body[data-theme="light"] form#expense-form textarea:focus {
  background: rgba(255, 255, 255, 1);
  box-shadow:
    0 0 12px #a855f755,
    inset 0 0 14px #cfcfff;
  color: #000;
}

body[data-theme="light"] form#expense-form button[type="submit"] {
  background: linear-gradient(45deg, #6b21a8, #9333ea);
  color: white;
}

body[data-theme="light"] form#expense-form button[type="submit"]:hover {
  background: linear-gradient(45deg, #9333ea, #c084fc);
  box-shadow: 0 10px 20px #d8b4feaa;
}

body[data-theme="light"] #form-status {
  color: #6b21a8;
}

body[data-theme="light"] .expense-filters,
body[data-theme="light"] .income-filters,
body[data-theme="light"] .summary-filters {
  color: #333;
}

body[data-theme="light"] .expense-filters select,
body[data-theme="light"] .expense-filters input,
body[data-theme="light"] .income-filters input,
body[data-theme="light"] .summary-filters input {
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  box-shadow: inset 0 0 8px #ccc;
}

body[data-theme="light"] .expense-filters select:hover,
body[data-theme="light"] .expense-filters input:hover,
body[data-theme="light"] .income-filters input:hover,
body[data-theme="light"] .summary-filters input:hover,
body[data-theme="light"] .expense-filters select:focus,
body[data-theme="light"] .expense-filters input:focus,
body[data-theme="light"] .income-filters input:focus,
body[data-theme="light"] .summary-filters input:focus {
  background: rgba(255, 255, 255, 1);
  box-shadow:
    0 0 12px #a855f755,
    inset 0 0 14px #d4cafe;
  color: #000;
}

body[data-theme="light"] .expense-filters button,
body[data-theme="light"] .income-filters button,
body[data-theme="light"] .summary-filters button {
  background: linear-gradient(45deg, #6b21a8, #9333ea);
  color: #fff;
}


body[data-theme="light"] table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-size: 1rem;
  color: #000000;
  user-select: text;
  letter-spacing: 0.02em;
}
body[data-theme="light"] thead th {
  background: linear-gradient(90deg, #d2bdf4, #dbdbdb);
  color: #000000;
  font-weight: 700;
  padding: 0.9rem
}

body[data-theme="light"] .scrollable {
  border: 1px solid #ccc;
}

body[data-theme="light"] .scrollable::-webkit-scrollbar {
  width: 8px;
}

body[data-theme="light"] .scrollable::-webkit-scrollbar-track {
  background: #f0f0f0;
}

body[data-theme="light"] .scrollable::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 4px;
}

body[data-theme="light"] .scrollable::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

body[data-theme="light"] .scrollable {
  scrollbar-width: thin;
  scrollbar-color: #bbb #f0f0f0;
}