/* =========================================================
   ابزارهای رایگان یارنیکو - استایل مشترک
   ========================================================= */

/* ===== کارت ابزار در صفحه هاب ===== */
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: #fff;
  border: 1px solid rgb(23 52 60 / 10%);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.tool-card:hover {
  border-color: rgb(185 104 53 / 30%);
  box-shadow: 0 15px 40px rgb(12 31 38 / 6%);
  transform: translateY(-4px);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.tool-card-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: rgb(185 104 53 / 10%);
  color: #b96835;
  font-size: 1.5rem;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.tool-card:hover .tool-card-icon {
  background: #b96835;
  color: #fff;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  background: #d58e55;
  color: #10272e;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.tool-card-title {
  color: #10272e;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.6;
}

.tool-card-desc {
  margin-top: 0.75rem;
  color: #607177;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.9;
}

.tool-card-features {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(23 52 60 / 8%);
  flex: 1;
  list-style: none;
  padding-right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tool-card-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #40575e;
  font-size: 0.78rem;
  font-weight: 600;
}

.tool-card-features li i {
  color: #b96835;
  font-size: 0.7rem;
}

.tool-card-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(23 52 60 / 8%);
}

.tool-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #b96835;
  font-size: 0.85rem;
  font-weight: 800;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-cta {
  transform: translateX(-4px);
}

.tool-card-cta i {
  font-size: 0.75rem;
}

/* کارت پیشنهاد */
.tool-card-suggestion {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: linear-gradient(135deg, #f8f6f0 0%, #ece6d9 100%);
  border: 1px dashed rgb(185 104 53 / 40%);
}

/* ===== کارت‌های ویژگی ===== */
.feature-card {
  text-align: center;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: rgb(185 104 53 / 10%);
  color: #b96835;
  font-size: 1.5rem;
  border-radius: 50%;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: #b96835;
  color: #fff;
}

.feature-title {
  color: #10272e;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.feature-desc {
  color: #607177;
  font-size: 0.82rem;
  line-height: 1.9;
}

/* ==============================================
   استایل‌های محاسبه‌گر (Calculator)
   ============================================== */

/* ===== container کلی محاسبه‌گر ===== */
.calculator-wrapper {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .calculator-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* ===== پنل ورودی ===== */
.calc-input-panel {
  padding: 2rem;
  background: #fff;
  border: 1px solid rgb(23 52 60 / 10%);
}

@media (min-width: 640px) {
  .calc-input-panel {
    padding: 2.5rem;
  }
}

.calc-panel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  color: #10272e;
  font-size: 1.15rem;
  font-weight: 900;
}

.calc-panel-title i {
  color: #b96835;
}

.calc-panel-subtitle {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgb(23 52 60 / 8%);
  color: #748288;
  font-size: 0.85rem;
  line-height: 1.9;
}

/* ===== گروه ورودی ===== */
.input-group {
  margin-bottom: 1.5rem;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  color: #17343c;
  font-size: 0.85rem;
  font-weight: 700;
}

.input-label-required::after {
  content: "*";
  color: #b96835;
  margin-right: 0.15rem;
}

.input-help {
  cursor: help;
  color: #9da8ab;
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

.input-help:hover {
  color: #b96835;
}

/* ===== ورودی متنی/عددی ===== */
.calc-input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: #f8f6f0;
  border: 1px solid transparent;
  color: #10272e;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.calc-input:focus {
  background: #fff;
  border-color: #b96835;
}

.calc-input::placeholder {
  color: #a8b0b3;
  font-weight: 500;
}

/* حذف فلش‌های input number */
.calc-input[type="number"] {
  -moz-appearance: textfield;
}

.calc-input[type="number"]::-webkit-outer-spin-button,
.calc-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ورودی با پسوند (تومان/ریال) */
.input-with-suffix {
  position: relative;
}

.input-with-suffix .calc-input {
  padding-left: 5rem;
}

.input-suffix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9da8ab;
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: none;
}

/* هینت زیر ورودی */
.input-hint {
  margin-top: 0.5rem;
  color: #9da8ab;
  font-size: 0.72rem;
  font-weight: 500;
}

/* ===== سلکت ===== */
.calc-select {
  width: 100%;
  padding: 0.9rem 1rem;
  background: #f8f6f0;
  border: 1px solid transparent;
  color: #10272e;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  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='%23607177' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  background-size: 1rem;
  padding-left: 2.5rem;
}

.calc-select:focus {
  background-color: #fff;
  border-color: #b96835;
}

/* ===== رادیو گروه ===== */
.radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.calc-radio {
  cursor: pointer;
}

.calc-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calc-radio-box {
  padding: 0.85rem 1rem;
  background: #f8f6f0;
  border: 2px solid transparent;
  color: #40575e;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.calc-radio:hover .calc-radio-box {
  border-color: rgb(185 104 53 / 25%);
}

.calc-radio input:checked ~ .calc-radio-box {
  background: #b96835;
  border-color: #b96835;
  color: #fff;
}

/* ===== چک‌باکس ===== */
.calc-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8f6f0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.calc-check:hover {
  background: #ece6d9;
}

.calc-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calc-check-box {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid rgb(23 52 60 / 25%);
  background: #fff;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.calc-check-box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.calc-check input:checked ~ .calc-check-box {
  background: #b96835;
  border-color: #b96835;
}

.calc-check input:checked ~ .calc-check-box::after {
  opacity: 1;
}

.calc-check-label {
  color: #17343c;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ===== دکمه‌های اکشن ===== */
.calc-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(23 52 60 / 8%);
}

.calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.calc-btn.primary {
  background: #17343c;
  color: #fff;
  flex: 1;
}

