/* Admin switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}
.switch input {display: none;}
.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 25px;
  top: 0; left: 0; right: 0; bottom: 0;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 19px; width: 19px;
  left: 3px; bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}
input:checked + .slider {
  background-color: #4caf50;
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* Frontend alert styles */
.wpam-alerts {
  margin: 0 10px;
  padding: 0;
}

.wpam-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 5px;
  padding: 10px 14px;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 500;
  font-size: 15px;
}

.wpam-icon {
  font-size: 18px;
  line-height: 1;
}

.wpam-message {
  display: inline-block;
  margin: 0;
}
.wpam-success { background-color: #4caf50; }
.wpam-error { background-color: #f44336; }
.wpam-warning { background-color: #ff9800; }
.wpam-info { background-color: #2196f3; }
.wpam-alert p{
  color: #fff !important;
}
/* Modal Styles */
#wpam-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 80px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.wpam-modal-content {
  background-color: #fff;
  margin: auto;
  padding: 20px 30px;
  border-radius: 10px;
  width: 60%;
  box-shadow: 0 0 10px rgba(0,0,0,0.25);
  position: relative;
}
.wpam-close {
  color: #aaa;
  position: absolute;
  top: 10px; right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.wpam-close:hover { color: #000; }
.wpam-type {
  display: inline-block;
  padding: 2px 10px 2px 5px;
  border-radius: 10px;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
  font-size: 8px;
}
.wpam-status {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 8px;
  color: #fff;
  text-transform: capitalize;
}

.wpam-active {
  background-color: #4caf50; /* Green */
}

.wpam-inactive {
  background-color: #9e9e9e; /* Grey */
}

.wpam-icon{
  vertical-align: middle;
  margin-right: 5px;
  font-size: 16px;
  line-height: 1;
}

.wpam-type .dashicons {
  /*vertical-align: middle;
  margin-right: 5px;
  font-size: 16px;
  line-height: 1;*/
  font-size: 11px;
  line-height: 1.7;
}

/* Make frontend icons a bit larger */
.wpam-alert .dashicons {
  font-size: 20px;
  vertical-align: middle;
  margin-right: 6px;
}
/* sort */

.wpam-drag-handle {
  cursor: move;
  text-align: center;
  color: #777;
}

.wpam-drag-handle .dashicons {
  font-size: 18px;
  vertical-align: middle;
}

.wpam-row-placeholder {
  height: 40px;
  background: #f0f0f0;
  border: 2px dashed #ccc;
}
.wpam-toast {
  position: fixed;
  top: 50px;
  right: 20px;
  background: #0073aa;
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 9999;
}
.wpam-toast.show {
  opacity: 1;
  transform: translateY(0);
}
/* --- Floating Tooltip Styles --- */
.wpam-title-cell {
  position: relative;
}

.wpam-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: block;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.wpam-tooltip.active {
  opacity: 1;
  transform: translateY(0);
}

.wpam-tooltip .wpam-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 220px;
  max-width: 300px;
  white-space: normal; /* allow wrapping */
  line-height: 1.4;
}
.wpam-tooltip .wpam-message p {
  margin: 0;
}

.wpam-tooltip .wpam-message a {
  color: #fff;
  text-decoration: underline;
}
.wpam-tooltip .dashicons {
  font-size: 16px;
}

/* Colors (reuse your existing palette) */
.wpam-success { background-color: #4caf50; }
.wpam-error { background-color: #f44336; }
.wpam-warning { background-color: #ff9800; }
.wpam-info { background-color: #2196f3; }


/* Visibility Radio Button Styling */
.wpam-visibility-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0;
}

.wpam-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

.wpam-radio:hover {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.15);
}

.wpam-radio input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #777;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.wpam-radio input[type="radio"]:checked {
    border-color: #007cba;
}

.wpam-radio input[type="radio"]:checked::after {
    content: "";
    width: 8px;
    height: 8px;
    background: #007cba;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
}

.wpam-radio-label {
    font-size: 14px;
    color: #333;
}


#wpam-modal .wpam-save-button {
    font-size: 16px !important;
    padding: 12px 28px !important;
    display: inline-block;
    float: right;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 6px !important;
}

#wpam-modal .wpam-save-button:hover {
    opacity: 0.95;
}


/* Modal overlay */
#wpam-modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 999999; /* ensure it's above WP admin */
    display: none;
    overflow: hidden; /* prevent body scrolling behind modal */
}

/* Modal box */
.wpam-modal-content {
    background: #fff;
    /*width: 90%;
    max-width: 700px;*/
    margin: 40px auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    max-height: 80vh;          /* 🔥 important */
    overflow-y: auto;          /* 🔥 enables scrolling */
    box-sizing: border-box;
}

/* Ensure the WordPress editor behaves well inside scrollable modal */
.wp-editor-wrap {
    max-width: 100%;
}

/* Close button styling */
.wpam-close {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
}

#wpam-editor-wrapper {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* When modal is open — place it inside modal container */
#wpam-modal.show #wpam-editor-wrapper {
    position: static;
    opacity: 1;
    pointer-events: auto;
}
