/* --- فونت‌ها --- */
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-arabic-500-normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* --- متغیرهای رنگی و استایل مدرن --- */
:root {
  --primary: #112548;
  --primary-hover: #1e3a6e;
  --bg-input: #f8fafc;
  --border-light: #e2e8f0;
  --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --accent: #bae6fd;
}

.rtl { direction: rtl; }

/* --- کانتینر اصلی --- */
.main-container {
  display: flex;
  flex-direction: row;
  margin: 0 auto;
}

.main-content {
  padding: clamp(1rem, 2vw, 2rem);
  margin: clamp(0.5rem, 1.5vw, 1.5rem);
  background-color: #ffffff;
  border-radius: 24px;
  font-size: clamp(0.938rem, 0.842rem + 0.426vw, 1.188rem);
  text-align: center;
  /* مدرن‌سازی سایه کانتینر اصلی */
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--primary);
  width: 100%;
}

h1 {
  font-size: 24px;
  margin-bottom: 25px;
  text-align: center;
}

/* --- باکس اصلی تبدیل واحد (Grid مدرن) --- */
.bmi {
  display: flex;
  flex-direction: column;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: #ffffff;
  border: 2px solid var(--border-light);
  border-radius: 24px;
  box-sizing: border-box;
}

/* چیدمان بخش‌ها در گرید */
#left-input2 { grid-column: 1 / 3; } /* نوع تبدیل تمام‌عرض */
#right-input { grid-column: 1 / 3; } /* مقدار ورودی تمام‌عرض */
#left-input4 { width: 100%; } /* واحد مبدا */
#left-input3 { width: 100%; } /* واحد مقصد */
#right-left {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.arrow {
    margin-top: 54px;
    margin-left: 10px;
    margin-right: 10px;
}
/* --- استایل فیلدها (Input & Select) --- */
input, select {
  font-family: "Baloo Bhaijaan 2", sans-serif;
  font-size: 16px;
  border: 2px solid var(--border-light);
  background-color: var(--bg-input);
  outline: none;
  height: 52px;
  border-radius: 16px;
  width: 100%;
  margin-top: 10px;
  text-align: center;
  color: var(--primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

input:focus, select:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(17, 37, 72, 0.1);
  transform: translateY(-2px);
}

h3 {
  font-size: 16px;
  margin: 0;
  color: #64748b;
  font-weight: normal;
}

/* --- دکمه جابجایی (Swap) --- */
.swap-btn {
  grid-column: 1 / 3;
  width: 42px;
  height: 42px;
  margin: -10px auto;
  background: white;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
  z-index: 2;
  transform: rotate(90deg);
}

.swap-btn:hover {
  border-color: var(--primary);
  transform: rotate(270deg);
  background: var(--bg-input);
}

/* --- دکمه محاسبه (Pop) --- */
.pop {
  grid-column: 1 / 3;
  width: 50%;
  min-width: 200px;
  height: 50px;
  justify-self: center;
  background: linear-gradient(135deg, var(--primary) 0%, #2c4a85 100%);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: inherit;
  margin-top: 15px;
  box-shadow: 0 4px 12px rgba(17, 37, 72, 0.2);
  transition: all 0.3s;
  align-self: center;
}

.pop:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(17, 37, 72, 0.3);
  background: linear-gradient(135deg, #1e3a6e 0%, #3b5d9c 100%);
}

.pop:active { transform: scale(0.98); }

/* --- تنظیمات اعشار --- */
.precision-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #64748b;
  direction: rtl;
}

.precision-select {
  width: auto;
  height: 35px;
  margin: 0;
  padding: 0 10px;
  border-radius: 10px;
}

/* --- بخش نتایج مدرن --- */
.results {
  grid-column: 1 / 3;
  background-color: #f0f9ff;
  border: 2px dashed var(--accent);
  border-radius: 20px;
  padding: 20px;
  margin-top: 25px;
  position: relative;
  transition: all 0.3s ease;
}

.results:hover {
  background-color: #e0f2fe;
  border-color: var(--primary);
}

#final-results {
  opacity: 0;
  font-weight: bold;
  font-size: 1.2rem;
  margin: 10px 0;
  transition: opacity 0.5s ease;
}

#final-results.show { opacity: 1; }

.copy-btn {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 5px;
  cursor: pointer;
  position: absolute;
  left: 15px;
  top: 15px;
  transition: 0.2s;
}

.copy-btn:hover { background: var(--bg-input); transform: scale(1.1); }

/* --- فرمول محاسباتی --- */
.formula-box {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.5);
  padding: 5px 15px;
  border-radius: 12px;
  display: inline-block;
}

/* --- نوتیفیکیشن خطا --- */
.notification {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(-180%);
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
  padding: 12px 25px;
  border-radius: 15px;
  box-shadow: var(--shadow-soft);
  z-index: 1000;
  color: #92400e;
  display: flex;
  flex-direction: column;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: fit-content;
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  text-align: center;
}


.show6 { opacity: 1; transform: translateY(25px) translateX(-50%); }

.notification .progress {
  height: 4px;
  background-color: #f59e0b;
  width: 100%;
  border-radius: 2px;
  position: absolute;
  bottom: 0;
  left: 0;
}

.animate { animation: shrink 5s linear forwards; }

@keyframes shrink {
  from { width: 100%; }
  to { width: 0%; }
}

/* --- بخش توضیحات و FAQ --- */
.description {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 24px;
  margin-top: 25px;
  border: 2px solid var(--border-light);
  text-align: right;
  line-height: 1.8;
}

.description h2 {
  font-size: 1.5rem;
  color: var(--primary);
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.description h3 {
  color: #0056b3;
  margin-top: 25px;
  font-weight: bold;
}

/* --- ریسپانسیو موبایل (زیر 675 پیکسل) --- */
@media (max-width: 675px) {
  .bmi {
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
  }
  
  .pop { width: 100%; }
  
  input, select { max-width: 100%; }

  .notification { width: 85%; }
}


.description h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    color: #333;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}
.description h3 {
    color: #0056b3; /* رنگ آبی متناسب با تم */
    margin-top: 20px;
}
.faq-section strong {
    display: block;
    margin-top: 15px;
    color: #444;
}

.description-title {
    font-size: clamp(1rem, 0.809rem + 0.851vw, 1.5rem);
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 10px;
    display: inline-block;
    border-bottom: 2px solid rgb(241, 245, 249);
}