﻿/* =====================================================================
   responsive.css  —  استایل‌های ریسپانسیو سراسری پروژه
   Breakpointها (فقط همین‌جا تعریف شوند):
     موبایل  : < 576px
     تبلت    : >= 576px
     دسکتاپ  : >= 992px
   ===================================================================== */

/* ---------- ۱. پایه ---------- */
img {
    max-width: 100%;
    height: auto;
}

.page-header h4 {
    font-size: 1.15rem;
}

@media (min-width: 768px) {
    .page-header h4 {
        font-size: 1.35rem;
    }
}
@media (min-width: 992px) {
    .filter-row.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* ---------- ۲. گرید آیتم‌های آماری (کارت اطلاعات) ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 8px;
    min-width: 0;
    border-bottom: 1px solid var(--bs-border-color, #e5e7eb);
}

    .stat-item:last-child {
        border-bottom: 0;
    }

    .stat-item .stat-text {
        min-width: 0;
        flex: 1;
        overflow-wrap: anywhere;
    }

    .stat-item .stat-title {
        font-size: .8rem;
        color: #6c757d;
        margin-bottom: 2px;
    }

.stat-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, .1);
}

@media (min-width: 576px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 16px;
    }

    .stat-item:nth-last-child(-n+2) {
        border-bottom: 0;
    }
}

@media (min-width: 992px) {
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
        column-gap: 0;
    }

        .stat-grid.cols-3 {
            grid-template-columns: repeat(3, 1fr);
        }

    .stat-item {
        border-bottom: 0;
        padding: 8px 16px;
    }

        .stat-item:not(:last-child) {
            border-inline-end: 1px solid var(--bs-border-color, #e5e7eb);
        }
}

/* ---------- ۳. دکمه‌های هدر صفحه ---------- */
@media (max-width: 575.98px) {
    .header-actions .btn {
        width: 100%;
    }
}

/* ---------- ۴. جدول / DataGrid ----------
   دور هر جدول یا RadzenDataGrid این کانتینر را بگذار */
.table-responsive-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .table-responsive-wrap > table,
    .table-responsive-wrap > .rz-data-grid {
        min-width: 640px;
    }

/* ---------- ۵. فیلد + دکمه‌های کنارش ---------- */
.field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .field-actions > input,
    .field-actions > .form-control {
        flex: 1 1 200px;
        min-width: 0;
    }

    .field-actions > .btn {
        flex: 0 0 auto;
    }

@media (max-width: 575.98px) {
    .field-actions > .btn {
        flex: 1 1 calc(50% - 4px);
    }
}

/* ---------- ۶. نوار پایین فرم (دکمه‌ها + چک‌باکس‌ها) ---------- */
.form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 1rem;
}

    .form-footer .footer-buttons,
    .form-footer .footer-checks {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 20px;
    }

@media (max-width: 575.98px) {
    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }

        .form-footer .footer-buttons .btn,
        .form-footer .footer-buttons .rz-button {
            flex: 1;
        }
}

/* ---------- ۷. نوار صفحه‌بندی ---------- */
.pager-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 1.5rem;
}

@media (max-width: 767.98px) {
    .pager-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

        .pager-bar .pager-buttons {
            display: flex;
            gap: 8px;
        }

            .pager-bar .pager-buttons .btn {
                flex: 1;
            }

        .pager-bar .pager-size {
            justify-content: center;
        }
}

/* ---------- ۸. مودال ---------- */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: .5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        padding: .75rem;
    }
}

/* ---------- ۹. تب‌ها: اسکرول افقی به‌جای شکستن ---------- */
.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

/* ---------- ۱۰. گالری تصاویر ---------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.media-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ---------- ۱۱. ردیف فیلترهای جستجو ---------- */
.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 576px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .filter-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- ۱۲. ابزارهای کمکی ---------- */
.stack-on-mobile {
    display: flex;
    gap: 8px;
}

@media (max-width: 575.98px) {
    .stack-on-mobile {
        flex-direction: column;
    }

        .stack-on-mobile > * {
            width: 100%;
        }
}
 
.field-actions > .rz-button {
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .field-actions > .rz-button {
        flex: 1 1 calc(50% - 4px);
    }

    .header-actions .rz-button,
    .filter-actions .rz-button {
        width: 100%;
    }
}
@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}
@media (min-width: 576px) {
    .w-sm-auto {
        width: auto !important;
    }
}

 
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        padding: 0.75rem;
    }

    .modal-header,
    .modal-footer {
        padding: 0.75rem;
    }
        /* دکمه‌های footer مودال تمام عرض */
        .modal-footer .btn {
            width: 100%;
        }
}

/* دکمه‌های داخل جدول در موبایل کوچیک‌تر */
@media (max-width: 575.98px) {
    .rz-data-grid .rz-button {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .table-responsive-wrap .rz-cell-data {
        padding: 4px 6px;
        font-size: 0.8rem;
    }
}
/* ============================================
   User Info Card — Responsive
   ============================================ */

.user-info-card {
    padding: 5px;
    margin-bottom: 20px;
}

.user-info-inner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
}

.user-avatar-wrapper {
    flex-shrink: 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    /* رنگ پس‌زمینه رو از تم فعلی پروژه‌ت بذار */
}

.user-info-content {
    flex: 1;
    min-width: 0;
}

.user-name-block {
    margin-bottom: 12px;
}

.user-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.user-info-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.user-info-item {
    display: flex;
    align-items: center;
    min-width: 0;
}

.user-info-pair {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

    .user-info-pair b {
        flex-shrink: 0;
    }

    .user-info-pair span {
        overflow-wrap: anywhere;
    }

/* ---------- تبلت (>= 576px): دو ستونه ---------- */
@media (min-width: 576px) {
    .user-info-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
    }

    .profile-avatar {
        width: 90px;
        height: 90px;
        font-size: 2.25rem;
    }
}

/* ---------- موبایل (< 576px): آواتار و اطلاعات زیر هم ---------- */
@media (max-width: 575.98px) {
    .user-info-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 12px;
    }

    .user-info-item {
        justify-content: center;
    }

    .user-info-pair {
        justify-content: center;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }
}
/* ============================================
   Person Info Card — Responsive
   ============================================ */

.person-info-card {
    padding: 5px;
    margin-bottom: 20px;
}

.person-info-inner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
}

.person-avatar-wrapper {
    flex-shrink: 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    /* رنگ پس‌زمینه رو از تم فعلی پروژه‌ت بذار */
}

.person-info-content {
    flex: 1;
    min-width: 0;
}

.person-name-block {
    margin-bottom: 12px;
}

.person-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.person-info-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.person-info-item {
    display: flex;
    align-items: center;
    min-width: 0;
}

.person-info-pair {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

    .person-info-pair b {
        flex-shrink: 0;
    }

    .person-info-pair span {
        overflow-wrap: anywhere;
    }

/* ---------- تبلت (>= 576px): دو ستونه ---------- */
@media (min-width: 576px) {
    .person-info-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
    }

    .profile-avatar {
        width: 90px;
        height: 90px;
        font-size: 2.25rem;
    }
}

/* ---------- موبایل (< 576px): آواتار و اطلاعات زیر هم ---------- */
@media (max-width: 575.98px) {
    .person-info-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 12px;
    }

    .person-info-item {
        justify-content: center;
    }

    .person-info-pair {
        justify-content: center;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }
}
