﻿/* فقط روی موبایل (کوچکتر از 576px) */
/*@media (max-width: 800px) {
    #appModal .modal-dialog, .table-responsive {
        width: 100% !important;
        min-width: 500px;
        max-width: 100% !important;
        margin: 0;*/ /* حذف فاصله کناری */
/*}

    #appModal .modal-content, .table-responsive {
        border-radius: 0;*/ /* بدون گوشه گرد */
/*}

    #appModal .modal-body, .table-responsive {
        overflow-y: auto;*/ /* اسکرول در صورت محتوای زیاد */
/*}
}*/

:root {
    --min-col-width: 260px; /* حداقل عرض هر ستون */
}

.Loading-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.LoadingDiv {
    margin-top: 30px;
    background-image: url('/css/img/loading.gif');
    background-size: cover;
    padding: 0;
    border-radius: 50px;
    box-shadow: #0e2050 1px 2px 2px 1px, #0e2050 1px 1px 1px 1px;
    /*animation: spinLoader 1.1s linear infinite;*/
}

@keyframes spinLoader {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}
/* حذف محدودیت عرض Bootstrap */
#ModalDialog {
    /*height: 100vh;  پر کردن کل ارتفاع صفحه */
    max-width: none !important;
    width: auto;
}

.modal-body {
    display: flex;
    justify-content: center; /* افقی وسط */
    align-items: center; /* عمودی وسط */
    min-height: 200px; /* ارتفاع کافی برای مرکز شدن */
}

#appModalBody {
    overflow-x: auto; /* در صورت زیاد بودن ستون‌ها اسکرول افقی بده */
}

.form-field {
    margin-bottom: 1rem;
}

.modal {
    top: 0 !important;
}

    .modal.dimmed {
        opacity: 1;
        filter: blur(0px) brightness(0.3);
        pointer-events: none;
        transition: all .3s ease;
    }
/* چینش افقی ستون‌ها */
#appModalBody .dynamic-row {
    display: flex;
    flex-wrap: nowrap; /* مهم: جلوگیری از شکستن سطر */
    gap: 1rem;
}

    #appModalBody .dynamic-row .col {
        flex: 0 0 var(--min-col-width);
        min-width: var(--min-col-width);
    }

/* موبایل */
@media (max-width: 800px) {
    #appModalBody .dynamic-row {
        flex-wrap: wrap;
    }

        #appModalBody .dynamic-row .col {
            flex: 1 1 100%;
            min-width: 100%;
        }
}



.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
}

.modal-header,
.modal-footer {
    cursor: move; /* 👈 حالت Moving */
}
/* انیمیشن برای تغییر عرض */
.modal-content {
    transition: width 0.4s ease, max-width 0.4s ease;
    width: fit-content;
    min-width: 550px;
    height: auto !important;
    max-height: 100% !important;
    top: 0px;
    margin: 0;
    padding: 0;
}
/* وقتی مودال باز شده (کلاس show اضافه میشه) */
.modal.show .table-responsive {
    width: auto;
    height: auto !important;
    min-width: none;
    max-width: none;
}
/* جلوگیری از بریده شدن مودال هنگام جابجایی */
.modal-dialog-centered {
    /*align-items: flex-start !important;*/
}

    .modal-dialog-centered::before {
        display: 0 !important;
    }

.modal-dialog {
    width: auto !important;
    justify-content: center;
    /*margin-top: 68px !important;*/
}

.modal-IsWide {
    width: auto !important;
    max-width: 95% !important;
    height: auto !important;
    /*max-height: 100% !important;*/
}

.custom-toast {
    width: fit-content; /* اندازه بر اساس متن */
    max-width: 500px; /* حداکثر 500px */
    white-space: nowrap; /* نرفتن به خط بعد */
}

.Request-header-wrapper {
    border: 1px solid silver;
    background-color: #bab6b6;
    border-radius: 10px 10px 0 0;
    padding: 0 0 0 0;
    width: 100%;
    height: auto;
}

.Request-box {
    border: 0px solid black;
    border-radius: 10px;
    height: auto;
    min-height: 200px;
    width: 100%;
}

.Step-header-wrapper {
    border: 0px solid silver;
    background-color: #fff;
    border-radius: 0 0 0 0;
    width: 100%;
}

.Step-box {
    border: 0px solid black;
    border-radius: 0;
    display: inline;
    height: auto;
    min-height: 10px;
    width: 100%;
}

.Form-header-wrapper {
    border: 1px solid #808080;
    background-color: #e0dede;
    border-radius: 10px;
    margin: 0 25px 0 0;
    width: 98%;
}

.Form-box {
    border: 0px solid black;
    background-color: white;
    border-radius: 0;
    display: inline;
    height: auto;
    min-height: 50px;
    width: 99%;
    padding: 0 0 0 0;
}

.Form-img-thumbnail {
    width: 200px;
    height: 150px;
    border-radius: 10px;
}

.DeleteForm {
    display: inline;
}

.remove-btn {
    width: 14px;
    height: 14px;
    border-radius: 20% 0 0 0;
    border: none;
    background-color: #d9534f; /* قرمز */
    color: white;
    left: 0;
    top: -15px;
    font-size: 15px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    padding: 0px;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    transition: all .2s ease;
}

    .remove-btn::before {
        content: "×"; /* علامت ضربدر */
        font-weight: bold;
        position: absolute;
        top: -8px;
        left: 2px;
    }

    .remove-btn:hover {
        background-color: #ff4c49; /* قرمز روشن‌تر */
        border: 0px solid #ff4d4d !important;
        box-shadow: 0 0 2px rgba(0,0,0,0.4);
        color: darkred;
    }

.form-control {
    font-size: 12px;
}
/* ظاهر ولیدیشن وقتی خطا وجود دارد */
.field-validation-error, span[data-valmsg-for].text-danger {
    color: red !important;
    margin: 0 0 2px 0;
    display: block;
    font-size: 10px;
    font-weight: bold;
    text-align: left;
}

/* وقتی ولیدیشن معتبر است و پیام ندارد  */
.field-validation-valid {
    display: none; /* پیام خالی را مخفی می‌کند */
}
/* فیلدهای دارای خطا (input, select, textarea) */
.input-validation-error {
    border: 2px solid #ff4d4d !important;
    background-color: rgba(255, 0, 0, 0.1);
    border-radius: 5px;
    box-shadow: 0 0 4px rgba(255, 0, 0, 0.1);
}

/* برای select و textarea هم اعمال می‌شود */
select.input-validation-error,
textarea.input-validation-error {
    border: 1px solid #ff4d4d !important;
}

.input-validation-error:focus {
    outline: none;
    border-color: #ff0000 !important;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.8);
}

.dynamic-combo {
    min-height: 38px;
}
