/* === Utility / Hidden === */
.modal__core-wp-2_safe,
.hidden__core-wp-2_safe {
  display: none;
}

.hidden__core-wp-2_safe {
  display: none !important;
}

#plhnbk1 {
  background-color: inherit;
  width: 0 !important;
  height: 0 !important;
  cursor: pointer !important;
}

/* === Global Modal Base === */
.modal__core-wp-2_safe.is-open {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal__core-wp-2_safe__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__core-wp-2_safe__container {
  background: #fff;
  width: 60%;
  padding: 0;
  border-radius: 8px;
  text-align: right;
}

.modal__core-wp-2_safe__content {
  background: #fff;
  width: 100%;
  max-height: 90vh;
  overflow-y: hidden;
  border-radius: 8px;
  padding: 20px;
  text-align: center !important;
}

.modal__core-wp-2_safe__footer {
  margin: 20px;
}

.modal__core-wp-2_safe__close {
  background: none;
  border: none;
  float: left;
  font-size: 1.2rem;
  cursor: pointer;
}

/* === Modal Inner Components === */
.modal__core-wp-2_safe__content .fa-spinner {
  display: block;
  font-size: 30px;
  color: gray;
  text-align: center;
  padding: 20px;
}

.modal__core-wp-2_safe__content .core-wp-2-modal-container {
  padding: 20px;
  max-width: 400px;
  margin: 10% auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.modal__core-wp-2_safe__content .core-wp-2-modal-title {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: bold;
}

.modal__core-wp-2_safe__content .core-wp-2-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

/* === Shared Button Styles === */
.modal__core-wp-2_safe__content .btn-confirm,
.modal__core-wp-2_safe__content .btn-cancel,
#core-wp-2-secure-question-modal #modal-buttons button,
.core-wp-2-auth-form-buttons button,
#core-wp-2-secure-messages-send-form button[type="submit"],
#core-wp-2-secure-chat-form button,
.custom-file-upload-label {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  margin: auto;
}

.modal__core-wp-2_safe__content .btn-confirm,
#core-wp-2-secure-question-modal #core-wp-2-secure-btn-yes-destroy,
#core-wp-2_auth_secure_attempt,
#core-wp-2-secure-messages-send-form button[type="submit"] {
  background-color: #28a745;
  color: white;
  width: max-content;
  margin: auto;
}

.modal__core-wp-2_safe__content .btn-cancel,
#core-wp-2-secure-question-modal #core-wp-2-secure-btn-no-destroy,
.core-wp-2-auth-btn-cancel {
  background-color: #dc3545;
  color: white;
  border: 0;
}

.core-wp-2-auth-btn-cancel,
#core-wp-2-secure-captcha-submit-destroy {
  background-color: #6c757d !important;
  border: 0;
}

/* Hover states */
.modal__core-wp-2_safe__content .btn-confirm:hover,
#core-wp-2-secure-question-modal #core-wp-2-secure-btn-yes-destroy:hover,
#core-wp-2_auth_secure_attempt:hover,
#core-wp-2-secure-messages-send-form button[type="submit"]:hover {
  background-color: #218838;
}

.modal__core-wp-2_safe__content .btn-cancel:hover,
#core-wp-2-secure-question-modal #core-wp-2-secure-btn-no-destroy:hover {
  background-color: #c82333;
}

.core-wp-2-auth-btn-cancel:hover,
#core-wp-2-secure-captcha-submit-destroy:hover {
  background-color: #5a6268 !important;
}

/* Disabled state */
.modal__core-wp-2_safe__content .btn-confirm:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* === Question Modal === */
#core-wp-2-secure-question-modal #modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#core-wp-2-secure-question-modal #modal-box {
  background: #fff;
  width: 90%;
  max-width: 400px;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
}

#core-wp-2-secure-question-modal #modal-box h2 {
  margin-bottom: 15px;
  font-size: 20px;
  color: #333;
}

#core-wp-2-secure-question-modal #modal-box p {
  margin-bottom: 25px;
  font-size: 16px;
  color: #666;
}

#core-wp-2-secure-question-modal #modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

#core-wp-2-secure-question-modal #close-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px 20px;
  background: #8bc34a;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

#core-wp-2-secure-question-modal #close-button:hover {
  background: #7cb342;
}

/* === Login & Captcha === */
.login-box,
#modal__core-wp-2_safe_catpcha {
  max-width: 400px;
  margin: 40px auto;
  padding: 20px 30px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  font-family: sans-serif;
  text-align: center;
}

#modal__core-wp-2_safe_catpcha {
  margin: 30px auto;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.login-box label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.login-box input[type="text"],
