/* =========================================
       استایل هماهنگ با تم اصلی (Teal Dark Theme)
       ========================================= */
    
  
    :root {
        --primary-color: #14b8a6;       /* فیروزه‌ای اصلی */
        --primary-glow: rgba(20, 184, 166, 0.4);
        --secondary-color: #2dd4bf;     /* فیروزه‌ای روشن‌تر */
        --bg-color: #022c2b;            /* پس‌زمینه اصلی تیره */
        --card-bg: rgba(4, 47, 46, 0.85); /* پس‌زمینه کارت شیشه‌ای */
        --text-color: #ccfbf1;          /* متن اصلی روشن */
        --text-muted: #99f6e4;          /* متن فرعی */
        --border-color: #115e59;        /* حاشیه */
        --border-radius: 16px;
    }

    * {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        box-sizing: border-box;
    }

    body {
        background-color: var(--bg-color);
        /* افکت پس‌زمینه محو */
        background-image: radial-gradient(circle at 50% 50%, rgba(20, 184, 166, 0.05) 0%, transparent 70%);
        
        direction: rtl;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        transition: direction 0.3s;
        color: var(--text-color);
    }

    .container {
        background-color: var(--card-bg);
        backdrop-filter: blur(12px);
        padding: 40px;
        border-radius: var(--border-radius);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
        border: 1px solid var(--border-color);
        
        width: 100%;
        max-width: 550px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        position: relative;
    }

    .container:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 50px rgba(20, 184, 166, 0.15);
        border-color: var(--primary-color);
    }

    /* دکمه تغییر زبان */
    .lang-switch {
      
        top: 15px;
        left: 15px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        padding: 6px 14px;
        border-radius: 20px;
        cursor: pointer;
        font-size: 0.85rem;
        z-index: 10;
        transition: all 0.3s;
    }
    
    html[dir="rtl"] .lang-switch { left: 15px; right: auto; }
    html[dir="ltr"] .lang-switch { right: 15px; left: auto; }

    .lang-switch:hover {
        background-color: var(--primary-color);
        color: #022c2b;
        border-color: var(--primary-color);
        box-shadow: 0 0 10px var(--primary-glow);
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 30px;
        color: var(--secondary-color);
        text-align: center;
        margin-top: 10px;
        font-weight: 800;
        text-shadow: 0 0 15px var(--primary-glow);
    }

    label {
        display: block;
        margin-bottom: 8px;
        color: var(--text-muted);
        font-size: 0.95rem;
        text-align: right;
        width: 100%;
    }
    html[dir="ltr"] label { text-align: left; }

    input {
        width: 100%;
        padding: 14px;
        margin-bottom: 25px;
        background-color: rgba(0, 0, 0, 0.2);
        border: 2px solid var(--border-color);
        border-radius: 12px;
        font-size: 1rem;
        color: var(--text-color);
        transition: all 0.3s ease;
        text-align: center;
    }

    input:focus {
        border-color: var(--secondary-color);
        outline: none;
        box-shadow: 0 0 15px var(--primary-glow);
        background-color: rgba(0, 0, 0, 0.3);
    }
    
    input::placeholder {
        color: rgba(153, 246, 228, 0.4);
    }

    button {
        width: 100%;
        padding: 14px;
        /* گرادینت دکمه */
        background: linear-gradient(135deg, var(--primary-color), #0f766e);
        color: #ffffff;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        font-size: 1.1rem;
        font-weight: bold;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
    }

    button:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(20, 184, 166, 0.5);
        filter: brightness(1.1);
    }

    /* بخش نتایج */
    #result {
        margin-top: 25px;
        font-size: 1.3rem;
        font-weight: bold;
        color: var(--secondary-color);
        text-align: center;
        padding: 15px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 12px;
        border: 1px solid var(--primary-color);
        width: 100%;
        display: none;
        animation: fadeIn 0.5s ease;
    }
    #result.show { display: block; }

    /* بخش مراحل و فرمول‌ها */
    .steps-container {
        margin-top: 20px;
        width: 100%;
        text-align: right;
        background: rgba(0, 0, 0, 0.15);
        padding: 20px;
        border-radius: 12px;
        border: 1px dashed var(--border-color);
        display: none;
    }
    html[dir="ltr"] .steps-container { text-align: left; }
    
    .steps-container.show {
        display: block;
        animation: fadeIn 0.5s ease;
    }

    .step-item {
        margin-bottom: 12px;
        font-size: 0.95rem;
        color: var(--text-muted);
        line-height: 1.7;
    }

    .math-formula {
        display: block;
        margin: 15px 0;
        padding: 12px;
        background-color: rgba(20, 184, 166, 0.1);
        border-radius: 8px;
        border-right: 3px solid var(--primary-color);
        overflow-x: auto;
        direction: ltr; /* فرمول‌ها همیشه چپ به راست */
        font-family: 'Times New Roman', Times, serif;
        font-size: 1.2rem;
        color: #fff;
        text-align: center;
    }

    /* SVG Icons */
    .icon {
        width: 1em;
        height: 1em;
        vertical-align: -0.125em;
        fill: currentColor;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    @media (max-width: 550px) {
        .container {
            width: 90%;
            padding: 25px;
        }
        h1 { 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 */
}