/* -------------------------------------------------------------------------- */
/* Force the “Open Copilot” button to remain visible at all times             */
/* -------------------------------------------------------------------------- */

.ashe-copilot-modal-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999999 !important; /* Highest z-index to stay above everything */
  /* Remove default button styles so it’s fully transparent */
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;

  /* Force it to be visible */
  opacity: 1 !important;
  pointer-events: auto !important;
  display: block !important;
  transition: none !important; /* Remove transitions if they cause flicker */
}

/* If leftover inline styles set the button to hidden, override them */
.ashe-copilot-modal-btn[style*="opacity"],
.ashe-copilot-modal-btn[style*="display"],
.ashe-copilot-modal-btn[style*="pointer-events"] {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: block !important;
}

/* OPTIONAL: Constrain the image size if you want consistent dimensions */
.ashe-copilot-modal-btn img {
  width: 25px;  /* Adjust as needed */
  height: auto; /* Maintain aspect ratio */
  display: block;
}

/* -------------------------------------------------------------------------- */
/* Remove or override any rule that hides the button when .open is added      */
/* For example: .ashe-copilot-modal.open ~ .ashe-copilot-modal-btn { ... }    */
/* Delete or comment out such rules in your code.                             */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* Copilot modal behind WordPress elements                                    */
/* -------------------------------------------------------------------------- */

.ashe-copilot-modal {
  z-index: 9992 !important; /* Keep modal behind WP elements */
  display: none;            /* Hidden by default; toggled with .open class */
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: rgba(0, 0, 0, 0.5);
}

/* Show the modal when .open is added */
.ashe-copilot-modal.open {
  display: block;
}

/* Modal content default style */
.ashe-copilot-modal-content {
  background-color: #fff;
  position: fixed;
  padding: 20px;
  border-radius: 4px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  color: #333; /* Default text color for the modal content */
}

/* -------------------------------------------------------------------------- */
/* Remove or style the media modal backdrop so it doesn't block the button    */
/* -------------------------------------------------------------------------- */

.media-modal-backdrop {
  display: none !important; /* Completely remove the WP media backdrop */
}

/* -------------------------------------------------------------------------- */
/* TinyMCE / WP Editor Rules (Optional)                                       */
/* -------------------------------------------------------------------------- */

/* Basic styling for the Classic Editor container */
#copilot_editor {
  width: 100%;
  min-height: 300px;
}

/* Customize the content area within TinyMCE */
.mce-content-body {
  font-family: Arial, sans-serif;
  font-size: 14px;
  padding: 10px;
  color: #333; /* Ensure TinyMCE body text is also darker */
}

/* WordPress inline link text field or similar UI elements */
.wp-core-ui.has-text-field {
  z-index: 999990 !important;
}

/* TinyMCE inline toolbar group above the Copilot modal */
.mce-inline-toolbar-grp,
.mce-container-body.mce-stack-layout {
  z-index: 999222 !important;
}

/* -------------------------------------------------------------------------- */
/* Copilot Modal Position Modes (Optional)                                    */
/* -------------------------------------------------------------------------- */

/* Left mode: 25% width, 100% height, aligned left (default) */
.ashe-copilot-left {
  width: 25%;
  height: 100%;
  left: 0;
  top: 0;
}

/* Right mode: 25% width, 100% height, aligned right */
.ashe-copilot-right {
  width: 25%;
  height: 100%;
  right: 0;
  top: 0;
}

/* Top mode: 100% width, 50% height, aligned at top */
.ashe-copilot-top {
  width: 100%;
  height: 50%;
  top: 0;
  left: 0;
}

/* Bottom mode: 100% width, 50% height, aligned at bottom */
.ashe-copilot-bottom {
  width: 100%;
  height: 50%;
  bottom: 0;
  left: 0;
}

/* Full screen mode: 100% width & height */
.ashe-copilot-full {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

/* Close button */
.ashe-copilot-modal-close {
  position: absolute;
  top: 25px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
}

/* Modal inner content wrapper */
.modal-inner-content {
  width: 100%;
  box-sizing: border-box;
  color: #333; /* Just in case, ensures text is #333 here too */
}

.ashe-copilot-left .modal-inner-content,
.ashe-copilot-right .modal-inner-content {
  display: block;
}

/* For top, bottom, and full screen modes, use flex to spread content if desired */
.ashe-copilot-top .modal-inner-content,
.ashe-copilot-bottom .modal-inner-content,
.ashe-copilot-full .modal-inner-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Pretty style for size selection radio group */
.ashe-copilot-size-selection {
  text-align: center;
  margin-bottom: 15px;
  color: #333;
}
.ashe-copilot-size-selection label {
  display: inline-block;
  margin: 0 8px;
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  color: #333;
}
.ashe-copilot-size-selection input[type="radio"] {
  display: none;
}
.ashe-copilot-size-selection input[type="radio"]:checked + label,
.ashe-copilot-size-selection label:hover {
  background-color: #0073aa;
  color: #fff;
}

/* Responsive inner content elements */
.ashe-copilot-modal-content .form-table,
.ashe-copilot-modal-content .form-table th,
.ashe-copilot-modal-content .form-table td,
.ashe-copilot-modal-content .ashe-copilot-size-selection {
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  color: #333;
}
.ashe-copilot-modal-content .form-table th,
.ashe-copilot-modal-content .form-table td {
  padding: 8px;
}
.ashe-copilot-modal-content input,
.ashe-copilot-modal-content select,
.ashe-copilot-modal-content textarea {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  color: #333;
}

/* Only apply this when the admin bar is present */
body.admin-bar .mce-fullscreen {
  margin-top: 32px !important; /* or 46px if you need more space */
}
#wp-copilot_editor-wrap .mce-content-body iframe {
  width: auto !important;
  max-width: 100% !important;
  display: inline-block !important;
  border: none !important;
  outline: none !important;
  color: #333;
}
/* Allow embedded videos to be inline so text can wrap beside them */
.mce-content-body iframe,
.mce-content-body .wp-video {
  display: inline-block !important;
  vertical-align: top;
  width: auto !important;
  max-width: 100% !important; /* or remove this line for no max width */
  border: none !important;
  outline: none !important;
  margin: 0 10px 10px 0;
  color: #333;
}