.calc-btn.primary:hover {
  background: #b96835;
}

.calc-btn.secondary {
  background: transparent;
  border-color: rgb(23 52 60 / 20%);
  color: #17343c;
}

.calc-btn.secondary:hover {
  border-color: #b96835;
  color: #b96835;
}

/* ===== پنل نتیجه ===== */
.calc-result-panel {
  padding: 2rem;
  background: #10272e;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .calc-result-panel {
    padding: 2.5rem;
  }
}

.calc-result-panel::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgb(226 165 111 / 15%) 0%, transparent 70%);
  pointer-events: none;
}

.result-header {
  position: relative;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.result-label {
  display: block;
  color: #e2a56f;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-title {
  margin-top: 0.5rem;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
}

.result-main {
  position: relative;
  margin: 2rem 0;
  text-align: center;
}

.result-amount {
  display: block;
  color: #e2a56f;
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.result-amount.updating {
  opacity: 0.5;
  transform: scale(0.95);
}

.result-currency {
  display: block;
  margin-top: 0.5rem;
  color: rgb(255 255 255 / 55%);
  font-size: 0.8rem;
  font-weight: 600;
}

.result-breakdown {
  position: relative;
  padding: 1.5rem 0;
  border-top: 1px solid rgb(255 255 255 / 10%);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.8rem;
}

.breakdown-row .breakdown-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgb(255 255 255 / 60%);
}

.breakdown-row .breakdown-label i {
  color: #e2a56f;
  font-size: 0.7rem;
}

.breakdown-row .breakdown-value {
  color: #fff;
  font-weight: 700;
  font-family: "Vazirmatn", monospace;
}

.breakdown-row.deduction .breakdown-value {
  color: #ff9c8a;
}

.breakdown-row.addition .breakdown-value {
  color: #86efac;
}

.breakdown-row.total {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px dashed rgb(255 255 255 / 20%);
  font-size: 0.9rem;
  font-weight: 800;
}

.breakdown-row.total .breakdown-label {
  color: #fff;
  font-weight: 800;
}

.breakdown-row.total .breakdown-value {
  color: #e2a56f;
  font-size: 1.1rem;
}

.result-footer {
  position: relative;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.result-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 12%);
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease;
}

.result-btn:hover {
  background: rgb(226 165 111 / 15%);
  border-color: rgb(226 165 111 / 40%);
}

.result-btn i {
  font-size: 0.75rem;
}

.result-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem;
  background: #d58e55;
  color: #10272e;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 0.25s ease;
}

.result-cta:hover {
  background: #e6aa73;
}

.result-note {
  margin-top: 1rem;
  color: rgb(255 255 255 / 40%);
  font-size: 0.68rem;
  line-height: 1.7;
  text-align: center;
}

/* ===== وضعیت خالی نتیجه ===== */
.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  min-height: 300px;
}

.result-empty i {
  font-size: 3rem;
  color: rgb(226 165 111 / 40%);
  margin-bottom: 1.5rem;
}

.result-empty h4 {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.result-empty p {
  color: rgb(255 255 255 / 50%);
  font-size: 0.85rem;
  line-height: 1.8;
  max-width: 300px;
}

/* ===== توضیحات و نکات ===== */
.tool-info-section {
  padding: 2rem;
  background: #fff;
  border: 1px solid rgb(23 52 60 / 10%);
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .tool-info-section {
    padding: 2.5rem;
  }
}

.info-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgb(23 52 60 / 10%);
  overflow-x: auto;
}

.info-tab {
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: none;
  color: #748288;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1rem;
  transition:
    color 0.25s ease,
    border-color 0.25s ease;
}

.info-tab:hover {
  color: #b96835;
}

.info-tab.active {
  color: #b96835;
  border-bottom-color: #b96835;
}

.info-panel {
  display: none;
  color: #40575e;
  font-size: 0.9rem;
  line-height: 2;
}

.info-panel.active {
  display: block;
  animation: infoFadeIn 0.3s ease-out;
}

@keyframes infoFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-panel h3 {
  color: #10272e;
  font-size: 1rem;
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.info-panel h3:first-child {
  margin-top: 0;
}

.info-panel p {
  margin-bottom: 1rem;
}

.info-panel ul {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
  list-style: none;
}

.info-panel ul li {
  position: relative;
  padding-right: 1.25rem;
  margin-bottom: 0.5rem;
}

.info-panel ul li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  background: #b96835;
  border-radius: 50%;
}

.info-panel strong {
  color: #10272e;
  font-weight: 800;
}

/* ===== جدول در ابزارها ===== */
.tool-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.82rem;
  border: 1px solid rgb(23 52 60 / 10%);
}

.tool-table th {
  padding: 0.75rem 0.85rem;
  background: #f8f6f0;
  color: #10272e;
  font-weight: 800;
  text-align: right;
  border-bottom: 2px solid rgb(23 52 60 / 10%);
}

.tool-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgb(23 52 60 / 6%);
  color: #40575e;
}

.tool-table tr:last-child td {
  border-bottom: none;
}

.tool-table tr:hover td {
  background: #f8f6f0;
}

/* ===== دکمه بازگشت به بالا ===== */
#scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 640px) {
  .result-amount {
    font-size: 2.15rem;
  }

  .radio-group {
    grid-template-columns: 1fr 1fr;
  }

  .calc-actions {
    flex-direction: column;
  }

  .calc-btn {
    width: 100%;
  }
}

/* ===== کاهش حرکت ===== */
@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .result-amount,
  .feature-icon {
    transition: none;
    transform: none;
    animation: none;
  }
}