/* فرم تیکت */
.rt-ticket-form {
    margin: 0 auto;
    padding: 20px;
}
.rt-no-tickets
 {
    text-align: center;
}
.rt-form-row {
    margin-bottom: 20px;
}

.rt-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.rt-form-row input[type="text"],
.rt-form-row input[type="email"],
.rt-form-row textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.rt-file-upload .description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* لیست تیکت‌ها */
.rt-ticket-list {
    margin: 20px 0;
    font-family: "YekanBakh", Arial, Helvetica, sans-serif;
}
.btn{
    font-family: "YekanBakh", Arial, Helvetica, sans-serif !important;
}
tbody {
  background: #fff;
}
.rahkar-title {
  display: flex;
  justify-content: space-between;
}
.rahkar-btn {
  max-height: 45px !important;;
  font-size: 17px !important;
}
.rt-ticket-filters {
    margin-bottom: 20px;
}

.rt-tickets-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.rt-tickets-table th,
.rt-tickets-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: right;
}

.rt-tickets-table th {
    background: #f5f5f5;
}

/* اضافه کردن استایل پویا */
.rt-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

/* پیام‌ها */
.rt-message {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.rt-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rt-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* دکمه‌ها */
.rt-button {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.rt-button:hover {
    background: #006291;
}
/* استایل‌های صفحه نمایش تیکت */
.rt-ticket-view {
    margin: 0 auto;
    padding: 20px;
}

.rt-ticket-header {
    margin-bottom: 30px;
}

.rt-ticket-header h2 {
    margin: 0 0 10px 0;
}

.rt-ticket-meta {
    color: #666;
    font-size: 0.9em;
}

.rt-ticket-meta span {
    margin-right: 15px;
}

.rt-ticket-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    background: #f0f0f1;
}

.rt-ticket-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 30px;
    text-align: right;
  direction: rtl !important;
  font-family: "YekanBakh";
  font-weight: 400 !important;
}

.rt-custom-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.rt-field {
    margin-bottom: 10px;
}

.rt-reply {
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.rt-admin-reply {
    background: #f0f7ff;
}

.rt-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.rt-reply-author {
    display: flex;
    align-items: center;
}
.rt-replies {
  text-align: right;
  font-family: "YekanBakh", Arial, Helvetica, sans-serif;
}
.rt-reply-author img {
    margin-right: 10px;
    border-radius: 50%;
}

.rt-admin-badge {
    background: #007cba;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    margin: 0 10px;
}

.rt-reply-date {
    color: #666;
    font-size: 0.9em;
}

.rt-reply-attachments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.rt-download-link {
    display: inline-block;
    padding: 5px 10px;
    margin: 5px;
    background: #f0f0f1;
    border-radius: 3px;
    text-decoration: none;
    color: #135e96;
}

.rt-download-link:hover {
    background: #e0e0e1;
}

.rt-ticket-closed {
    text-align: center;
    padding: 20px;
    background: #f0f0f1;
    border-radius: 4px;
    margin-top: 20px;
}
/* استایل برای منوی پشتیبانی در ووکامرس */
.woocommerce-MyAccount-navigation-link--tickets a::before {
    content: '\f468';
    font-family: 'dashicons';
}

/* استایل برای صفحه تیکت‌ها در ووکامرس */
.woocommerce-account .rt-ticket-list {
    margin: 20px 0;
}

.woocommerce-account .rt-ticket-form {
    max-width: 100%;
}
/* استایل‌های منوی WooCommerce */
.woocommerce-MyAccount-navigation-link--tickets a::before {
    content: "\f468";
    font-family: dashicons;
}

/* استایل‌های صفحه تیکت‌ها */
.rt-tickets-wrapper {
    margin: 20px 0;
}

.rt-tickets-header {
    margin-bottom: 20px;
}

.rt-tickets-header .button {
    background: #2271b1;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
}

.rt-tickets-header .button:hover {
    background: #135e96;
}

.rt-new-ticket-wrapper h2 {
    margin-bottom: 20px;
}

/* سازگاری با تم WooCommerce */
.woocommerce-account .rt-ticket-form {
    max-width: 100%;
    padding: 0;
}

.woocommerce-account .rt-tickets-table {
    width: 100%;
}

.woocommerce-account .rt-form-row {
    margin-bottom: 20px;
}

.woocommerce-account .rt-form-row label {
    display: block;
    margin-bottom: 5px;
}

.woocommerce-account .rt-form-row input[type="text"],
.woocommerce-account .rt-form-row textarea {
    width: 100%;
}
/* استایل‌های تیکت در حساب کاربری ووکامرس */
.woocommerce-account .rt-tickets-wrapper {
    margin-bottom: 2em;
}

.woocommerce-account .rt-tickets-header {
    margin-bottom: 1em;
    display: flex;
    justify-content: flex-end;
}

.rt-ticket-view {
    margin-bottom: 2em;
}

.ticket-meta {
    margin: 1em 0;
    color: #666;
}

.ticket-meta span {
    margin-right: 1em;
}

.ticket-content {
    background: #f8f8f8;
    padding: 1em;
    border-radius: 4px;
    margin: 1em 0;
}

.ticket-replies {
    margin: 2em 0;
}

.ticket-reply {
    background: #fff;
    border: 1px solid #ddd;
    padding: 1em;
    margin: 1em 0;
    border-radius: 4px;
}

.reply-meta {
    margin-bottom: 0.5em;
    color: #666;
}

.reply-author {
    font-weight: bold;
    margin-right: 1em;
}

.reply-form {
    margin: 2em 0;
    padding: 1em;
    background: #f8f8f8;
    border-radius: 4px;
}

.woocommerce-account .rt-submit-ticket-wrapper textarea,
.woocommerce-account .reply-form textarea {
    width: 100%;
}
.rt-pagination {
    margin: 20px 0;
    text-align: center;
}

.rt-pagination .page-numbers {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
}

.rt-pagination .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.rt-pagination a:hover {
    background: #f5f5f5;
}

.rt-document-field {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    background: #f8f8f8;
}

.rt-document-field.approved {
    background: #f1f8f1;
    border: 1px solid #46b450;
}

.rt-document-field.rejected {
    background: #ffebee;
    border: 1px solid #f44336;
}

.rt-document-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-top: 5px;
}

