/* style.css نهایی */
@import url('https://cdn.fontcdn.ir/Font/Persian/Vazir/Vazir.css');

body {
  font-family: 'Vazir', Tahoma, sans-serif;
  background-color: #f8f8f8;
  color: #044244;
  direction: rtl;
  padding: 20px;
  transition: background 0.3s ease;
}

.dark {
  background-color: #000000;
  color: #f1f1f1;
}

h1 {
  color: #FFA238;
  text-align: center;
  font-weight: bold;
  margin-bottom: 30px;
}

form label {
  font-weight: bold;
  margin-top: 10px;
  display: block;
}

form input,
form select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  box-sizing: border-box;
  font-family: 'Vazir', Tahoma, sans-serif;
}

input[type="text"] {
  font-size: 17px;
  font-weight: bold;
  direction: ltr;
  text-align: left;
  background-color: #fffefc;
}

.valueDisplay {
  font-size: 13px;
  color: #777;
  margin-bottom: 10px;
  text-align: left;
  direction: ltr;
}

button {
  background-color: #044244;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: 'Vazir', Tahoma, sans-serif;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

button:hover {
  background-color: #066;
}

#salarySummarySticky {
  position: sticky;
  bottom: 20px;
  background: rgba(4, 76, 68, 0.5); /* رنگ 044244 با شفافیت 50% */
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 30px;
  backdrop-filter: blur(15px); /* ایجاد اثر شیشه‌ای */
  z-index: 100;
}

.sticky-box {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
  font-size: 15px;
}

.sticky-box.total {
  border-top: 1px solid #888;
  padding-top: 6px;
  font-weight: bold;
  font-size: 16px;
}

.sticky-box .label {
  margin-left: 8px;
  color: #FFA238;
}

#actionButtons {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.dark #salarySummarySticky {
  background: #241D1D;
  color: #FFA238;
}

#themeToggle {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #FFA238;
  color: #fff;
  padding: 8px 14px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  border: none;
}

/* واکنش‌گرا */

/* برای دستگاه‌های بزرگتر از 1200px (ویندوز و دسکتاپ) */
@media (min-width: 1200px) {
  body {
    padding: 30px;
  }

  h1 {
    font-size: 36px; /* فونت بزرگتر برای دسکتاپ */
  }

  form input,
  form select {
    font-size: 16px; /* اندازه بزرگتر برای فرم‌ها */
  }

  button {
    font-size: 16px; /* دکمه با فونت بزرگتر */
    padding: 12px 24px;
  }

  .sticky-box {
    font-size: 18px;
  }

  #salarySummarySticky {
    padding: 14px 18px;
  }

  #actionButtons {
    gap: 20px;
  }
}

/* برای دستگاه‌های بین 900px و 1200px */
@media (max-width: 1200px) {
  body {
    padding: 15px;
  }
  
  form input,
  form select {
    font-size: 14px;
  }

  .sticky-box {
    font-size: 14px;
  }

  #actionButtons {
    gap: 10px;
  }
}

/* برای دستگاه‌های کوچکتر از 900px (موبایل‌ها) */
@media (max-width: 900px) {
  h1 {
    font-size: 22px;
  }

  form input,
  form select {
    font-size: 13px;
  }

  button {
    font-size: 12px;
    padding: 8px 16px;
  }

  .sticky-box {
    flex-direction: column;
    font-size: 14px;
  }

  #salarySummarySticky {
    padding: 10px 14px;
  }

  #actionButtons {
    flex-direction: column;
  }
}

/* برای دستگاه‌های کوچکتر از 600px */
@media (max-width: 600px) {
  h1 {
    font-size: 20px;
  }

  form input,
  form select {
    font-size: 12px;
  }

  .sticky-box {
    font-size: 13px;
  }

  #salarySummarySticky {
    font-size: 14px;
    padding: 8px 12px;
  }

  #actionButtons {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
}

