/**
 * استایل‌های فرانت‌اند - نمایش جدول
 */

/* ========== کانتینر اصلی ========== */
.ravi-table-wrapper,
.ravi-table-shortcode-wrapper {
    margin: 30px 0;
    direction: rtl;
}

/* ========== بخش اطلاعات ========== */
.ravi-info-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.ravi-info-item {
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border-right: 3px solid #0073aa;
}

.ravi-info-item:last-child {
    margin-bottom: 0;
}

.ravi-info-item strong {
    color: #0073aa;
    margin-left: 10px;
    font-weight: 600;
}

/* ========== کانتینر جدول ========== */
.ravi-table-container {
    overflow-x: auto;
    margin: 20px 0;
}

/* ========== نوار ابزار ========== */
.ravi-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.ravi-search-box {
    flex: 1;
    min-width: 250px;
}

.ravi-table-search {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.ravi-table-search:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.ravi-export-buttons {
    display: flex;
    gap: 10px;
}

.ravi-export-buttons .button {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.ravi-export-buttons .button:hover {
    background: #005177;
}

.ravi-export-print {
    background: #46b450 !important;
}

.ravi-export-print:hover {
    background: #389842 !important;
}

/* ========== جدول اصلی ========== */
.ravi-table-frontend {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 0;
}

.ravi-table-frontend th,
.ravi-table-frontend td {
    padding: 15px;
    border: 1px solid #ddd;
    text-align: right;
}

.ravi-table-frontend thead th {
    background: linear-gradient(180deg, #0073aa 0%, #005177 100%);
    color: #fff;
    font-weight: 600;
    text-align: center;
    font-size: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ========== سلول‌های بخش ========== */
.ravi-section-cell {
    font-weight: 700;
    vertical-align: middle;
    text-align: center;
    font-size: 16px;
    color: #0073aa;
    border-right: 4px solid #0073aa;
}

/* ========== سلول‌های برچسب ردیف ========== */
.ravi-row-label-cell {
    font-weight: 600;
    color: #333;
    border-right: 2px solid #ccc;
}

/* ========== استایل‌های مختلف جدول ========== */

/* استایل پیش‌فرض (همان بالا) */
.ravi-table-default {
    /* همان استایل‌های بالا */
}

/* استایل راه‌راه */
.ravi-table-striped tbody tr:nth-child(odd) {
    background: #f9f9f9;
}

.ravi-table-striped tbody tr:nth-child(even) {
    background: #fff;
}

/* استایل با حاشیه */
.ravi-table-bordered th,
.ravi-table-bordered td {
    border: 2px solid #ddd;
}

.ravi-table-bordered {
    border: 2px solid #0073aa;
}

/* استایل هاور */
.ravi-table-hover tbody tr {
    transition: background-color 0.3s;
}

.ravi-table-hover tbody tr:hover {
    background-color: #f0f6fc;
}

/* ========== نمایش رنگ ========== */
.ravi-color-display {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 8px;
}

/* ========== لینک‌ها ========== */
.ravi-table-frontend a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s;
}

.ravi-table-frontend a:hover {
    color: #005177;
    text-decoration: underline;
}

/* ========== ردیف‌های خالی ========== */
.ravi-table-frontend .ravi-empty-message {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

/* ========== Responsive ========== */
@media screen and (max-width: 768px) {
    .ravi-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ravi-search-box {
        width: 100%;
    }

    .ravi-export-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .ravi-export-buttons .button {
        flex: 1;
    }

    .ravi-table-frontend {
        font-size: 13px;
    }

    .ravi-table-frontend th,
    .ravi-table-frontend td {
        padding: 10px 8px;
    }

    .ravi-info-section {
        padding: 15px;
    }

    .ravi-info-item {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .ravi-table-frontend {
        font-size: 12px;
    }

    .ravi-table-frontend th,
    .ravi-table-frontend td {
        padding: 8px 5px;
    }

    .ravi-section-cell,
    .ravi-row-label-cell {
        font-size: 13px;
    }
}

/* ========== چاپ ========== */
@media print {
    .ravi-table-toolbar {
        display: none;
    }

    .ravi-table-frontend {
        box-shadow: none;
        border: 1px solid #000;
    }

    .ravi-table-frontend th {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #000;
    }

    .ravi-table-frontend td {
        border: 1px solid #000;
    }

    .ravi-section-cell {
        background: #e0e0e0 !important;
        color: #000 !important;
    }

    .ravi-info-section {
        border: 1px solid #000;
        background: #fff;
    }
}

/* ========== حالت بارگذاری ========== */
.ravi-table-loading {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

.ravi-table-loading::after {
    content: "در حال بارگذاری...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 30px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: #0073aa;
}

/* ========== هایلایت جستجو ========== */
.ravi-search-highlight {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* ========== ردیف مخفی ========== */
.ravi-table-frontend tr.ravi-hidden-row {
    display: none;
}

/* ========== علامت چک ========== */
.ravi-table-frontend td .ravi-checkbox-mark {
    color: #46b450;
    font-size: 18px;
    font-weight: bold;
}

/* ========== آیکون‌های نمایشی ========== */
.ravi-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 5px;
}

/* ========== انیمیشن ورود ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ravi-table-wrapper {
    animation: slideIn 0.4s ease-out;
}

/* ========== Scrollbar سفارشی ========== */
.ravi-table-container::-webkit-scrollbar {
    height: 10px;
}

.ravi-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ravi-table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.ravi-table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== پیام‌های وضعیت ========== */
.ravi-no-results {
    text-align: center;
    padding: 30px;
    color: #d63638;
    font-weight: 600;
    background: #fef7f1;
    border-radius: 4px;
    margin-top: 15px;
}

/* ========== سایه متن برای بهبود خوانایی ========== */
.ravi-table-frontend thead th {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========== تمایز بصری بیشتر ========== */
.ravi-table-frontend tbody tr {
    transition: all 0.3s ease;
}

.ravi-table-frontend tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========== استایل‌های لیست نوشته‌ها در Elementor ========== */
.ravi-entries-list-widget {
    direction: rtl;
}

.ravi-entry-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.ravi-entry-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ravi-entry-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #0073aa;
}

.ravi-entry-title a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s;
}

.ravi-entry-title a:hover {
    color: #005177;
}

.ravi-entry-excerpt {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-top: 10px;
}

/* ========== استایل‌های ویجت‌های Elementor ========== */
.ravi-table-elementor-widget,
.ravi-entry-elementor-widget {
    direction: rtl;
}

.ravi-table-elementor-widget .ravi-table-wrapper,
.ravi-entry-elementor-widget .ravi-entry-wrapper {
    margin: 0;
}
