/* =========================================
       تنظیمات کلی و متغیرهای رنگی (Teal Theme)
       ========================================= */
    :root {
        --bg-dark: #042f2e;       /* پس‌زمینه اصلی صفحه */
        --bg-card: #0f4c4c;       /* پس‌زمینه کارت ابزار */
        --bg-input: rgba(4, 47, 46, 0.5); /* پس‌زمینه ورودی‌ها */
        --primary: #14b8a6;       /* رنگ اصلی (دکمه‌ها و هدر) */
        --primary-dark: #0f766e;  /* رنگ تیره برای هاور */
        --accent: #2dd4bf;        /* رنگ تاکید (متن‌های مهم) */
        --text-main: #ccfbf1;     /* رنگ متن اصلی */
        --text-muted: #99f6e4;    /* رنگ متن فرعی */
        --border: #115e59;        /* رنگ حاشیه‌ها */
        --radius: 14px;
        --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
        
        /* تنظیمات فونت */
        --font-fa: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        --font-en: 'Segoe UI', Arial, sans-serif;
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: var(--font-fa);
        text-align: center;
        align-items: center;
        justify-content: center;
    }

    body {
        background-color: var(--bg-dark);
        color: var(--text-main);
        line-height: 1.6;
        padding: 20px;
        min-height: 100vh;
    }

    .container {
        max-width: 900px;
        margin: 0 auto;
        background-color: var(--bg-card);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
        border: 1px solid var(--border);
    }

    /* هدر */
    header {
        background: linear-gradient(135deg, var(--primary-dark), var(--primary));
        color: white;
        padding: 30px;
        text-align: center;
        margin: 20px;
        padding: 20px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
    }

    h1 {
        font-size: 2.2rem;
        margin-bottom: 10px;
        font-weight: 600;
    }

    p {
        background-color: rgba(0, 0, 0, 0.2);
        color: var(--text-muted);
        margin: 14px;
        padding: 14px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
    }

    .subtitle {
        font-size: 1.1rem;
        opacity: 0.9;
        font-weight: 300;
    }

    /* تب‌ها */
    .tabs {
        display: flex;
        background-color: rgba(0, 0, 0, 0.2);
        border: 1px solid var(--border);
        margin: 30px;
        padding: 10px;
        border-radius: var(--radius);
        gap: 14px;
    }

    .tab {
        flex: 1;
        padding: 18px 10px;
        text-align: center;
        cursor: pointer;
        font-size: 1.05rem;
        font-weight: 500;
        transition: all 0.3s ease;
        color: var(--text-muted);
        border-bottom: 3px solid transparent;
    }

    .tab:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: var(--text-main);
    }

    .tab.active {
        background-color: var(--bg-card);
        color: var(--accent);
        border: 2px solid var(--accent);
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
    }

    .tab-content {
        display: none;
        padding: 30px;
    }

    .tab-content.active {
        display: block;
    }

    .converter-box {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    .input-section, .output-section {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 10px;
        padding: 25px;
        border: 1px solid var(--border);
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
        color: var(--text-main);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    h2 i {
        color: var(--accent);
    }

    .input-group {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 15px;
    }

    .input-field {
        flex: 1;
        min-width: 200px;
    }

    label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
        color: var(--text-muted);
    }

    input, select {
        width: 100%;
        padding: 14px;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 1rem;
        transition: all 0.3s;
        color: var(--text-main);
    }

    input:focus, select:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
        background: rgba(4, 47, 46, 0.8);
    }

    .direction-indicator {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: var(--text-muted);
        margin: 10px 0;
    }

    .btn-convert {
        background: linear-gradient(135deg, var(--primary-dark), var(--primary));
        color: white;
        border: none;
        padding: 15px 30px;
        border-radius: 8px;
        font-size: 1.1rem;
        font-weight: 900;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-top: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
    }

    .btn-convert:hover {
        background: linear-gradient(135deg, var(--primary), var(--accent));
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
    }

    .result {
        background-color: rgba(20, 184, 166, 0.1);
        border: 1px solid var(--accent);
        border-radius: 8px;
        padding: 20px;
        margin-top: 20px;
        font-size: 1.2rem;
        text-align: center;
        color: var(--accent);
        font-weight: 600;
        display: none;
        backdrop-filter: blur(5px);
    }

    .result.show {
        display: block;
    }

    .explanation {
        margin: 30px;
        padding: 20px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 10px;
        border: 1px solid var(--border);
    }

    .explanation h3 {
        color: var(--text-main);
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .explanation p {
        color: var(--text-muted);
        line-height: 1.8;
        background: transparent;
        border: none;
        margin: 0;
        padding: 0;
    }

    footer {
        text-align: center;
        padding: 20px;
        color: var(--text-muted);
        font-size: 0.9rem;
        border-top: 1px solid var(--border);
        margin-top: 30px;
    }

    @media (max-width: 768px) {
        .tabs {
            flex-direction: column;
        }
        .input-group {
            flex-direction: column;
        }
        .input-field {
            min-width: 100%;
        }
        h1 {
            font-size: 1.8rem;
        }
    }
    .step-block {
    background: #003333;
    border-right: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.step-title {
    font-weight: bold;
    color: #ffffff;
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.step-desc {
    display: block;
    color: #bebebe;
    font-size: 0.95em;
    margin-bottom: 10px;
    line-height: 1.6;
}

.formula-box {
    background: #031a1d;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
    text-align: center;
    direction: ltr; /* فرمول‌های ریاضی چپ به راست خوانده می‌شوند */
    font-size: 1.1em;
}

/* تنظیمات خاص برای MathML */
math {
    font-family: 'Times New Roman', Times, serif;
}
/* ==========================================
// استایل اسکرول‌بار مدرن (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 */
}