/* Modal ACF Fields Comparison */
.acf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  animation: fadeIn 0.3s ease;
}

.acf-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.acf-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.acf-modal-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.acf-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 8px;
}

.acf-modal-keyword {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-size: 13px;
  margin-left: auto;
  margin-right: 12px;
}

.acf-modal-keyword .keyword-label {
  color: #6c757d;
  font-weight: 500;
  font-size: 12px;
}

.acf-modal-keyword .keyword-value {
  color: #212529;
  font-weight: 600;
  background: #f8f9fa;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.acf-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
  line-height: 1;
}

.acf-modal-close:hover {
  color: #dc3545;
  transform: rotate(90deg);
}

/* Modal Body */
.acf-modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* Accordion Container */
.acf-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Accordion Item */
.acf-accordion-item {
  background: rgba(248, 249, 250, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.acf-accordion-item.active {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 123, 255, 0.2);
}

/* Accordion Header */
.acf-accordion-header {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
}

.acf-accordion-header:hover {
  background: rgba(255, 255, 255, 0.95);
}

.acf-field-name {
  font-weight: 500;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 8px;
}

.acf-field-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.acf-field-status.pending {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.acf-field-status.modified {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}

.acf-field-status.accepted {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.acf-field-status.rejected {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.acf-accordion-arrow {
  font-size: 12px;
  color: #6c757d;
  transition: transform 0.3s ease;
}

.acf-accordion-item.active .acf-accordion-arrow {
  transform: rotate(180deg);
}

/* Accordion Content */
.acf-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.acf-accordion-item.active .acf-accordion-content {
  max-height: 800px;
}

.acf-comparison-wrapper {
  padding: 12px;
  display: flex;
  gap: 12px;
  height: 500px;
  overflow: hidden;
}

/* Field Comparison Columns */
.acf-field-column {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  padding: 12px;
  position: relative;
  flex: 1;
  width: 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.acf-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

/* Bouton toggle view */
.acf-toggle-view {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
  border: 1px solid rgba(0, 123, 255, 0.2);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-left: auto;
}

.acf-toggle-view:hover {
  background: rgba(0, 123, 255, 0.2);
  transform: translateY(-1px);
}

.acf-field-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
  color: #212529;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  width: 100%;
  box-sizing: border-box;
}

textarea.acf-field-content {
  color: #212529;
  background: white;
  resize: vertical;
  min-height: 200px;
}

/* Vue rendue */
.acf-field-content.rendered {
  background: white;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

/* Contenu HTML dans les champs ACF */
.acf-field-content img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 8px 0;
}

.acf-field-content p {
  margin: 8px 0;
  word-wrap: break-word;
}

.acf-field-content h1,
.acf-field-content h2,
.acf-field-content h3 {
  font-size: 14px !important;
  font-weight: bold;
  margin: 12px 0 8px 0;
  line-height: 1.3;
}

.acf-field-content a {
  color: #007bff;
  text-decoration: underline;
  word-break: break-all;
}

.acf-field-content div {
  margin: 4px 0;
}

.acf-field-content .wp-caption {
  max-width: 100% !important;
  margin: 8px 0;
}

.acf-field-content .wp-caption-text {
  font-size: 12px;
  font-style: italic;
  color: #6c757d;
  margin-top: 4px;
}


/* Editable Field */
.acf-field-content.editable {
  resize: vertical;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.acf-field-content.editable:focus {
  border-color: rgba(0, 123, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Action Buttons */
.acf-field-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  justify-content: center;
}

.acf-action-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.acf-action-btn.reject {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.2);
}

.acf-action-btn.reject:hover {
  background: rgba(220, 53, 69, 0.2);
  transform: translateY(-1px);
}

.acf-action-btn.restore {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  border-color: rgba(255, 193, 7, 0.2);
}

.acf-action-btn.restore:hover {
  background: rgba(255, 193, 7, 0.2);
  transform: translateY(-1px);
}

.acf-action-btn.accept {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border-color: rgba(40, 167, 69, 0.2);
}

.acf-action-btn.accept:hover {
  background: rgba(40, 167, 69, 0.2);
  transform: translateY(-1px);
}

/* Modal Footer */
.acf-modal-footer {
  background: rgba(248, 249, 250, 0.8);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.acf-progress-info {
  font-size: 13px;
  color: #6c757d;
}

.acf-modal-actions {
  display: flex;
  gap: 12px;
}

.acf-modal-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.acf-modal-btn.secondary {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
  border-color: rgba(108, 117, 125, 0.2);
}

.acf-modal-btn.secondary:hover {
  background: rgba(108, 117, 125, 0.2);
  transform: translateY(-1px);
}

.acf-modal-btn.primary {
  background: #007bff;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.acf-modal-btn.primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.acf-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.acf-modal-btn.push-wordpress-btn {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
  animation: pulse 2s infinite;
}

.acf-modal-btn.push-wordpress-btn:hover {
  background: linear-gradient(135deg, #138496 0%, #0f6674 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
}

@keyframes pulse {
  0% {
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
  }
  50% {
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.5);
  }
  100% {
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
  }
}

/* Loading State */
.acf-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  color: #6c757d;
}

.acf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.acf-empty-state {
  text-align: center;
  padding: 40px;
  color: #6c757d;
}

.acf-empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
  .acf-modal {
    width: 95%;
    max-height: 95vh;
  }
  
  .acf-comparison-wrapper {
    flex-direction: column;
    height: auto;
  }
  
  .acf-field-column {
    width: 100%;
    height: 300px;
  }
  
  .acf-field-column:first-child {
    margin-bottom: 12px;
  }
}
/* Link Editor */
.link-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.links-manager {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.2s;
}

.links-manager-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  background: #e9ecef;
  transition: background 0.2s;
}

.links-manager-header:hover {
  background: #dee2e6;
}

.links-manager-toggle {
  font-size: 10px;
  color: #6c757d;
  transition: transform 0.2s;
}

.links-manager-title {
  font-size: 11px;
  font-weight: 600;
  color: #495057;
  flex: 1;
}

.links-count {
  font-size: 11px;
  color: #6c757d;
  background: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.links-manager.collapsed .links-container {
  display: none;
}

.links-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  max-height: 80px;
  overflow-y: auto;
}

.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 12px;
  padding: 3px 8px 3px 10px;
  font-size: 11px;
  color: #1565c0;
  transition: all 0.2s;
  cursor: help;
  max-width: 200px;
}

.link-badge:hover {
  background: #bbdefb;
  border-color: #64b5f6;
  box-shadow: 0 1px 3px rgba(33, 150, 243, 0.2);
}

.link-badge-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.link-badge-delete {
  flex-shrink: 0;
  background: transparent;
  color: #d32f2f;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.link-badge-delete:hover {
  background: #d32f2f;
  color: white;
  transform: scale(1.1);
}

.link-editor-wrapper .link-editor {
  flex: 1;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  background: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 150px;
}