.rt-document-status.approved {
    background-color: #46b450;
    color: white;
}

.rt-document-status.rejected {
    background-color: #f44336;
    color: white;
}

/* برای فیلدهای غیرفعال */
.rt-document-field.approved input[type="file"] {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}
.rt-document-field {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
}

.rt-document-field.approved {
    border-color: #46b450;
    background-color: #f1f8f1;
}

.rt-document-field.rejected {
    border-color: #dc3232;
    background-color: #fff8f8;
}

.rt-document-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 3px;
    margin: 5px 0;
    font-weight: bold;
}

.rt-document-status.approved {
    background: #46b450;
    color: #fff;
}

.rt-document-status.rejected {
    background: #dc3232;
    color: #fff;
}

.rt-document-field.approved input[type="file"] {
    opacity: 0.5;
    cursor: not-allowed;
}
.help-icon {
    display: inline-block;
    cursor: pointer;
    margin-right: 5px;
    color: #0073aa;
}

.rt-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.rt-modal-content {
    position: relative;
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 700px;
    background-color: #fff;
    border-radius: 5px;
}

.rt-modal-close {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 24px;
    cursor: pointer;
}

.rt-modal-body {
    padding: 20px 0;
}

.help-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.rt-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.rt-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
}

.rt-modal-close {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 24px;
    cursor: pointer;
}

.help-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

.error-message {
    color: #dc3232;
    padding: 10px;
    text-align: center;
}

.loading {
    text-align: center;
    padding: 20px;
}

/* استایل‌های اصلی فرم‌ها */
.rt-ticket-form {
    margin: 0 auto;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rt-form-row {
    margin-bottom: 15px;
    position: relative;
}

/* استایل‌های قالب فیلدها */
.field-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
}

/* استایل لیبل‌ها */
.field-container label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #2d3748;
}

/* استایل توضیحات */
.field-container .description {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

/* استایل ورودی‌ها */
.field-container input[type="text"],
.field-container input[type="email"],
.field-container input[type="number"],
.field-container textarea,
.field-container select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.4;
    transition: border-color 0.3s ease;
}

.field-container input[type="text"]:focus,
.field-container input[type="email"]:focus,
.field-container input[type="number"]:focus,
.field-container textarea:focus,
.field-container select:focus {
    border-color: #4299e1;
    outline: none;
}

/* استایل آیکن راهنما */
.help-icon {
position: absolute;
  left: -10px;
  top: 10px;
  color: #4a5568;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.3s ease;
  width: 100px;
  font-size: 16px !important;
}

.help-icon:hover {
    color: #2c5282;
}

/* استایل حالت تایید شده */
.field-container.approved {
    background-color: #f0fff4;
    border-color: #48bb78;
    opacity: 0.8;
    pointer-events: none;
}