.login-box input[type="password"],
#core-wp-2-captcha-input,
#core-wp2-security_destroy,
#core-wp-2-secure-messages-duration,
#core-wp-2-secure-messages-room_pass_key {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

#core-wp-2-captcha-input,
#core-wp2-security_destroy {
  margin-top: 10px;
  margin-bottom: 0;
  text-align: center;
}

.login-box button,
#core-wp-2-secure-captcha-submit,
#core-wp-2-secure-captcha-submit-destroy {
  width: 100%;
  padding: 10px;
  font-size: 16px;
}

#core-wp-2-secure-captcha-submit {
  background: #007bff;
  color: white;
  margin: 10px auto;
  padding: 6px;
  border: 0;
}

#core-wp-2-secure-captcha-submit:hover {
  background: #0056b3;
}

#core-wp-2-secure-captcha-submit-destroy {
  display: none;
}

#core-wp-2-login-message {
  margin-top: 15px;
  color: #d9534f;
  text-align: center;
  font-size: 14px;
}

#modal__core-wp-2_safe_catpcha img {
  display: block;
  margin: 0 auto 20px;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

#core-wp-2-captcha-error {
  margin-top: 8px;
  color: #e63946;
  font-size: 13px;
}

#modal__core-wp-2_safe_catpcha hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #eee;
}

/* === Auth Form Buttons === */
.core-wp-2-auth-form-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.core-wp-2-auth-form-buttons button {
  flex: 1;
  color: white;
}

/* === Tabs & Filters === */
.core-wp-2-messages-tabs {
  float: left !important;
}

.core-wp-2-secure-filter-tabs-selector {
  float: right;
  display: inline-block;
  position: relative;
}

.core-wp-2-secure-filter-tabs-selector button {
  float: left;
  padding: 0 10px;
  margin: 5px;
  height: 40px;
  min-width: 65px;
  box-sizing: border-box;
  background: white;
  font-size: 13px;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.8);
  border: none;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, 0.2),
    1px 1px 3px rgba(0, 0, 0, 0.3);
  border-radius: 20px !important;
}

.core-wp-2-secure-filter-tabs-selector button:only-of-type {
  border-radius: 5px;
}

.core-wp-2-secure-filter-tabs-selector button:hover {
  color: #13c5c7;
  text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.5);
  transition: all 0.1s linear;
  cursor: pointer;
}

.core-wp-2-secure-filter-tabs-selector button.active {
  background-color: #09626c !important;
  color: white !important;
  border: 1px solid gray !important;
}

.core-wp-2-secure-messages-filters-tab-btn {
  padding: 10px 20px;
  border: 1px solid #ccc;
  background: white;
  color: black;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
}

.core-wp-2-secure-messages-filters-tab-btn.active {
  background: green;
  color: white;
}

#core-wp-2-secure-messages-index .core-wp-2-secure-messages-tab-btn {
  flex: 1;
  cursor: pointer !important;
}

#core-wp-2-secure-messages-index .core-wp-2-secure-messages-tab-btn.active {
  background: #009688 !important;
  color: white !important;
  border: 0 !important;
}

/* === Inbox Table === */
#core-wp-2-secure-messages-tab-inbox table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

#core-wp-2-secure-messages-tab-inbox thead {
  background: #5aa5e4;
  color: white;
}

#core-wp-2-secure-messages-tab-inbox thead tr td:first-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

#core-wp-2-secure-messages-tab-inbox thead tr td:last-child,
#core-wp-2-secure-messages-tab-inbox tbody tr td:last-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

#core-wp-2-secure-messages-tab-inbox tbody tr td:first-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

#core-wp-2-secure-messages-tab-inbox .btn-view-message {
  width: max-content !important;
  background: #8b87c8;
  border: 0;
  padding: 9px;
  font-size: 15px;
  border-radius: 10%;
  cursor: pointer !important;
}

/* === Pagination === */
.core-wp-2-secure-messages-pagination {
  margin: 20px 0 35px;
  text-align: center;
}

.core-wp-2-secure-messages-pagination-btn {
  margin: 0 3px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #f3f3f3;
  cursor: pointer;
  color: black;
}

.core-wp-2-secure-messages-pagination-btn.active {
  background: #0073aa;
  color: white;
  border: 1px solid gray !important;
}

/* === Message Box & General Table === */
.core-wp-2-messages-box {
  min-height: 390px;
}

.table-container-core-wp-2 {
  max-width: 100%;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow-x: visible;
}