@media (max-width: 400px) {
  h1 {
    font-size: 18px;
  }

  form input,
  form select {
    font-size: 12px;
  }

  button {
    font-size: 12px;
    padding: 8px 14px;
  }

  #salarySummarySticky {
    font-size: 12px;
    padding: 6px 10px;
  }

  .sticky-box {
    font-size: 12px;
  }
}

/* استایل اصلی برای سوئیچ */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch #input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2196f3;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  z-index: 0;
  overflow: hidden;
}

/* حرکت خورشید و ماه */
.sun-moon {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: yellow;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

#input:checked + .slider {
  background-color: black;
}

#input:focus + .slider {
  box-shadow: 0 0 1px #2196f3;
}

/* حرکت خورشید به سمت راست */
#input:checked + .slider .sun-moon {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
  background-color: white;
  -webkit-animation: rotate-center 0.6s ease-in-out both;
  animation: rotate-center 0.6s ease-in-out both;
}

/* ستاره‌ها و ابرها */
.moon-dot {
  opacity: 0;
  transition: 0.4s;
  fill: gray;
}

#input:checked + .slider .sun-moon .moon-dot {
  opacity: 1;
}

.slider.round {
  border-radius: 34px;
}

.slider.round .sun-moon {
  border-radius: 50%;
}

#moon-dot-1 {
  left: 10px;
  top: 3px;
  position: absolute;
  width: 6px;
  height: 6px;
  z-index: 4;
}

#moon-dot-2 {
  left: 2px;
  top: 10px;
  position: absolute;
  width: 10px;
  height: 10px;
  z-index: 4;
}

#moon-dot-3 {
  left: 16px;
  top: 18px;
  position: absolute;
  width: 3px;
  height: 3px;
  z-index: 4;
}

#light-ray-1 {
  left: -8px;
  top: -8px;
  position: absolute;
  width: 43px;
  height: 43px;
  z-index: -1;
  fill: white;
  opacity: 10%;
}

#light-ray-2 {
  left: -50%;
  top: -50%;
  position: absolute;
  width: 55px;
  height: 55px;
  z-index: -1;
  fill: white;
  opacity: 10%;
}

#light-ray-3 {
  left: -18px;
  top: -18px;
  position: absolute;
  width: 60px;
  height: 60px;
  z-index: -1;
  fill: white;
  opacity: 10%;
}

.cloud-light {
  position: absolute;
  fill: #eee;
  animation-name: cloud-move;
  animation-duration: 6s;
  animation-iteration-count: infinite;
}

.cloud-dark {
  position: absolute;
  fill: #ccc;
  animation-name: cloud-move;
  animation-duration: 6s;
  animation-iteration-count: infinite;
  animation-delay: 1s;
}

#cloud-1 {
  left: 30px;
  top: 15px;
  width: 40px;
}

#cloud-2 {
  left: 44px;
  top: 10px;
  width: 20px;
}

#cloud-3 {
  left: 18px;
  top: 24px;
  width: 30px;
}

#cloud-4 {
  left: 36px;
  top: 18px;
  width: 40px;
}

#cloud-5 {
  left: 48px;
  top: 14px;
  width: 20px;
}

#cloud-6 {
  left: 22px;
  top: 26px;
  width: 30px;
}

@keyframes cloud-move {
  0% {
    transform: translateX(0px);
  }

  40% {
    transform: translateX(4px);
  }

  80% {
    transform: translateX(-4px);
  }

  100% {
    transform: translateX(0px);
  }
}

.stars {
  transform: translateY(-32px);
  opacity: 0;
  transition: 0.4s;
}

.star {
  fill: white;
  position: absolute;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  animation-name: star-twinkle;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

#input:checked + .slider .stars {
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
  opacity: 1;
}

#star-1 {
  width: 20px;
  top: 2px;
  left: 3px;
  animation-delay: 0.3s;
}

#star-2 {
  width: 6px;
  top: 16px;
  left: 3px;
}

#star-3 {
  width: 12px;
  top: 20px;
  left: 10px;
  animation-delay: 0.6s;
}

#star-4 {
  width: 18px;
  top: 0px;
  left: 18px;
  animation-delay: 1.3s;
}

