/**
 * استایل‌های مدیریت UltimateMember Custom Fields Manager
 */

/* استایل‌های عمومی */
.umcfm-users-list,
.umcfm-user-edit,
.umcfm-settings,
.umcfm-export-import {
    direction: rtl;
}

/* لودینگ */
.umcfm-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.umcfm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: umcfm-spin 1s linear infinite;
}

@keyframes umcfm-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* جدول کاربران */
.umcfm-users-list .wp-list-table {
    margin-top: 20px;
}

.umcfm-users-list .wp-list-table th,
.umcfm-users-list .wp-list-table td {
    padding: 12px 10px;
}

.umcfm-users-list .wp-list-table img {
    vertical-align: middle;
    border-radius: 4px;
}

.umcfm-users-list .button-small {
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.5;
    height: auto;
}

/* دکمه حذف */
.umcfm-delete-user {
    color: #d63638;
    border-color: #d63638;
}

.umcfm-delete-user:hover {
    color: #fff;
    background: #d63638;
    border-color: #d63638;
}

/* نوار ابزار */
.umcfm-toolbar {
    background: #fff;
    padding: 15px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.umcfm-search-box {
    flex: 1;
    min-width: 250px;
}

.umcfm-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* صفحه ویرایش کاربر */
.umcfm-edit-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.umcfm-edit-main {
    flex: 1;
    min-width: 0;
}

.umcfm-edit-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.umcfm-user-info {
    padding: 15px 0;
}

.umcfm-user-info p {
    margin: 0 0 15px 0;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 4px;
    font-size: 13px;
}

.umcfm-user-info p strong {
    display: block;
    margin-bottom: 5px;
    color: #1d2327;
}

.umcfm-submit-actions {
    margin: 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #dcdcde;
}

.umcfm-submit-actions .button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

.umcfm-submit-actions .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: auto;
    padding: 8px 16px;
}

.umcfm-other-actions {
    padding-top: 15px;
}

.umcfm-other-actions .button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

/* فیلدهای فایل و تصویر */
.umcfm-file-field {
    position: relative;
}

