:root {
    --primary: #112548;
    --accent: #3b82f6;
    --bg-input: #f1f5f9;
    --border: #e2e8f0;
    --text-muted: #64748b;
    --gradient-btn: linear-gradient(135deg, #1e3a6e 0%, #112548 100%);
}

@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;
    font-display: swap;
}

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-latin-500-normal.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    background-color: #dae0e2;
    font-family: 'Baloo Bhaijaan 2', arial;
    font-size: 8px;
}

h1 {
    font-size: 24px;
}

.main-container {
    display: flex;
    flex-direction: row;
}

.main-content {
    padding: clamp(-0.125rem, 0.4464285714285714rem + 0.8571428571428572vw, 1.25rem);
    margin: clamp(-0.125rem, -0.0892857142857143rem + 1.4285714285714286vw, 1.25rem);
    background-color: #ffffff;
    border-radius: 20px;
    font-size: clamp(0.938rem, 0.842rem + 0.426vw, 1.188rem);
    text-align: center;
    color: #112548;
    width: 100%;
}

.description {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 16px;
    text-align: right;
    font-size: clamp(0.875rem, 0.731rem + 0.638vw, 1.25rem);
    border: 2px solid var(--border);
}

.description-title {
    font-size: clamp(1rem, 0.809rem + 0.851vw, 1.5rem);
    color: #112548;
}

h3 {
    font-size: 18px;
    align-self: center;
}

.bmi {
    display: grid;
    margin: 20px 0;
    border-radius: 20px;
    padding: clamp(0.625rem, 0.208rem + 1.667vw, 1.25rem);
    width: 100%;
    grid-template-columns: 1fr 1fr; /* دو ستونه */
    gap: 20px;
    background: #ffffff;
    border: 2px solid var(--border);
}

.input-group {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: bold;
    padding-right: 5px;
}

.modern-input {
    width: 100%;
    height: 46px;
    border: 2px solid var(--border);
    background-color: var(--bg-input);
    border-radius: 16px;
    font-family: 'Baloo Bhaijaan 2', sans-serif;
    font-size: 16px;
    color: var(--primary);
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box; /* جلوگیری از بیرون زدگی */
}

.modern-input:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(17, 37, 72, 0.1);
    transform: translateY(-2px);
}

/* گوشه‌های گرد برای ورودی‌های خاص */
#weight {
    border-top-left-radius: 20px;
}

#bmi {
    border-top-right-radius: 20px;
}

/* دکمه محاسبه */
.pop {
    grid-column: 1 / 3; /* کل عرض را بگیرد */
    width: 50%;
    margin: 25px auto 10px auto;
    height: 46px;
    border: none;
    border-radius: 20px;
    background: var(--gradient-btn);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(17, 37, 72, 0.3);
    transition: all 0.3s ease;
    font-family: 'Baloo Bhaijaan 2', sans-serif;
}

.pop:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(17, 37, 72, 0.4);
}

.pop:active {
    transform: scale(0.98);
}

.results {
    grid-column: 1 / 3;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    text-align: center;
    display: none; /* در ابتدا مخفی */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.results.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.bmi-number {
    display: block;
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1.2;
    color: var(--primary);
}

.bmi-status-text {
    font-size: 1.4rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.ideal-weight-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* نوار گرافیکی (Gauge) */
.bmi-scale {
    position: relative;
    margin-top: 20px;
    padding: 0 10px;
}

.scale-bar {
    height: 14px;
    background: linear-gradient(to left, #ef4444, #f59e0b, #10b981, #3b82f6);
    border-radius: 10px;
    width: 100%;
    position: relative;
}

.marker {
    position: absolute;
    top: -6px;
    width: 16px;
    height: 26px;
    background-color: #fff;
    border: 3px solid var(--primary);
    border-radius: 8px;
    transform: translateX(50%);
    transition: left 1s cubic-bezier(0.34, 1.56, 0.64, 1); /* انیمیشن فنری */
    left: 0%;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
}

table {
    border-collapse: collapse;
    width: 100%;
    direction: rtl;
}

th, td {
    padding: 8px 12px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

.notification {
    z-index: 1000;
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(-180%);
    overflow: hidden;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: #ffff9a;
    width: fit-content;
    padding: 10px;
    border-radius: 10px;
    color: #999;
    box-shadow: 0 0 18px #ffff9a;
    margin: 0px;
    opacity: 0;
    transition: all 1s ease-in-out;
    font-size: clamp(0.938rem, 0.842rem + 0.426vw, 1.188rem);
    text-align: center;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-180%) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(20%) translateX(-50%);
    }
}

.close {
    padding: 1rem;
    display: flex;
    cursor: pointer;
}

.show {
    transition: all 1s ease-out;
    display: flex;
    opacity: 1;
    transform: translateY(20%) translateX(-50%);
    flex-direction: column;
}

.show2 {
    transition: all 1s ease-out;
    display: flex;
    opacity: 0;
    transform: translateY(-180%) translateX(-50%);
    flex-direction: column;
}

.notification .progress {
    height: 4px;
    background-color: #ffc400;
    width: 100%;
    border-radius: 3px;
}

@keyframes shrink {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.animate {
    animation: shrink 5s linear forwards;
}

.rtl {
    direction: rtl;
}

.ezafi {
    display: flex;
    flex-direction: row;
}

@media (max-width: 675px) {
    .bmi {
        display: flex; /* از کد اول */
        flex-direction: column;
        grid-template-columns: 1fr; /* تک ستونه (از کد دوم) */
        gap: 15px;
        padding: 20px;
    }

    button.pop {
        align-self: center;
        width: 90%; /* از کد دوم برای موبایل */
    }

    .notification {
        width: 90%;
    }

    .input-group {
        text-align: center;
        margin-bottom: 6px;
    }
}

p {
    margin-bottom: 15px;
}

#fo {
    font-family: "Baloo Bhaijaan 2";
    direction: rtl;
    text-align: right;
}