/* ============================================================================
   BULK SAVE BUTTON - Blue gradient matching approved design
   ============================================================================ */
.soad-bulk-panel {
  margin: 16px 0;
  display: inline-block;
}

#soad-save-selected {
  background: linear-gradient(135deg, #1B3A6B 0%, #2E5FA3 50%, #1a8aff 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 58, 107, 0.3);
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#soad-save-selected:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 58, 107, 0.4);
}

#soad-save-selected:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.soad-selected-count {
  margin-left: 12px;
  color: #6b7280;
  font-size: 13px;
}

/* Per-response save button */
.response-header .soad-save-draft {
  background: #f0f4ff;
  color: #1B3A6B;
  border: 1px solid #d0deff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
}

.response-header .soad-save-draft:hover {
  background: #1B3A6B;
  color: white;
}

/* ============================================================================
   MODAL STRUCTURE
   ============================================================================ */
.soad-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
}

.soad-modal.open {
  display: flex;
}

.soad-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100000;
}

.soad-modal-dialog {
  position: relative;
  z-index: 100001;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Modal Header */
.soad-modal-header {
  background: linear-gradient(135deg, #1B3A6B 0%, #2E5FA3 50%, #1a8aff 100%);
  padding: 28px 32px;
  position: relative;
}

.soad-modal-header h3 {
  margin: 0;
  color: white;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.soad-modal-header h3::before {
  content: "🦉";
  font-size: 32px;
}

.soad-modal-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.soad-modal-close:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

/* Modal Body */
.soad-modal-body {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
}

/* Form elements */
.soad-post-type-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.soad-post-type-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}

.soad-post-type-group input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

#soad-form .soad-form-row {
  margin-bottom: 20px;
}

#soad-form label {
  display: block;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
  font-size: 14px;
}

#soad-form input[type="text"],
#soad-form textarea,
#soad-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

#soad-form input:focus,
#soad-form textarea:focus,
#soad-form select:focus {
  outline: none;
  border-color: #1a8aff;
  box-shadow: 0 0 0 3px rgba(26, 138, 255, 0.1);
}

.soad-help {
  font-size: 12px;
  color: #6b7280;
  margin: 6px 0 0;
}

#soad-category-custom-wrap {
  display: none;
  margin-top: 8px;
}

#soad-category-custom-wrap.show {
  display: block;
}

/* ============================================================================
   WORDPRESS EDITOR TOOLBAR - Matching WP exactly
   ============================================================================ */
.soad-editor-wrapper {
  position: relative;
}

.soad-editor-toolbar {
  background: #f3f4f5;
  border: 1px solid #ddd;
  border-bottom: none;
  padding: 2px;
  border-radius: 3px 3px 0 0;
}

.soad-editor-toolbar .toolbar-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
}

.soad-editor-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  min-width: 24px;
  height: 26px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.soad-editor-toolbar button:hover {
  background: #fafafa;
  border-color: #ccc;
  color: #000;
}

.soad-editor-toolbar .separator {
  width: 1px;
  height: 18px;
  background: #ddd;
  margin: 0 2px;
}

.soad-editor-toolbar .add-media-btn {
  background: #f0f0f1;
  border: 1px solid #0071a1;
  color: #0071a1;
  padding: 4px 10px;
  font-weight: 600;
  font-size: 12px;
  height: 28px;
  margin-right: 8px;
}

.soad-editor-toolbar .add-media-btn:hover {
  background: #0071a1;
  color: white;
}

#soad-content {
  border-radius: 0 0 3px 3px !important;
  border-top: none !important;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  min-height: 200px;
}

/* Tags */
.soad-tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  min-height: 34px;
}

.soad-tags-display:empty {
  display: none;
}

.soad-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f4ff;
  border: 1px solid #d0deff;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 13px;
  color: #1B3A6B;
}

.soad-tag-remove {
  background: none;
  border: none;
  color: #1B3A6B;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.soad-tag-remove:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

/* Yoast */
.soad-yoast-section {
  background: #f0f4ff;
  border: 1px solid #d0deff;
  border-radius: 6px;
  padding: 16px;
  margin: 20px 0 0;
}

.soad-yoast-section h4 {
  margin: 0 0 16px 0;
  color: #1B3A6B;
  font-size: 14px;
  font-weight: 600;
}

/* Modal Footer */
.soad-modal-footer {
  padding: 20px 32px;
  background: #f8f9fc;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.soad-btn {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.soad-btn-primary {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.soad-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

.soad-btn-secondary {
  background: white;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.soad-btn-secondary:hover {
  background: #f9fafb;
}

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

/* Settings */
.soad-settings-wrapper h2 {
  color: #1B3A6B;
  font-size: 24px;
  font-weight: 700;
}

.soad-settings-wrapper #submit {
  background: linear-gradient(135deg, #1B3A6B 0%, #2E5FA3 50%, #1a8aff 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 58, 107, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .soad-modal-dialog {
    width: 95%;
  }
  
  .soad-modal-header,
  .soad-modal-body,
  .soad-modal-footer {
    padding: 20px;
  }
  
  .soad-post-type-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .soad-modal-footer {
    flex-direction: column-reverse;
  }
  
  .soad-btn {
    width: 100%;
  }
}
