/* استایل عمومی */
.cs-form, .cs-front-form-wrap {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    direction: rtl;
    font-family: 'Vazir', 'Tahoma', sans-serif;
}

.cs-form h2, .cs-front-form-wrap h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #23282d;
}

.cs-form label, .cs-front-form-wrap label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #23282d;
}

.cs-form input[type="text"],
.cs-form input[type="email"],
.cs-form textarea,
.cs-form select,
.cs-front-form-wrap input[type="text"],
.cs-front-form-wrap input[type="email"],
.cs-front-form-wrap textarea,
.cs-front-form-wrap select,
.cs-front-form-wrap input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background: #f9f9f9;
}

.cs-form textarea, .cs-front-form-wrap textarea {
    height: 120px;
    resize: vertical;
}

.cs-form input[type="submit"],
.cs-front-form-wrap input[type="submit"] {
    background-color: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.cs-form input[type="submit"]:hover,
.cs-front-form-wrap input[type="submit"]:hover {
    background-color: #005d87;
}

.cs-notice {
    padding: 10px;
    margin-bottom: 15px;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
    border-radius: 4px;
}

.cs-error {
    padding: 10px;
    margin-bottom: 15px;
    background: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
    border-radius: 4px;
}

/* استایل جداول */
.wp-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.wp-list-table th,
.wp-list-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.wp-list-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.wp-list-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wp-list-table tr:hover {
    background-color: #f0f0f0;
}

/* استایل لینک‌ها */
.wp-list-table a {
    color: #0073aa;
    text-decoration: none;
}

.wp-list-table a:hover {
    text-decoration: underline;
}

.delete-link {
    color: #dc3232;
}

.delete-link:hover {
    color: #a00;
}

/* استایل دکمه چاپ */
.print-button {
    margin: 10px 0;
    padding: 8px 16px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.print-button:hover {
    background-color: #005d87;
}

/* استایل Select2 */
.select2-container {
    width: 100% !important;
    margin-bottom: 15px;
}

.select2-container--default .select2-selection--single {
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 38px;
    padding: 5px;
    background: #f9f9f9;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container .select2-selection__placeholder {
    color: #999;
}

/* استایل برای چاپ */
@media print {
    /* مخفی کردن منوها، هدر و فوتر وردپرس */
    #adminmenu,
    #wpadminbar,
    #wpfooter,
    .update-nag,
    .notice,
    .wrap h1 {
        display: none !important;
    }

    /* نمایش فقط جداول */
    .wp-list-table {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .wp-list-table th,
    .wp-list-table td {
        border: 1px solid #000 !important;
        padding: 8px !important;
    }

    /* تنظیمات برای جدول مکاتبات */
    .cs-main-table th:nth-child(1),
    .cs-main-table td:nth-child(1) { width: 10%; } /* شماره نامه */
    .cs-main-table th:nth-child(2),
    .cs-main-table td:nth-child(2) { width: 20%; } /* موضوع */
    .cs-main-table th:nth-child(3),
    .cs-main-table td:nth-child(3) { width: 15%; } /* فرستنده */
    .cs-main-table th:nth-child(4),
    .cs-main-table td:nth-child(4) { width: 15%; } /* گیرنده */
    .cs-main-table th:nth-child(5),
    .cs-main-table td:nth-child(5) { width: 10%; } /* تاریخ */
    .cs-main-table th:nth-child(6),
    .cs-main-table td:nth-child(6) { width: 10%; } /* نوع */
    .cs-main-table th:nth-child(7),
    .cs-main-table td:nth-child(7) { width: 10%; } /* پیوست */
    .cs-main-table th:nth-child(8),
    .cs-main-table td:nth-child(8) { width: 10%; } /* عملیات */

    /* تنظیمات برای جدول مخاطبین */
    .cs-contacts-table th:nth-child(1),
    .cs-contacts-table td:nth-child(1) { width: 25%; } /* نام */
    .cs-contacts-table th:nth-child(2),
    .cs-contacts-table td:nth-child(2) { width: 20%; } /* ایمیل */
    .cs-contacts-table th:nth-child(3),
    .cs-contacts-table td:nth-child(3) { width: 20%; } /* تلفن */
    .cs-contacts-table th:nth-child(4),
    .cs-contacts-table td:nth-child(4) { width: 20%; } /* سازمان */
    .cs-contacts-table th:nth-child(5),
    .cs-contacts-table td:nth-child(5) { width: 15%; } /* عملیات */

    /* اطمینان از چاپ فقط محتوای جدول */
    body * {
        visibility: hidden;
    }
    .wp-list-table,
    .wp-list-table * {
        visibility: visible;
    }
    .print-button {
        display: none;
    }
}