/* -------------------------------------------------------------------------- */
/* Copilot Post Log Styles                                                    */
/* -------------------------------------------------------------------------- */
#copilot-post-log {
  font-size: 14px;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 20px;
  color: #333;
}

#copilot-post-log h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

/* Basic table styling (overridden by the widefat-like rules below) */
#copilot-post-log table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #333;
}

/* -------------------------------------------------------------------------- */
/* Widefat-Like Table Styles (Replicates WP Admin Table Look)                 */
/* -------------------------------------------------------------------------- */

#copilot-post-log table {
  background: #fff;
  border: 1px solid #ccc;
  border-spacing: 0;
  margin-bottom: 1em;
}

#copilot-post-log thead th {
  background-color: #f9f9f9;
  border-bottom: 1px solid #ccc;
  color: #555;
  font-weight: 600;
  padding: 8px;
  text-align: left;
}

#copilot-post-log tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#copilot-post-log tbody td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  vertical-align: middle;
  color: #333;
}

#copilot-post-log a {
  color: #0073aa;
  text-decoration: none;
}

#copilot-post-log a:hover {
  color: #005177;
  text-decoration: underline;
}

/* -------------------------------------------------------------------------- */
/* Responsive Adjustments for Copilot Modal and Post Log                      */
/* -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  .ashe-copilot-modal-content {
    width: 90% !important;
    left: 5% !important;
    top: 5% !important;
    right: 5% !important;
    bottom: auto !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Accordion Styles                                                           */
/* -------------------------------------------------------------------------- */

.copilot-accordion {
  margin-top: 20px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
  color: #333;
}

.accordion-section {
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  color: #333;
}

.accordion-toggle {
  width: 100%;
  background-color: #f7f7f7;
  border: none;
  outline: none;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-radius: 4px;
  margin: 0;
  color: #333;
}

.accordion-toggle:hover {
  background-color: #eee;
}

.accordion-content {
  display: none; /* Hidden by default */
  padding: 10px 0;
  animation: fadeIn 0.3s ease;
  color: #333;
  overflow-x: auto; /* Ensure content can scroll horizontally if needed */
}

.accordion-toggle.open {
  background-color: #0073aa; /* WP admin blue, or pick your color */
  color: #fff;
}

/* A subtle fade-in animation */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* -------------------------------------------------------------------------- */
/* Copilot Comments Table Styles                                              */
/* -------------------------------------------------------------------------- */

#copilot-comments {
  max-width: 100%;
  overflow-x: auto; /* Allows horizontal scrolling if the table is too wide */
}

.copilot-comments-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ccc;
  background-color: #fff;
  font-size: 13px;
  color: #333; /* Make sure text is darker */
}

.copilot-comments-table thead th {
  background-color: #f9f9f9;
  border-bottom: 1px solid #ccc;
  padding: 8px;
  font-weight: 600;
  color: #555; /* Slightly lighter for the header, but still visible */
}

.copilot-comments-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.copilot-comments-table td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  color: #333;
}
.ashe-copilot-user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.ashe-copilot-user-info img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    margin-right: 10px;
}
.ashe-copilot-user-info span {
    font-size: 16px;
    color: #333;
}
/* -------------------------------------------------------------------------- */
/* ACL Credit Activity Styles                                                 */
/* -------------------------------------------------------------------------- */

/* Container styling */
.acl-credit-activity {
  font-size: 14px;
  color: #333;
  background: #fff;
  border: 1px solid #ccc;
  padding: 10px;
  margin-top: 10px;
  border-radius: 4px;
}

/* Optional heading style within the container */
.acl-credit-activity h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #23282d; /* WP admin heading color */
}

/* If there's a table inside .acl-credit-activity, style it like a WP admin table */
.acl-credit-activity table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: 14px;
  color: #333;
}

.acl-credit-activity thead th {
  background: #f9f9f9;
  border-bottom: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  font-weight: 600;
  color: #555;
}

.acl-credit-activity tbody tr:nth-child(even) {
  background: #f9f9f9; /* Subtle striping */
}

.acl-credit-activity tbody td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  vertical-align: middle;
}