.umcfm-file-preview {
    margin-top: 15px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.umcfm-file-preview img {
    max-width: 150px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.umcfm-file-preview a {
    text-decoration: none;
}

.umcfm-remove-file {
    color: #d63638;
    border-color: #d63638;
    margin-right: auto;
}

.umcfm-remove-file:hover {
    background: #d63638;
    color: #fff;
}

/* تنظیمات */
.umcfm-settings .nav-tab-wrapper {
    margin: 20px 0;
    border-bottom: 1px solid #c3c4c7;
}

.umcfm-settings .tab-content {
    background: #fff;
    border: 1px solid #c3c4c7;
    padding: 30px;
    margin-top: 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.umcfm-settings .form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
}

.umcfm-settings .form-table td {
    padding: 15px 10px;
}

/* صفحه خروجی/ورودی */
.umcfm-export-import-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.umcfm-section {
    min-width: 0;
}

.postbox-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.postbox-header h2 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* علامت الزامی */
.required {
    color: #d63638;
    font-weight: bold;
}

/* اعلان‌ها */
.notice.inline {
    margin: 0 0 20px 0;
    padding: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
    .umcfm-edit-container {
        flex-direction: column;
    }
    
    .umcfm-edit-sidebar {
        width: 100%;
    }
}

@media (max-width: 782px) {
    .umcfm-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .umcfm-search-box,
    .umcfm-actions {
        width: 100%;
    }
    
    .umcfm-actions {
        flex-direction: column;
    }
    
    .umcfm-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    .umcfm-export-import-container {
        grid-template-columns: 1fr;
    }
    
    .umcfm-file-preview {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .umcfm-remove-file {
        margin-right: 0;
    }
}

@media (max-width: 600px) {
    .umcfm-users-list .wp-list-table {
        font-size: 13px;
    }
    
    .umcfm-users-list .button-small {
        padding: 3px 8px;
        font-size: 12px;
    }
}

/* دکمه‌ها با آیکون */
.button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-top: 4px;
    vertical-align: top;
}

/* انیمیشن ذخیره */
.umcfm-saving {
    position: relative;
}

.umcfm-saving::after {
    content: '...';
    animation: umcfm-dots 1.5s infinite;
}

@keyframes umcfm-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* وضعیت موفقیت */
.umcfm-success {
    color: #00a32a;
}

.umcfm-success::before {
    content: '✓';
    margin-left: 5px;
}

/* وضعیت خطا */
.umcfm-error {
    color: #d63638;
}

.umcfm-error::before {
    content: '✗';
    margin-left: 5px;
}

/* بهبود ظاهر فرم‌ها */
.umcfm-user-edit input[type="text"],
.umcfm-user-edit input[type="email"],
.umcfm-user-edit input[type="url"],
.umcfm-user-edit input[type="number"],
.umcfm-user-edit input[type="date"],
.umcfm-user-edit input[type="password"],
.umcfm-user-edit textarea,
.umcfm-user-edit select {
    font-size: 14px;
    padding: 8px 12px;
}

.umcfm-user-edit .form-table th {
    padding-top: 20px;
    vertical-align: top;
}

.umcfm-user-edit .form-table td {
    padding-top: 15px;
}

/* چک‌باکس و رادیو */
.umcfm-user-edit input[type="checkbox"],
.umcfm-user-edit input[type="radio"] {
    margin-left: 5px;
}

/* فونت فارسی */
body.rtl .umcfm-users-list,
body.rtl .umcfm-user-edit,
body.rtl .umcfm-settings,
body.rtl .umcfm-export-import {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* بهبود ظاهر جداول */
.wp-list-table.widefat th {
    font-weight: 600;
}

.wp-list-table.widefat code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* سایه برای پست‌باکس‌ها */
.postbox {
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* پیام‌های توجه */
.notice-warning.inline {
    background: #fcf9e8;
    border-right-color: #f0b849;
}

/* دکمه‌های اصلی */
.button-primary {
    background: #2271b1;
    border-color: #2271b1;
}

.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

/* بهبود Accessibility */
.umcfm-users-list a:focus,
.umcfm-user-edit a:focus,
.umcfm-settings a:focus {
    box-shadow: 0 0 0 2px #2271b1;
    outline: 2px solid transparent;
}

.umcfm-users-list button:focus,
.umcfm-user-edit button:focus,
.umcfm-settings button:focus {
    box-shadow: 0 0 0 2px #2271b1;
    outline: 2px solid transparent;
}

/* استایل‌های وضعیت تایید */
.umcfm-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.umcfm-status-approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.umcfm-status-unapproved {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.umcfm-status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.umcfm-status-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.umcfm-status-inactive {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.umcfm-status-actions {
    margin-right: 8px;
}

.umcfm-status-action {
    font-size: 12px;
    text-decoration: none;
    margin-left: 5px;
}

.umcfm-status-action:hover {
    text-decoration: underline;
}

.umcfm-status-actions-box {
    margin: 20px 0;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    border-top: 2px solid #dcdcde;
}

.umcfm-status-actions-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
}

.umcfm-status-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.umcfm-status-buttons .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    text-align: center;
}

.umcfm-status-buttons .umcfm-approve {
    background: #00a32a;
    border-color: #00a32a;
    color: #fff;
}

.umcfm-status-buttons .umcfm-approve:hover {
    background: #008a20;
    border-color: #008a20;
}

.umcfm-status-buttons .umcfm-reject {
    background: #d63638;
    border-color: #d63638;
    color: #fff;
}

.umcfm-status-buttons .umcfm-reject:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

.umcfm-status-buttons .umcfm-inactive {
    background: #646970;
    border-color: #646970;
    color: #fff;
}

.umcfm-status-buttons .umcfm-inactive:hover {
    background: #50575e;
    border-color: #50575e;
}

/* استایل‌های صفحه فراموشی رمز عبور (Frontend) */
.umcfm-password-reset-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
    direction: rtl;
}

.umcfm-reset-form-wrap {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.umcfm-reset-form-wrap h2 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    color: #1d2327;
}

.umcfm-form-group {
    margin-bottom: 20px;
}

.umcfm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
}

.umcfm-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.umcfm-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.umcfm-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    margin-bottom: 0;
}

.umcfm-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.umcfm-button-primary {
    background: #2271b1;
    color: #fff;
}

.umcfm-button-primary:hover {
    background: #135e96;
}

.umcfm-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.umcfm-link-button {
    background: none;
    border: none;
    color: #2271b1;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-top: 10px;
    font-size: 12px;
}

.umcfm-link-button:hover {
    color: #135e96;
}

.umcfm-messages {
    margin-top: 20px;
}

.umcfm-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.umcfm-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.umcfm-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

