/* =========================================
           تنظیمات کلی و متغیرهای رنگی (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.3);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            
            /* تنظیمات فونت */
            --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);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding: 40px 20px;
            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: 700px;
            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: 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border);
        }

        .header h1 {
            margin: 0;
            font-size: 1.5rem;
            font-weight: bold;
        }

        .lang-btn {
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: #fff;
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.9rem;
            transition: var(--transition);
            backdrop-filter: blur(4px);
        }

        .lang-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }

        /* =========================================
           محتوای اصلی (Content)
           ========================================= */
        .content {
            padding: 30px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: var(--text-muted);
        }

        input, select {
            width: 100%;
            padding: 14px;
            background: rgba(4, 47, 46, 0.5); /* کمی شفاف برای ترکیب با پس‌زمینه */
            border: 1px solid var(--border);
            border-radius: 8px;
            box-sizing: border-box;
            font-family: inherit;
            font-size: 1rem;
            color: var(--text-main);
            transition: var(--transition);
        }

        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: 16px;
            background: linear-gradient(135deg, var(--primary-dark), var(--primary));
            color: #fff;
            border: none;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            margin-top: 10px;
            font-family: inherit;
            transition: var(--transition);
            box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
        }

        button.calc-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
            background: linear-gradient(135deg, var(--primary), var(--accent));
        }

        /* =========================================
           بخش نتایج (Results)
           ========================================= */
        .results-section {
            margin-top: 30px;
            display: none;
            animation: fadeIn 0.5s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .result-card {
            background: rgba(20, 184, 166, 0.1);
            border: 1px solid var(--accent);
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            text-align: center;
            backdrop-filter: blur(5px);
        }

        .result-value {
            font-size: 1.8rem;
            font-weight: bold;
            color: var(--accent);
            margin: 10px 0;
            text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
        }

        /* =========================================
           مراحل و فرمول‌ها (Steps & Formulas)
           ========================================= */
        .steps-container {
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 20px;
        }

        .step-block {
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 1px dashed var(--border);
        }

        .step-block:last-child {
            border-bottom: none;
        }

        .step-title {
            font-weight: bold;
            color: var(--accent);
            margin-bottom: 10px;
            display: block;
            font-size: 1.1rem;
        }

        .formula-box {
            background: rgba(4, 47, 46, 0.6);
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 10px;
            overflow-x: auto;
            text-align: center;
            border: 1px solid var(--border);
        }

        .calc-detail {
            font-size: 0.95rem;
            color: var(--text-muted);
            line-height: 1.7;
        }

        /* استایل فرمول‌های ریاضی */
        math {
            font-size: 1.2rem;
            color: var(--text-main);
        }
        
        mi { font-style: italic; }
        mtext { font-style: normal; font-size: 0.9em; }

        /* =========================================
           واکنش‌گرایی (Responsive)
           ========================================= */
        @media (max-width: 600px) {
            body { padding: 20px 10px; }
            .header h1 { font-size: 1.2rem; }
            .content { padding: 20px; }
            .result-value { font-size: 1.5rem; }
        }
        /* ==========================================
// استایل اسکرول‌بار مدرن (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 */
}