/* =========================================================
   IR Core Table Widget - جدول حرفه‌ای و ریسپانسیو
   ========================================================= */

/* =========================================================
   CONTAINER
   ========================================================= */
.ir-table-container {
    width: 100%;
    direction: rtl;
    margin-bottom: 20px;
}

/* =========================================================
   TITLE
   ========================================================= */
.ir-table-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 14px;
    padding: 0;
}

.ir-table-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ir-color-primary);
    font-size: 20px;
    flex-shrink: 0;
}

.ir-table-title-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* =========================================================
   RESPONSIVE WRAPPER
   ========================================================= */
.ir-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   TABLE
   ========================================================= */
.ir-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    border: 1px solid #e2e5ea;
    border-radius: 12px;
    min-width: 400px;
	overflow: hidden;
}

/* =========================================================
   HEADER
   ========================================================= */
.ir-table thead th {
    background-color: var(--ir-color-primary);
    color: #ffffff;
    font-weight: 700;
    padding: 14px 18px;
    text-align: right;
    border: 1px solid #e2e5ea;
    font-size: 14px;
    letter-spacing: .2px;
}

/* =========================================================
   BODY
   ========================================================= */
.ir-table tbody td {
    padding: 12px 18px;
    border: 1px solid #e2e5ea;
    text-align: right;
    color: #1a2332;
    vertical-align: middle;
    transition: background-color .2s ease;
}

.ir-table tbody tr {
    transition: box-shadow .2s ease;
}

.ir-table-container:not(.ir-table-no-hover) .ir-table tbody tr:hover td {
    background-color: #f0f4fe !important;
}

.ir-table-cell-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* زبرا (ردیف‌های راه‌راه) - فقط وقتی فعال باشد */
.ir-table-zebra .ir-table tbody tr:nth-child(odd) td {
    background-color: #f8fafc;
}

/* =========================================================
   ROW HIGHLIGHT (ردیف ویژه)
   ========================================================= */
.ir-table tbody tr.ir-row-highlight {
    position: relative;
    border-right: 4px solid var(--ir-color-primary);
}

.ir-table tbody tr.ir-row-highlight td {
    background-color: #eef6ff !important;
    color: var(--ir-color-primary);
    font-weight: 600;
}

.ir-table-badge {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background-color: var(--ir-color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.8;
    vertical-align: middle;
}

/* =========================================================
   ICON
   ========================================================= */
.ir-table-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ir-color-primary);
    font-size: 18px;
    vertical-align: middle;
    flex-shrink: 0;
}

.ir-table-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ir-table-icon--circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #eaf1ff;
    font-size: 15px;
}

.ir-table-icon--circle svg {
    width: 15px;
    height: 15px;
}

/* =========================================================
   STYLE: CLASSIC (کلاسیک)
   ========================================================= */
.ir-table-style-classic .ir-table {
    border: 2px solid var(--ir-color-primary);
}

.ir-table-style-classic .ir-table thead th {
    background-color: var(--ir-color-primary);
    color: #fff;
}

/* =========================================================
   STYLE: MODERN (مدرن)
   ========================================================= */
.ir-table-style-modern .ir-table {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(20, 20, 43, .08);
}

.ir-table-style-modern .ir-table thead th {
    background: linear-gradient(135deg, var(--ir-color-primary), #0b5ed7);
    border: none;
    padding-block: 16px;
}

.ir-table-style-modern .ir-table tbody td {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid #eef1f5;
}

.ir-table-style-modern .ir-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================================
   STYLE: MINIMAL (مینیمال)
   ========================================================= */
.ir-table-style-minimal .ir-table {
    border: none;
}

.ir-table-style-minimal .ir-table thead th {
    background: transparent;
    color: #1a2332;
    border: none;
    border-bottom: 2px solid var(--ir-color-primary);
    font-weight: 700;
    padding-bottom: 10px;
}

.ir-table-style-minimal .ir-table tbody td {
    border: none;
    border-bottom: 1px solid #f0f2f5;
    padding: 12px 6px;
}

.ir-table-style-minimal .ir-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================================
   STYLE: STRIPED (خط‌دار)
   ========================================================= */
.ir-table-style-striped .ir-table {
    border: none;
}

.ir-table-style-striped .ir-table thead th {
    background-color: #f0f2f5;
    color: #1a2332;
    border: none;
    border-bottom: 2px solid #d7dbe0;
}

.ir-table-style-striped .ir-table tbody td {
    border: none;
    border-bottom: 1px solid #eef1f5;
}

.ir-table-style-striped .ir-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================================
   STYLE: BORDERLESS (بدون کادر)
   ========================================================= */
.ir-table-style-borderless .ir-table {
    border: none;
}

.ir-table-style-borderless .ir-table thead th {
    background: transparent;
    color: #1a2332;
    border: none;
    border-bottom: 2px solid #e2e5ea;
    font-weight: 700;
}

.ir-table-style-borderless .ir-table tbody td {
    border: none;
    padding: 12px 6px;
}

.ir-table-style-borderless .ir-table tbody tr {
    border-bottom: 1px solid #f0f2f5;
}

.ir-table-style-borderless .ir-table tbody tr:last-child {
    border-bottom: none;
}

/* =========================================================
   RESPONSIVE - موبایل
   ========================================================= */
@media (max-width: 768px) {
    .ir-table {
        min-width: unset;
        width: 100%;
    }

    /* تبدیل جدول به کارت در موبایل */
    .ir-table thead {
        display: none;
    }

    .ir-table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e2e5ea;
        border-radius: 10px;
        padding: 12px;
        background: #fff !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .ir-table tbody tr.ir-row-highlight {
        border-right: 4px solid var(--ir-color-primary);
        border-radius: 10px 0 0 10px;
    }

    .ir-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border: none !important;
        background: transparent !important;
        gap: 12px;
        font-size: 14px;
    }

    .ir-table tbody td:last-child {
        border-bottom: none !important;
    }

    .ir-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6b7a8f;
        font-size: 13px;
        flex-shrink: 0;
        min-width: 80px;
    }

    .ir-table-badge {
        margin-right: 0;
        margin-left: 6px;
    }

    /* استایل‌های خاص برای موبایل */
    .ir-table-style-modern .ir-table tbody tr {
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .ir-table-style-minimal .ir-table tbody tr {
        border: none;
        border-radius: 0;
        padding: 8px 0;
        box-shadow: none;
    }

    .ir-table-style-striped .ir-table tbody tr {
        border: none;
        border-radius: 0;
        padding: 8px 0;
        box-shadow: none;
    }

    .ir-table-style-borderless .ir-table tbody tr {
        border: none;
        border-radius: 0;
        padding: 8px 0;
        box-shadow: none;
    }
}

/* =========================================================
   RESPONSIVE - موبایل کوچک
   ========================================================= */
@media (max-width: 480px) {
    .ir-table tbody td {
        font-size: 13px;
        flex-wrap: wrap;
    }

    .ir-table tbody td::before {
        font-size: 12px;
        min-width: 60px;
    }

    .ir-table tbody tr {
        padding: 10px;
        margin-bottom: 12px;
    }

    .ir-table-title {
        font-size: 17px;
    }

    .ir-table-icon,
    .ir-table-title-icon {
        font-size: 15px;
    }

    .ir-table-icon svg,
    .ir-table-title-icon svg {
        width: 15px;
        height: 15px;
    }

    .ir-table-icon--circle {
        width: 26px;
        height: 26px;
    }
}