/* --- فونت‌ها --- */
@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;
}

body {
    background-color: #dae0e2;
    font-family: 'Baloo Bhaijaan 2', sans-serif;
    margin: 0;
    color: var(--primary);
    text-align: center;
}

.rtl { direction: rtl; }

/* --- کانتینر اصلی --- */
.main-container {
  display: flex;
  flex-direction: row;
}

.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);
  color: var(--primary);
  box-shadow: var(--shadow-soft);
  font-size: clamp(0.938rem, 0.842rem + 0.426vw, 1.188rem);
  direction: rtl;
}

        h1 {
            font-size: 24px;
            margin-bottom: 25px;
            text-align: center;
        }

        /* --- باکس اصلی گرید --- */
        .bmi {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            margin: 20px 0;
            padding: clamp(1rem, 3vw, 2.5rem);
            background: #ffffff;
            border: 2px solid var(--border-light);
            border-radius: 24px;
            box-sizing: border-box;
            text-align: center;
            width: 100%;
        }

        .full-width {
            grid-column: 1 / -1;
        }

        .input-row {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 15px;
            border-radius: 20px;
            transition: all 0.3s ease;
            width: 100%;
        }

/* --- استایل فیلدها --- */
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: 15px;
            margin: 0;
            color: #64748b;
            font-weight: normal;
        }

.pop {
  width: 40%;
  min-width: 180px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, #2c4a85 100%);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(17, 37, 72, 0.2);
  transition: all 0.3s;
  grid-column: 2/3;
  justify-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%);
}

        /* --- بخش نتایج --- */
        .results {
            grid-column: 1 / -1;
            background-color: #f0f9ff;
            border: 2px dashed var(--accent);
            border-radius: 20px;
            padding: 20px;
            margin-top: 25px;
            position: relative;
            transition: all 0.3s ease;
            width: 100%;
        }

        .result-grid-inner {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 15px;
            margin-top: 10px;
        }

        .res-card {
            background: white;
            padding: 12px;
            border-radius: 12px;
            border: 1px solid var(--border-light);
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .res-card span { font-size: 12px; color: #64748b; margin-bottom: 4px; }
        .res-card strong { font-size: 15px; color: var(--primary); word-break: break-all; }

        .copy-btn {
            background: white;
            border: 1px solid var(--border-light);
            border-radius: 8px;
            padding: 5px 10px;
            cursor: pointer;
            position: absolute;
            left: 10px;
            top: 10px;
            font-size: 12px;
            transition: 0.2s;
        }

        .copy-btn:hover { background: var(--bg-input); }

        .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;
            font-size: clamp(0.875rem, 0.731rem + 0.638vw, 1.25rem);
        }

        .description-title {
            font-size: 1.3rem;
            color: var(--primary);
            margin-bottom: 15px;
            border-bottom: 2px solid #f1f5f9;
            padding-bottom: 5px;
            display: inline-block;
        }

        .notification {
            position: fixed;
            left: 50%;
            top: 20px;
            transform: translateX(-50%) translateY(-150%);
            background-color: #ecfdf5;
            border: 1px solid #10b981;
            padding: 12px 25px;
            border-radius: 15px;
            box-shadow: var(--shadow-soft);
            z-index: 1000;
            color: #065f46;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .show { transform: translateX(-50%) translateY(0); }

        @media (max-width: 450px) {
            .bmi { display: flex; flex-direction: column; }
        }
        
        @media (max-width: 690px) {
            .bmi { grid-template-columns: 1fr 1fr; align-items: center; }
            .pop { grid-row: 4/5; grid-column: 1/3;}
            .input-row:nth-child(4) {grid-column: span 2; }
        }
        
/* Description Section Styling */
.description-container {
    margin-top: 40px;
    padding: 25px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    line-height: 1.8;
    color: #334155;
    direction: rtl;
    text-align: right;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin: 10px 0;
}

.separator {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 40px 0;
}

.faq-section details {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
}

.faq-section p {
    margin-top: 10px;
    padding-right: 15px;
    font-size: 0.95rem;
}

.formula-box {
    background-color: #f0f9ff;
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed #0ea5e9;
    margin: 20px 0;
    overflow-x: auto;
    direction: ltr;
    font-family: inherit;
    color: #0369a1;
}