@keyframes star-twinkle {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.2);
  }

  80% {
    transform: scale(0.8);
  }

  100% {
    transform: scale(1);
  }
}

.insurance-section {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
}

.insurance-container {
  margin: 10px 0;
}

.insurance-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  margin: 5px 0;
  border-radius: 4px;
}

.insurance-item.employee {
  background-color: rgba(255, 255, 0, 0.2); /* زرد */
  border-right: 4px solid #ffeb3b;
}

.insurance-item.unemployment {
  background-color: rgba(0, 0, 255, 0.1); /* آبی */
  border-right: 4px solid #2196f3;
}

.insurance-item.employer {
  background-color: rgba(255, 165, 0, 0.2); /* نارنجی */
  border-right: 4px solid #ff9800;
}

.insurance-item.total {
  background-color: rgba(0, 128, 0, 0.2); /* سبز */
  border-right: 4px solid #4caf50;
  font-weight: bold;
}

#insuranceTextarea {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
  resize: vertical;
  background-color: #f5f5f5;
}
.tax-box {
  border: 2px solid #ff0000; /* حاشیه قرمز */
  border-radius: 5px; /* گوشه‌های گرد */
  padding: 8px 12px;
  margin: 5px 0;
  background-color: #ffeeee; /* پس‌زمینه قرمز روشن */
  color: #d32f2f; /* رنگ متن تیره‌تر */
  font-weight: bold;
  display: inline-block;
}

/* استایل کلی مودال و تب‌ها */
.pdf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.modal-content {
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  overflow: hidden;
}

.modal-content h2 {
  margin: 0;
  padding: 20px;
  background: #4a6fa5;
  color: white;
  text-align: center;
  font-size: 1.3rem;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  font-weight: 600;
  color: #555;
  transition: all 0.3s;
}

.tab-btn.active {
  background: #fff;
  color: #4a6fa5;
  border-bottom: 3px solid #4a6fa5;
}

.tab-content {
  padding: 20px;
  display: none;
}

.tab-content.active {
  display: block;
}

/* استایل بخش ایمیل */
#emailTab label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #444;
}

#emailInput {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

#emailMessage {
  width: 100%;
  height: 100px;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  resize: vertical;
  font-size: 14px;
}

/* استایل بخش آپلود لوگو */
#printTab label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #444;
}

.file-upload-container {
  position: relative;
  margin-bottom: 20px;
}

.file-upload-label {
  display: block;
  padding: 40px 20px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.file-upload-label:hover {
  border-color: #4a6fa5;
  background: #f8faff;
}

.file-upload-label i {
  font-size: 40px;
  color: #4a6fa5;
  margin-bottom: 10px;
  display: block;
}

.file-upload-label span {
  display: block;
  font-size: 14px;
  color: #666;
}

#logoInput {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.preview-container {
  margin-top: 15px;
  text-align: center;
  display: none;
}

.preview-image {
  max-width: 100%;
  max-height: 150px;
  border-radius: 5px;
  border: 1px solid #eee;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.remove-image {
  display: inline-block;
  margin-top: 10px;
  color: #e74c3c;
  cursor: pointer;
  font-size: 13px;
}

/* دکمه‌ها */
#sendEmailBtn, #generatePdfBtn {
  width: 100%;
  padding: 12px;
  background: #4a6fa5;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

#sendEmailBtn:hover, #generatePdfBtn:hover {
  background: #3a5a8f;
}

.close-btn {
  width: 100%;
  padding: 10px;
  background: #f5f5f5;
  color: #555;
  border: none;
  border-top: 1px solid #ddd;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.close-btn:hover {
  background: #eee;
}

/* اسپینر */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
}

.spinner-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.spinner-content p {
  margin-top: 15px;
  color: #444;
}

.reset-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #ff5e5e, #f44336);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Tahoma', sans-serif;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  margin: 10px;
}

.reset-btn:hover {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.reset-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

.reset-icon {
  animation: spin 1.5s linear infinite;
  transition: transform 0.3s;
}

.reset-btn:hover .reset-icon {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}