.styled-table-core-wp-2 {
  width: 100%;
  border-collapse: collapse;
  font-family: "Vazirmatn", sans-serif;
  direction: rtl;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.styled-table-core-wp-2 thead {
  background: #4f46e5;
  color: white;
}

.styled-table-core-wp-2 th,
.styled-table-core-wp-2 td {
  padding: 14px 20px;
  text-align: center;
  font-size: 15px;
}

.styled-table-core-wp-2 tbody tr:nth-child(even) {
  background: #f3f4f6;
}

.styled-table-core-wp-2 tbody tr:hover {
  background: #e0e7ff;
  transition: background-color 0.3s ease;
}

.styled-table-core-wp-2 a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: bold;
}

.styled-table-core-wp-2 a:hover {
  text-decoration: underline;
}

/* === Send Message Form === */
#core-wp-2-secure-messages-tab-send,
#core-wp-2-secure-messages-tab-chat {
  display: block;
  width: 100%;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

#core-wp-2-secure-messages-send-form,
#core-wp-2-secure-chat-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 700px;
  margin: 5% auto;
}

#core-wp-2-secure-chat-form {
  margin-top: 100px;
}

#core-wp-2-secure-messages-msg-text,
#core-wp-2-secure-messages-duration,
#core-wp-2-secure-messages-room_pass_key {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#core-wp-2-secure-messages-msg-text {
  min-height: 140px;
  resize: vertical;
  padding: 0.75rem 1rem;
  line-height: 1.5;
}

#core-wp-2-secure-messages-duration,
#core-wp-2-secure-messages-room_pass_key {
  max-width: 270px;
  height: 50px;
  padding: 0.6rem 0.75rem;
  margin: auto;
}

#core-wp-2-secure-messages-duration {
  max-width: 270px;
}

#core-wp-2-secure-messages-msg-text:focus,
#core-wp-2-secure-messages-duration:focus,
#core-wp-2-secure-messages-room_pass_key:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.message-duration-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  max-width: 270px;
  margin: auto;
}

.message-duration-wrapper label {
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.message-duration-wrapper label small {
  font-weight: normal;
  font-size: 0.85rem;
  color: #6b7280;
}

/* === File Upload === */
.custom-file-upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.custom-file-upload-label {
  background: #2563eb;
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 13px;
  transition: background 0.2s ease;
  margin: auto;
}

.custom-file-upload-label:hover {
  background: #1d4ed8;
}

#core-wp-2-secure-messages-files {
  display: none;
}

.file-preview-list {
  list-style: none;
  margin-top: 0.75rem;
  padding: 0;
  width: 100%;
}

.file-preview-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.remove-file-wp-v2-btn {
  background: none;
  border: none;
  color: #d00;
  padding: 10px;
  margin: 0;
  width: max-content;
}

.remove-file-wp-v2-btn:hover {
  color: #a00;
  background: white;
}

/* === Toasts === */
.notyf__toast {
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  max-width: 350px !important;
  width: auto !important;
}

.notyf__message {
  white-space: normal !important;
  text-align: left !important;
  padding: 0 12px !important;
}

.notyf__toast + .notyf__toast {
  margin-top: 12px;
}

/* === Table Cleanup === */
.core-wp-2-messages-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
}

.core-wp-2-messages-table th,
.core-wp-2-messages-table td {
  border: none !important;
  padding: 8px;
  text-align: center !important;
  box-shadow: none !important;
}

.core-wp-2-messages-table .btn-view-message {
  background: none;
  border: none;
  cursor: pointer;
}

/* === Responsive === */
@media (max-width: 600px) {
  .core-wp-2-secure-messages-tab-btn {
    flex: 1 1 100%;
    margin-bottom: 5px;
  }

  .modal__core-wp-2_safe__container {
    width: 100%;
  }

  .core-wp-2-messages-box {
    padding: 15px;
  }

  .styled-table-core-wp-2 th,
  .styled-table-core-wp-2 td {
    font-size: 0.9rem;
    padding: 6px;
  }

  .message-duration-wrapper {
    width: 100%;
  }

  #core-wp-2-secure-messages-duration {
    max-width: 100%;
  }

  #core-wp-2-secure-messages-send-form {
    padding: 0.5rem;
  }

  .custom-file-upload-label,
  #core-wp-2-secure-messages-send-form button[type="submit"] {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 490px) {
  .modal__core-wp-2_safe__content {
    padding: 15px;
    max-width: 95%;
    max-height: 85vh;
    border-radius: 6px;
  }

  .core-wp-2-messages-tabs,
  .core-wp-2-secure-filter-tabs-selector {
    float: none !important;
  }
}