
/* =====================================
   CMSIRAN Premium Responsive Table
===================================== */

.cmsiran-pro-table {
    --cpt-primary: #0a65fc;
    --cpt-accent: #e52236;
    --cpt-header: #edf4ff;
    --cpt-header-text: #174b91;
    --cpt-dark: #243b59;
    --cpt-border: #e0e7f0;
    --cpt-light: #f8fafd;
    --cpt-text: #475569;
    --cpt-hover: #f0f6ff;

    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 28px 0;
    padding: 0;
    border: 1px solid var(--cpt-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(36, 59, 89, .05);
    overflow: hidden;
    direction: rtl;
    box-sizing: border-box;
}

.cmsiran-pro-table *,
.cmsiran-pro-table *::before,
.cmsiran-pro-table *::after {
    box-sizing: border-box;
}

/* Table Structure */

.cmsiran-pro-table > table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
}

/* Caption */

.cmsiran-pro-table caption {
    caption-side: top;
    padding: 17px 20px;
    background: #fff;
    color: #667085;
    font-size: 12px;
    line-height: 2;
    text-align: right;
}

/* Premium Table Header */

.cmsiran-pro-table > table > thead,
.cmsiran-pro-table > table > thead > tr,
.cmsiran-pro-table > table > thead > tr > th,
.cmsiran-pro-table > table > thead > tr:hover > th {
    background: var(--cpt-header) !important;
    color: var(--cpt-header-text) !important;
}

.cmsiran-pro-table > table > thead > tr > th {
    width: auto;
    padding: 20px 14px;
    border: 0 !important;
    border-bottom: 2px solid #cbdcf5 !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.9;
    text-align: center;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-shadow: none;
    opacity: 1;
}

.cmsiran-pro-table > table > thead > tr > th + th {
    border-right: 1px solid #dbe6f5 !important;
}

/* Table Cells */

.cmsiran-pro-table tbody td {
    padding: 20px 16px;
    border: 0;
    border-bottom: 1px solid var(--cpt-border);
    background: transparent;
    color: var(--cpt-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 2.1;
    text-align: right;
    vertical-align: middle;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

.cmsiran-pro-table tbody td:first-child {
    color: var(--cpt-dark);
    font-weight: 700;
    border-right: 3px solid transparent;
    transition: border-color .25s ease;
}

/* Alternate Rows */

.cmsiran-pro-table tbody tr {
    background: #fff;
    transition: background-color .25s ease;
}

.cmsiran-pro-table tbody tr:nth-child(even) {
    background: var(--cpt-light);
}

.cmsiran-pro-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Desktop Hover */

@media (hover: hover) and (min-width: 768px) {

    .cmsiran-pro-table tbody tr:hover {
        background: var(--cpt-hover);
    }

    .cmsiran-pro-table tbody tr:hover td:first-child {
        border-right-color: var(--cpt-primary);
    }
}

/* Tablet */

@media (min-width: 768px) and (max-width: 991px) {

    .cmsiran-pro-table > table > thead > tr > th {
        padding: 16px 10px;
        font-size: 13px;
    }

    .cmsiran-pro-table tbody td {
        padding: 16px 12px;
        font-size: 12px;
    }
}

/* =====================================
   Responsive Mobile Cards
===================================== */

@media (max-width: 767px) {

    .cmsiran-pro-table {
        margin: 22px 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .cmsiran-pro-table > table,
    .cmsiran-pro-table tbody {
        display: block;
        width: 100%;
    }

    .cmsiran-pro-table caption {
        display: block;
        width: 100%;
        padding: 0 0 15px;
        background: transparent;
    }

    .cmsiran-pro-table > table > thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    .cmsiran-pro-table tbody tr,
    .cmsiran-pro-table tbody tr:nth-child(even) {
        display: block;
        width: 100%;
        margin: 0 0 16px;
        border: 1px solid var(--cpt-border);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 5px 18px rgba(36, 59, 89, .05);
        overflow: hidden;
    }

    .cmsiran-pro-table tbody td {
        display: block;
        width: 100% !important;
        padding: 16px 18px;
        border-bottom: 1px solid var(--cpt-border);
        font-size: 13px;
    }

    .cmsiran-pro-table tbody td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--cpt-header-text);
        font-size: 12px;
        font-weight: 700;
    }

    .cmsiran-pro-table tbody td:first-child {
        padding: 17px 18px;
        background: var(--cpt-header) !important;
        color: var(--cpt-header-text) !important;
        border: 0;
        border-bottom: 1px solid #cbdcf5;
        border-right: 3px solid var(--cpt-accent);
        font-size: 14px;
        font-weight: 700;
    }

    .cmsiran-pro-table tbody td:first-child::before {
        display: none;
    }

    .cmsiran-pro-table tbody td:last-child {
        border-bottom: 0;
    }
}

/* Accessibility - Reduced Motion */

@media (prefers-reduced-motion: reduce) {

    .cmsiran-pro-table tbody tr,
    .cmsiran-pro-table tbody td:first-child {
        transition: none;
    }
}