.field-container.approved::after {
    content: "✓";
    position: absolute;
    right: -10px;
    top: -10px;
    background: #48bb78;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* استایل حالت رد شده */
.field-container.rejected {
    background-color: #fff5f5;
    border-color: #f56565;
}

/* استایل دکمه‌ها */
.rt-button {
    background: #4299e1;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.rt-button:hover {
    background: #3182ce;
}

/* استایل مودال راهنما */
.rt-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.rt-modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
}

.rt-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    font-size: 24px;
    color: #4a5568;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .rt-ticket-form {
        padding: 10px;
    }
    
    .field-container {
        padding: 10px;
    }

    .field-container input[type="text"],
    .field-container input[type="email"],
    .field-container input[type="number"],
    .field-container textarea,
    .field-container select {
        font-size: 16px;
    }
}

/* استایل‌های لیست تیکت */
.rt-ticket-list {
    margin: 0 auto;
}

.rt-tickets-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.rt-tickets-table th,
.rt-tickets-table td {
    padding: 12px;
    border: 1px solid #e2e8f0;
    text-align: right;
}

.rt-tickets-table th {
    background: #f7fafc;
    font-weight: 500;
}

/* استایل‌های نمایش تیکت */
.rt-ticket-view {
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rt-ticket-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    direction: rtl !important;
  text-align: right;
}
.rt-attachment-preview {
    position: relative;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
 }
 
 .rt-attachment-preview.approved {
    border-color: #46b450;
    background-color: #f1f8f1;
 }
 
 .rt-attachment-preview.rejected {
    border-color: #dc3232;
    background-color: #fff8f8;
 }
 
 .rt-document-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 3px;
    margin-top: 5px;
    font-weight: bold;
 }
 
 .rt-document-status.approved {
    background: #46b450;
    color: #fff;
 }
 
 .rt-document-status.rejected {
    background: #dc3232;
    color: #fff;
 }
 
 .rt-download-link {
    display: flex;
    align-items: center;
    gap: 5px;
 }
 
 .rt-download-link .dashicons {
    font-size: 20px;
 }

/* استایل برای کانتینر لیبل و آیکن راهنما */
.field-label-container {
    display: flex;
    align-items: center;
    position: relative;
}

/* استایل آیکن راهنما */
.help-icon {
    margin-right: 5px;
    margin-left: 5px;
    color: #0073aa;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
}

/* استایل مودال راهنما */
.rt-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.rt-modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 700px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.rt-modal-close {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.rt-modal-close:hover {
    color: #000;
}

.rt-modal-body {
    padding: 20px 0;
}

.help-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid #eee;
}
/* Grid layout for attachments */
.rt-attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Attachment preview container */
.rt-attachment-preview {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 150px;
    width: 100%;
}

/* Control image size within the container */
.rt-attachment-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

/* Status indicator styling */
.rt-document-status {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 400 !important;
}

/* Status colors */
.rt-document-status.approved {
    background: rgba(70, 180, 80, 0.9);
    color: white;
}

.rt-document-status.rejected {
    background: rgba(220, 50, 50, 0.9);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rt-attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .rt-attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
/* Modal overlay styles */
body.rt-modal-open {
    overflow: hidden;
}

.rt-modal {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none;
    overflow: auto;
}

.rt-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.rt-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 10;
}

.rt-modal-close:hover,
.rt-modal-close:focus {
    color: #000;
    text-decoration: none;
}

.rt-modal-body {
    padding: 20px 0;
    text-align: center;
}

.help-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    pointer-events: none; /* Prevent image dragging/saving */
}


.field-container.rt-file {
    display: inline-block;
    width: calc(50% - 10px);
    vertical-align: top;
    margin-bottom: 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .field-container.rt-file {
        width: 100%;
    }
}
.rt-reply.rt-admin-reply {
  direction: rtl !important;
  text-align: right;
  font-family: YekanBakh;
}
.rt-reply-author {
  flex-direction: row-reverse;
  font-family: YekanBakh;
}
.rt-ticket-meta {
  font-family: YekanBakh;
}

.rt-reply-form {
  text-align: right;
  direction: rtl !important;
  font-family: YekanBakh;
}
/* Document field styles for public */
.rt-document-field {
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.rt-document-field.approved {
    border-color: #46b450;
    background-color: #f0f8f0;
}

.rt-document-field.rejected {
    border-color: #dc3232;
    background-color: #fff5f5;
}

.rt-document-status {
    padding: 5px 10px;
    border-radius: 3px;
    margin: 10px 0;
    font-weight: bold;
    display: inline-block;
}

.rt-document-status.approved {
    background: #46b450;
    color: white;
}

.rt-document-status.rejected {
    background: #dc3232;
    color: white;
}

.rt-approved-notice {
    color: #46b450;
    font-style: italic;
    margin: 10px 0;
}