/* =========================================
       تنظیمات کلی و متغیرهای رنگی (Teal Theme)
       ========================================= */
    :root {
        --bg-dark: #042f2e;       /* پس‌زمینه اصلی صفحه */
        --bg-card: #0f4c4c;       /* پس‌زمینه کارت ابزار */
        --primary: #14b8a6;       /* رنگ اصلی (دکمه‌ها و هدر) */
        --primary-dark: #0f766e;  /* رنگ تیره برای هاور */
        --accent: #2dd4bf;        /* رنگ تاکید (متن‌های مهم) */
        --text-main: #ccfbf1;     /* رنگ متن اصلی */
        --text-muted: #99f6e4;    /* رنگ متن فرعی و لیبل‌ها */
        --border: #115e59;        /* رنگ حاشیه‌ها */
        --radius: 12px;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        
        /* تنظیمات فونت */
        --font-fa: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        --font-en: 'Segoe UI', Arial, sans-serif;
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-family: var(--font-fa);
        background-color: var(--bg-dark);
        margin: 0;
        padding: 20px;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        min-height: 100vh;
        color: var(--text-main);
        transition: all 0.3s ease;
    }

    /* تنظیمات خاص زبان انگلیسی */
    body.lang-en {
        font-family: var(--font-en);
        direction: ltr;
    }

    .container {
        background-color: var(--bg-card);
        width: 100%;
        max-width: 500px;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* =========================================
       هدر (Header)
       ========================================= */
    .header {
        background: linear-gradient(135deg, var(--primary-dark), var(--primary));
        color: #fff;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--border);
    }

    .header h1 {
        margin: 0;
        font-size: 1.3rem;
        font-weight: bold;
    }

    .lang-btn {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: white;
        padding: 6px 12px;
        border-radius: 20px;
        cursor: pointer;
        font-family: inherit;
        font-size: 0.9rem;
        transition: background 0.3s;
        backdrop-filter: blur(4px);
    }

    .lang-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    /* =========================================
       محتوای اصلی (Content)
       ========================================= */
    .content {
        padding: 25px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    label {
        display: block;
        margin-bottom: 6px;
        font-weight: bold;
        color: var(--text-muted);
        font-size: 0.95rem;
    }

    input, select {
        width: 100%;
        padding: 12px;
        background: rgba(4, 47, 46, 0.5); /* پس‌زمینه نیمه‌شفاف */
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 1rem;
        box-sizing: border-box;
        font-family: inherit;
        color: var(--text-main);
        transition: all 0.3s ease;
    }

    input:focus, select:focus {
        border-color: var(--accent);
        outline: none;
        box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
        background: rgba(4, 47, 46, 0.8);
    }

    button.calc-btn {
        width: 100%;
        padding: 12px;
        background: linear-gradient(135deg, var(--primary-dark), var(--primary));
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1.1rem;
        font-weight: bold;
        cursor: pointer;
        margin-top: 15px;
        font-family: inherit;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
    }

    button.calc-btn:hover {
        background: linear-gradient(135deg, var(--primary), var(--accent));
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
    }

    /* =========================================
       نتایج (Results)
       ========================================= */
    .result-card {
        margin-top: 25px;
        background: rgba(20, 184, 166, 0.1); /* پس‌زمینه روشن‌تر برای نتیجه */
        border: 1px solid var(--accent);
        border-radius: 8px;
        padding: 15px;
        text-align: center;
        display: none;
        backdrop-filter: blur(5px);
    }

    .result-value {
        font-size: 1.4rem;
        font-weight: bold;
        color: var(--accent);
        margin: 5px 0;
        text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
    }

    /* =========================================
       مراحل (Steps)
       ========================================= */
    .steps-container {
        margin-top: 25px;
        background-color: rgba(0, 0, 0, 0.2);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 20px;
        display: none;
    }

    .steps-title {
        font-weight: bold;
        color: var(--accent);
        border-bottom: 2px solid var(--primary);
        padding-bottom: 8px;
        margin-bottom: 15px;
        font-size: 1.1rem;
    }

    .formula-box {
        background-color: rgba(4, 47, 46, 0.6);
        padding: 15px;
        border-radius: 6px;
        text-align: center;
        margin-bottom: 15px;
        border: 1px solid var(--border);
        overflow-x: auto;
    }

    .calc-step {
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px dashed var(--border);
        font-size: 0.95rem;
        line-height: 1.6;
        color: var(--text-muted);
    }

    .calc-step:last-child {
        border-bottom: none;
    }

    /* =========================================
       فرمول‌های ریاضی (MathML)
       ========================================= */
    math {
        font-size: 1.2rem;
        direction: ltr;
        color: var(--text-main);
    }

    mi { font-style: italic; }
    mtext { font-style: normal; font-size: 0.9em; }

    /* =========================================
       واکنش‌گرایی (Responsive)
       ========================================= */
    @media (max-width: 480px) {
        .container {
            border-radius: 0;
            border: none;
        }
    }
    /* ==========================================
// استایل اسکرول‌بار مدرن (Modern Scrollbar)
// ==========================================*/

/* برای مرورگرهای WebKit (Chrome, Safari, Edge, Opera) */
::-webkit-scrollbar {
    width: 8px;  /* عرض اسکرول‌بار عمودی */
    height: 8px; /* ارتفاع اسکرول‌بار افقی */
}

/* پس‌زمینه نوار اسکرول */
::-webkit-scrollbar-track {
    background: #0f172a; /* رنگ تیره برای پس‌زمینه */
    border-radius: 4px;
}

/* دکمه متحرک اسکرول (Thumb) */
::-webkit-scrollbar-thumb {
    background: #2dd4bf; /* رنگ اصلی Teal */
    border-radius: 4px;
    border: 2px solid #0f172a; /* حاشیه برای ایجاد فاصله زیبا */
}

/* حالت هاور (وقتی موس روی آن قرار می‌گیرد) */
::-webkit-scrollbar-thumb:hover {
    background: #14b8a6; /* رنگ کمی تیره‌تر برای هاور */
}

/* ==========================================
// اسکرول نرم (Smooth Scrolling)
// ==========================================*/

html {
    scroll-behavior: smooth;
}

/* ==========================================
// مخفی کردن اسکرول‌بار در موبایل اما حفظ قابلیت اسکرول
// (اختیاری - برای ظاهر تمیزتر در اپلیکیشن‌های وب)
// ==========================================*/

/* برای کلاس‌های خاص مثل نقشه یا سایدبار */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* برای فایرفاکس */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}