@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-arabic-500-normal.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-latin-500-normal.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
    --primary: #112548;
    --primary-hover: #1e3a6e;
    --bg-input: #f8fafc;
    --border-light: #e2e8f0;
    --accent: #2c4a85;
}

body {
    background-color: #f1f5f9;
    margin: 0;
    font-family: "Baloo Bhaijaan 2", sans-serif;
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--primary);
}

.main-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.main-content {
    padding: clamp(1rem, 2vw, 2rem);
    margin: clamp(0.5rem, 1.5vw, 1.5rem);
    background-color: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    color: var(--primary);
    width: 100%;
    max-width: 1200px;
    text-align: center;
    direction: rtl;
}

/* --- استایل تب‌ها (جدید) --- */
.qr-type-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    background: transparent;
    border: 2px solid var(--border-light);
    color: #64748b;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-family: "Baloo Bhaijaan 2", sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto; /* بازنویسی استایل دکمه اصلی */
    height: auto;
    margin-top: 0;
    box-shadow: none;
    min-width: auto;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f9ff;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(17, 37, 72, 0.3);
}

/* --- کارت اصلی (BMI / Input Area) --- */
.bmi {
  display: grid;
  grid-template-columns: 1.5fr 1fr; /* چپ ورودی، راست نتیجه */
  gap: 30px;
  margin: 20px 0;
  border-radius: 24px;
  background: #ffffff;
  border: 2px solid var(--border-light);
  padding: 30px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 800px) {
    .bmi {
        grid-template-columns: 1fr;
    }
}

/* --- ورودی‌ها --- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.hidden {
    display: none;
}

input, select, textarea {
  font-family: "Baloo Bhaijaan 2", sans-serif;
  font-size: 16px;
  border: 2px solid var(--border-light);
  background-color: var(--bg-input);
  outline: none;
  border-radius: 16px;
  width: 100%;
  padding: 12px 15px;
  box-sizing: border-box;
  color: var(--primary);
  transition: all 0.3s ease;
  text-align: right; /* برای فارسی بهتر است */
  margin-top: 5px; /* تنظیم فاصله */
  bottom: 0;
  height: auto;
  min-height: 50px;
}

textarea {
    resize: vertical;
    min-height: 100px;
    border-top-right-radius: 16px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(17, 37, 72, 0.1);
}

label {
    text-align: right;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: -10px;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* --- دکمه‌ها --- */
.pop {
    width: 90%;
    background: linear-gradient(135deg, var(--primary) 0%, #2c4a85 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 20px;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 50px;
}

.pop:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(17, 37, 72, 0.25);
}

/* --- تنظیمات ظاهری --- */
.design-options {
    margin-top: 20px;
    border-top: 1px dashed var(--border-light);
    padding-top: 10px;
    text-align: right;
}

.hidden-panel {
    display: none;
    background: #f8fafc;
    padding: 15px;
    border-radius: 15px;
    margin-top: 10px;
    animation: fadeIn 0.5s;
}

.design-options h3:hover {
    color: var(--accent);
}

.color-picker-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

input[type="color"] {
    height: 40px;
    padding: 2px;
    cursor: pointer;
    width: 100%;
}

.file-upload-row input {
    background: white;
    padding: 10px;
}

/* --- بخش نتیجه --- */
.result-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f0f9ff;
    border: 2px dashed #bae6fd;
    border-radius: 24px;
    padding: 20px;
    min-height: 300px;
    align-self: center;
    height: fit-content;
}

.qr-container {
    margin-bottom: 20px;
}

/* استایل عکس تولید شده در QR */
.qr-container canvas {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 100%;
}

.download-btn {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-family: "Baloo Bhaijaan 2", sans-serif;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    height: auto;
    margin-top: 0;
}

.download-btn:hover {
    background: var(--primary);
    color: white;
}

.description {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 20px;
  margin-top: 20px;
  text-align: right;
  border: 2px solid var(--border-light);
  font-size: clamp(0.875rem, 0.731rem + 0.638vw, 1rem);
}

.description-title {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: block;
}

.rtl { direction: rtl; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}





#header {
    display: block;
    width: 100%;
}

#sidebar {
    min-height: 500px;
}

.result-section {
    /* ... استایل‌های قبلی ... */
    min-height: 320px; /* ارتفاع ثابتی بدهید تا با ساخت کد، باکس بزرگ نشود */
}

.bmi {
    contain: content; 
}

main {
    contain: content; 
}






