﻿/* =========================================
   1. تنظیمات کلی و فیکس اسکرول (Global Fixes)
   ========================================= */
body, html {
    overflow-x: hidden !important;
    width: 100%;
    margin: 0;
    padding: 0;
    /* اعمال فونت روی کل بدنه */
    font-family: 'Vazirmatn', sans-serif !important;
}

/* اعمال فونت روی تمام اجزا حتی اگر استایل داخلی داشته باشند */
* {
    font-family: 'Vazirmatn', sans-serif !important;
}

.mud-main-content {
    overflow-x: hidden !important;
    max-width: 100vw;
}

/* =========================================
   2. تعریف فونت وزیر (Fonts)
   ========================================= */
@font-face {
    font-family: 'Vazirmatn';
    /* مسیر فونت را چک کنید که درست باشد */
    src: url('../fonts/Vazirmatn.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* =========================================
   3. استایل‌های اختصاصی ماد-بلیزر (MudBlazor Overrides)
   ========================================= */

/* --- استایل دیالوگ‌ها (گوشه‌های گرد و فونت) --- */
.mud-dialog {
    border-radius: 20px !important; /* گوشه‌های گرد */
    overflow: visible !important; /* برای دیده شدن سایه و لیبل‌ها */
}

/* --- اصلاح لیبل‌های شناور برای راست‌چین (RTL) --- */
.mud-input-label-outlined {
    right: 12px !important;
    left: unset !important;
    transform-origin: top right !important;
    background-color: white !important; /* جلوگیری از خط خوردن متن */
    padding: 0 6px !important;
    font-weight: bold;
    color: #d81b60 !important; /* صورتی تیره */
    z-index: 5;
}

/* --- رنگ بوردر فیلدها --- */
.mud-input-outlined-border {
    color: #e0e0e0 !important;
    border-radius: 12px !important; /* کمی گردتر کردن کادر ورودی */
}

/* وقتی روی فیلد کلیک می‌شود (Focus) */
.mud-input-control.mud-input-input-control.mud-input-focused .mud-input-outlined-border {
    color: #ec407a !important; /* صورتی روشن */
    border-width: 2px !important;
}

/* --- اصلاح جهت آیکون‌ها و متن (بسیار مهم برای RTL) --- */
.mud-input-adornment-start {
    margin-left: 10px !important;
    margin-right: -8px !important;
}

.mud-input-slot {
    text-align: right !important;
    direction: rtl !important;
}

/* --- گرادینت هدر دیالوگ‌ها (کلاس اختصاصی) --- */
.pink-header {
    background: linear-gradient(135deg, #ec407a 0%, #ad1457 100%) !important;
    padding: 16px 24px !important; /* فاصله داخلی هدر */
}

/* --- استایل جدول‌ها برای موبایل --- */
.mud-table-container {
    border-radius: 15px !important;
}

/* =========================================
   4. استایل لودینگ (Loading Spinner)
   ========================================= */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #F9F9F9;
    z-index: 9999;
}

.chic-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

    .chic-spinner::before,
    .chic-spinner::after {
        content: '';
        position: absolute;
        border: 4px solid #D81B60;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        animation: chic-pulse 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
    }

    .chic-spinner::after {
        animation-delay: 1s;
    }

@keyframes chic-pulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.loading-text {
    margin-top: 30px;
    color: #D81B60;
    font-weight: 600;
    font-size: 1.1rem;
}

/* =========================================
   5. اصلاح نهایی و حرفه‌ای پاگینیشن (Pagination Fix)
   ========================================= */

/* کادر اصلی تولبار */
.mud-table-pagination-toolbar {
    direction: rtl !important; /* جهت کل نوار راست‌چین */
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important; /* فاصله انداختن بین چپ و راست */
    padding: 0 16px !important;
    height: 60px !important;
    border-top: 1px solid #eee;
    background-color: white;
}

/* بخش سمت راست: متن "تعداد در صفحه" و دراپ‌داون */
.mud-table-pagination-caption {
    font-family: 'Vazirmatn', sans-serif !important;
    font-weight: bold;
    color: #880e4f !important; /* رنگ شرابی/صورتی تیره */
    order: 1; /* اولویت اول نمایش (راست) */
}

.mud-table-pagination-select {
    order: 2; /* اولویت دوم نمایش (کنار متن) */
    margin-left: auto !important; /* هل دادن بقیه به چپ */
}

.mud-table-pagination-spacer {
    display: none !important;
}

/* بخش سمت چپ: متن آمار "1-10 از 50" */
.mud-table-pagination-display {
    direction: ltr !important; \
    font-family: 'Vazirmatn', sans-serif !important;
    font-weight: 700;
    color: #424242;
    order: 3; /* نمایش در سمت چپ */
    margin-right: auto !important; /* فاصله گرفتن از راست */
    margin-left: 10px !important;
}

/* دکمه‌های چپ و راست */
.mud-table-pagination-actions {
    direction: ltr !important; /* فلش‌ها در جهت درست */
    order: 4; /* آخرین المان (چپ‌ترین) */
    display: flex;
    gap: 5px;
}

    .mud-table-pagination-actions button {
        color: #d81b60 !important;
    }