/* =========================================
   استایل‌های مودال، تب‌ها و فرم‌های سفارشی
   ========================================= */

/* لایه تاریک پشت مودال */

/* public_html/assets/css/style.css */

/* --- تعریف فونت وزیرمتن --- */
@font-face {
    font-family: 'Vazirmatn';
    /* مسیر نسبی: از پوشه css یک مرحله عقب می‌رویم (..) و وارد fonts می‌شویم */
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- اعمال فونت به کل پروژه --- */
body,
html,
h1,
h2,
h3,
h4,
h5,
h6,
input,
button,
select,
textarea,
span,
div,
p,
a,
li,
label,
.leaflet-container,
/* فونت داخل نقشه */
.leaflet-popup-content,
/* متن پاپ‌آپ‌ها */
.leaflet-tooltip,
/* متن تولتیپ‌ها */
.info.legend {
    /* راهنمای نقشه */
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}
.custom-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
    /* افکت بلور برای زیبایی */
}

/* کادر اصلی سفید مودال */
.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 500px;
    /* عرض بیشتر برای راحتی */
    max-width: 95%;
    max-height: 90vh;
    /* حداکثر ارتفاع */
    display: flex;
    flex-direction: column;
    /* چیدمان عمودی اجزا */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    /* جلوگیری از بیرون زدن محتوا */
}

/* هدر مودال (عنوان و دکمه بستن) */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.close-modal {
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal:hover {
    color: #e74c3c;
}

/* بدنه مودال (محل قرارگیری تب‌ها و فرم‌ها) */
.modal-body {
    flex: 1;
    /* پر کردن فضای خالی */
    overflow-y: auto;
    /* اسکرول خوردن فقط برای این بخش */
    padding: 20px;
}

/* فوتر مودال (محل دکمه ذخیره) */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    text-align: left;
    /* دکمه سمت چپ باشد */
}

/* --- استایل تب‌ها --- */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    /* برای چسبیدن به خط زیرین */
}
.leaflet-tooltip {
    direction: ltr; /* جلوگیری از به هم ریختگی موقعیت در قالب‌های راست‌چین */
}
.custom-customer-tooltip {
    direction: rtl; /* راست‌چین کردن محتوای داخل تولتیپ */
}
/* نقشه و سیستم موقعیت‌یابی آن باید در حالت LTR باشند تا مختصات به هم نریزد */
.leaflet-container {
    direction: ltr !important;
}

/* اما محتوای داخل تولتیپ و پاپ‌آپ باید راست‌چین و فارسی بماند */
.leaflet-tooltip, 
.leaflet-popup-content,
.custom-customer-tooltip {
    direction: rtl !important;
    text-align: right !important;
    font-family: inherit; /* برای اعمال فونت سایت شما */
}

#sidebar-legend-container .list-group-item.active {
    background-color: #e2e3e5 !important; /* پس‌زمینه خاکستری روشن */
    color: #383d41 !important; /* رنگ متن */
    border-color: #d6d8db !important; /* رنگ حاشیه */
}
.tab-btn:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.tab-btn.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    font-weight: bold;
    background-color: #fff;
}

.tab-content {
    display: none;
    /* مخفی بودن پیش‌فرض */
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
    /* نمایش تب فعال */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- استایل ردیف‌های فرم (Attributes) --- */
.attr-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px;
    border: 1px solid #eee;
    /* کادر دور هر ردیف */
    border-radius: 6px;
    background-color: #fff;
    transition: box-shadow 0.2s;
}

.attr-row:focus-within {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
}

.attr-row label {
    width: 130px;
    /* فضای ثابت برای لیبل */
    font-weight: 500;
    font-size: 13px;
    color: #495057;
    margin-left: 10px;
    white-space: nowrap;
    /* جلوگیری از شکسته شدن متن */
}

/* استایل ورودی‌ها (Input) */
.attr-row input {
    flex: 1;
    /* پر کردن فضای باقی‌مانده */
    height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    color: #212529 !important;
    /* رنگ متن مشکی */
    background-color: #fff !important;
    /* پس‌زمینه سفید */
    border: 1px solid #ced4da !important;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s ease-in-out;
}

.attr-row input:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.attr-row input::placeholder {
    color: #adb5bd;
    font-size: 12px;
}

/* دکمه‌های اصلی */
.btn-primary {
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #0056b3;
}
    .legend-customer-item {
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .legend-customer-item:hover {
        background-color: #f0f0f0;
    }

    .legend-customer-list.collapse {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        background-color: #fafafa;
    }

    .sidebar-legend-row.drag-over {
        background-color: #e0f0ff; /* رنگ پس‌زمینه هنگام کشیدن روی یک مسیر */
        border: 1px dashed #007bff;
    }

    .legend-customer-item.dragging {
        opacity: 0.5; /* آیتمی که در حال کشیده شدن است نیمه‌شفاف می‌شود */
    }

    .legend-toggle-btn {
        width: 20px;
        cursor: pointer;
        font-weight: bold;
        text-align: center;
    }
.custom-multiselect {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.multiselect-header {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #333;
}
.multiselect-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 999;
    max-height: 200px;
    overflow-y: auto;
}
.multiselect-options.show {
    display: block;
}
.multiselect-options label {
    display: block;
    padding: 8px 12px;
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.multiselect-options label:hover {
    background: #f1f1f1;
}
.multiselect-options input[type="checkbox"] {
    margin-left: 8px; /* فاصله چک باکس تا متن در حالت راست‌چین */
    cursor: pointer;
}
