/* ============================================
   WORDPRESS METABOX OVERRIDES
   Hide default WordPress metabox chrome
   ============================================ */
#sideconvo_sync.postbox {
  border: none;
  background: transparent;
  box-shadow: none;
}

#sideconvo_sync .postbox-header {
  display: none !important;
}

#sideconvo_sync .inside {
  margin: 0;
  padding: 0;
}

#sideconvo_sync .handlediv,
#sideconvo_sync .handle-actions {
  display: none !important;
}

/* ============================================
   WP SIDEBAR PANEL – base styles
   Mimics the Gutenberg editor sidebar panel
   ============================================ */
.wp-panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
  font-size: 13px;
  color: #1e1e1e;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Panel header (collapsible toggle) */
.wp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  user-select: none;
}

.wp-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e1e1e;
}

.wp-panel-toggles {
  display: flex;
  gap: 2px;
}

.wp-panel-toggle-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #757575;
  border: none;
  background: none;
  cursor: default;
  border-radius: 2px;
  transition: color 0.15s, background 0.15s;
}

.wp-panel-toggle-btn:hover {
  color: #1e1e1e;
  background: #f0f0f0;
}

/* Panel body */
.wp-panel-body {
  padding: 16px;
}

/* ============================================
   STATUS BADGE
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Synced – green */
.status-badge.synced {
  background: #edf7ed;
  color: #1a7a1a;
  border: 1px solid #c6e6c6;
}

.status-badge.synced::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ea043;
}

/* Excluded – neutral gray */
.status-badge.excluded {
  background: #f0f0f0;
  color: #616161;
  border: 1px solid #dcdcdc;
}

.status-badge.excluded::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9e9e9e;
}

/* Stale – amber/warning */
.status-badge.stale {
  background: #fef6e7;
  color: #8a6116;
  border: 1px solid #f0d68a;
}

.status-badge.stale::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4a017;
}

/* Draft – blue/info */
.status-badge.draft {
  background: #e8f0fe;
  color: #1a56db;
  border: 1px solid #b6d4fe;
}

.status-badge.draft::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
}

/* Failed – red/danger */
.status-badge.failed {
  background: #fdecea;
  color: #b91c1c;
  border: 1px solid #f5c6c6;
}

.status-badge.failed::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dc2626;
}

/* Queued – blue/info */
.status-badge.queued {
  background: #e8f0fe;
  color: #1a56db;
  border: 1px solid #b6d4fe;
}

.status-badge.queued::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
}

/* ============================================
   INFO MESSAGE BOX
   ============================================ */
.info-box {
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #50575e;
  margin-bottom: 14px;
  border-left: 3px solid;
}

.info-box.synced {
  background: #f6fbf6;
  border-color: #2ea043;
}

.info-box.excluded {
  background: #f7f7f7;
  border-color: #9e9e9e;
}

.info-box.stale {
  background: #fffbf0;
  border-color: #d4a017;
}

.info-box.draft {
  background: #f5f8ff;
  border-color: #3b82f6;
}

.info-box.failed {
  background: #fff5f5;
  border-color: #dc2626;
}

.info-box.queued {
  background: #f5f8ff;
  border-color: #3b82f6;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-btn {
  display: inline-block;
  padding: 7px 16px;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-align: center;
}

.action-btn:hover {
  opacity: 0.9;
}

.action-btn:active {
  transform: scale(0.98);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Add (Excluded) – Sideconvo branded blue */
.action-btn.add {
  background: #2271b1;
  color: #fff;
}

/* Fix (Stale) – blue action */
.action-btn.fix {
  background: #2271b1;
  color: #fff;
}

/* Remove outline button */
.action-btn.outline-remove {
  background: transparent;
  color: #d63638;
  border: 1px solid #d63638;
}

/* Text button for inline actions */
.text-btn {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 0;
  line-height: 1;
  transition: opacity 0.15s;
  color: #2271b1;
}

.text-btn:hover {
  opacity: 0.7;
}

.text-btn.remove {
  color: #d63638;
}

.text-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button container for multiple actions */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   DETAIL LIST (optional metadata)
   ============================================ */
.detail-section {
  margin-bottom: 14px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row-label {
  color: #757575;
}

.detail-row-value {
  color: #1e1e1e;
  font-weight: 500;
}

/* ============================================
   EXPIRY DATE SECTION
   ============================================ */
.expiry-section {
  margin-top: 14px;
  margin-bottom: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.expiry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.expiry-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #757575;
}

.expiry-clear-link {
  font-size: 11px;
  color: #d63638;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  line-height: 1;
}

.expiry-clear-link:hover {
  opacity: 0.7;
}

.expiry-clear-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.expiry-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.expiry-date-input {
  flex: 1;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  font-size: 12px;
  color: #1e1e1e;
  background: #fff;
  min-width: 0;
}

.expiry-date-input:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.expiry-save-btn {
  padding: 5px 10px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.expiry-current {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: #616161;
  font-style: italic;
}

/* Loading spinner */
.sideconvo-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2271b1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}