/* Internal Links Panel Styles */

.contai-panel-internal-links {
  border-left: 4px solid var(--contai-primary);
}

.contai-internal-links-form .contai-settings-row {
  margin-bottom: var(--contai-spacing-lg);
}

.contai-settings-section {
  background: #fff;
  border: 1px solid var(--contai-neutral-400);
  border-radius: var(--contai-radius-lg);
  padding: var(--contai-spacing-xl);
  margin: var(--contai-spacing-md);
}

.contai-settings-section:hover {
  box-shadow: var(--contai-shadow-md);
}

.contai-section-title {
  margin: 0 0 var(--contai-spacing-lg) 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--contai-neutral-700);
  display: flex;
  align-items: center;
  gap: var(--contai-spacing-sm);
}

.contai-section-title .dashicons {
  color: var(--contai-primary);
  font-size: 24px;
  width: 24px;
  height: 24px;
}

.contai-section-subtitle {
  margin: 0 0 var(--contai-spacing-md) 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--contai-neutral-700);
  display: flex;
  align-items: center;
  gap: var(--contai-spacing-sm);
}

.contai-section-subtitle .dashicons {
  color: var(--contai-primary);
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.contai-settings-row {
  margin-bottom: var(--contai-spacing-lg);
}

.contai-settings-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--contai-neutral-700);
  cursor: pointer;
  transition: color var(--contai-duration-fast) ease;
}

.contai-settings-label:hover {
  color: var(--contai-primary);
}

.contai-settings-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--contai-primary);
}

.contai-settings-help {
  margin: var(--contai-spacing-xs) 0 0 0;
  color: var(--contai-neutral-600);
  font-size: 13px;
  line-height: 1.5;
}

.contai-input-number {
  max-width: 200px;
  padding: 12px 16px;
  border: 2px solid var(--contai-neutral-300);
  border-radius: var(--contai-radius-lg);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--contai-duration-fast) ease;
  background: #fff;
}

.contai-input-number:focus {
  outline: none;
  border-color: var(--contai-primary);
  box-shadow: 0 0 0 4px var(--contai-primary-glow);
  transform: translateY(-1px);
}

.contai-input-number:hover {
  border-color: var(--contai-primary);
}

.contai-form-actions {
  display: flex;
  gap: var(--contai-spacing-md);
  padding-top: var(--contai-spacing-xl);
  border-top: 2px solid var(--contai-neutral-200);
  margin: var(--contai-spacing-md);
}

.contai-form-actions .button-primary {
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--contai-radius-lg);
  box-shadow: var(--contai-shadow-md);
}

.contai-form-actions .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--contai-shadow-lg);
}

.contai-form-actions .button-secondary {
  font-size: 14px;
  border-radius: var(--contai-radius-lg);
}

/* Queue Section Styles */

.contai-internal-links-queue-container {
  margin-top: 24px;
}

.contai-queue-form {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--contai-neutral-50);
  border: 2px solid var(--contai-neutral-200);
  border-radius: var(--contai-radius-lg);
}

.contai-queue-form .contai-button-group {
  display: flex;
  gap: var(--contai-spacing-md);
  padding-top: var(--contai-spacing-xl);
  border-top: 2px solid var(--contai-neutral-200);
  margin: var(--contai-spacing-md);
}

.contai-queue-form .button-primary {
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--contai-radius-lg);
  box-shadow: var(--contai-shadow-md);
}

.contai-queue-form .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--contai-shadow-lg);
}

.contai-queue-form .button-secondary {
  font-size: 14px;
  border-radius: var(--contai-radius-lg);
}

.contai-queue-status-panel {
  padding: 28px;
  background: var(--contai-neutral-50);
  border: 2px solid var(--contai-neutral-200);
  border-radius: var(--contai-radius-lg);
  box-shadow: var(--contai-shadow-sm);
}

.contai-queue-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.contai-stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: #fff;
  border-radius: var(--contai-radius-lg);
  border: 2px solid var(--contai-neutral-200);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.contai-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--contai-primary),
    var(--contai-primary-dark)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contai-stat-card:hover {
  border-color: var(--contai-primary);
  box-shadow: var(--contai-shadow-lg);
  transform: translateY(-2px);
}

.contai-stat-card:hover::before {
  opacity: 1;
}

.contai-stat-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: var(--contai-shadow-sm);
  transition: transform 0.3s ease;
}

.contai-stat-card:hover .contai-stat-icon {
  transform: scale(1.1) rotate(5deg);
}

.contai-stat-icon.contai-stat-pending {
  background: linear-gradient(135deg, #ffd93d 0%, #ffb800 100%);
  color: #6b4f00;
}

.contai-stat-icon.contai-stat-processing {
  background: linear-gradient(135deg, var(--contai-primary-lighter) 0%, var(--contai-primary) 100%);
  color: #ffffff;
}

.contai-stat-icon .dashicons {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.contai-stat-content {
  flex: 1;
}

.contai-stat-value {
  font-size: 40px;
  font-weight: 800;
  color: var(--contai-primary);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.contai-stat-label {
  font-size: 12px;
  color: var(--contai-neutral-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.4;
}

.contai-processing-jobs {
  margin-top: var(--contai-spacing-lg);
}

.contai-empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--contai-neutral-600);
  background: var(--contai-neutral-50);
  border-radius: var(--contai-radius-lg);
  border: 2px dashed var(--contai-neutral-300);
}

.contai-empty-state .dashicons {
  font-size: 64px;
  width: 64px;
  height: 64px;
  color: var(--contai-neutral-400);
  margin-bottom: 16px;
  opacity: 0.6;
}

.contai-empty-state p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--contai-neutral-600);
}

/* Processing Table */

.contai-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: var(--contai-radius-md);
  overflow: hidden;
  box-shadow: var(--contai-shadow-sm);
}

.contai-table thead {
  background: var(--contai-neutral-100);
}

.contai-table th {
  padding: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--contai-neutral-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--contai-neutral-300);
}

.contai-table td {
  padding: 16px;
  border-bottom: 1px solid var(--contai-neutral-200);
  font-size: 14px;
  color: var(--contai-neutral-700);
}

.contai-table tbody tr {
  transition: all var(--contai-duration-fast) ease;
}

.contai-table tbody tr:hover {
  background: var(--contai-primary-glow);
  transform: scale(1.01);
}

.contai-table tbody tr:last-child td {
  border-bottom: none;
}

.contai-processing-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--contai-info-bg);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--contai-info-text);
  border: 1px solid var(--contai-info-border);
}

.contai-processing-time::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--contai-primary);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Internal Links List */

.contai-internal-links-list-container {
  margin-top: var(--contai-spacing-lg);
}

.contai-internal-links-filters {
  display: flex;
  align-items: center;
  gap: var(--contai-spacing-md);
  margin-bottom: var(--contai-spacing-lg);
  padding: var(--contai-spacing-md);
  background: var(--contai-neutral-50);
  border-radius: var(--contai-radius-md);
}

.contai-filter-group {
  display: flex;
  align-items: center;
  gap: var(--contai-spacing-sm);
}

.contai-filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--contai-neutral-700);
}

.contai-status-select {
  padding: 6px 12px;
  border: 1px solid var(--contai-neutral-400);
  border-radius: var(--contai-radius-sm);
  font-size: 13px;
  background: #fff;
}

.contai-clear-filters {
  font-size: 13px;
}

.contai-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--contai-spacing-md);
}

.contai-items-count {
  margin: 0;
  font-size: 14px;
  color: var(--contai-neutral-600);
}

.contai-internal-links-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--contai-neutral-300);
  border-radius: var(--contai-radius-md);
  overflow: hidden;
}

.contai-internal-links-table thead {
  background: var(--contai-neutral-100);
}

.contai-internal-links-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--contai-neutral-700);
  border-bottom: 2px solid var(--contai-neutral-300);
}

.contai-internal-links-table td {
  padding: 12px;
  border-bottom: 1px solid var(--contai-neutral-200);
  font-size: 13px;
  color: var(--contai-neutral-700);
}

.contai-internal-links-table tbody tr:hover {
  background: var(--contai-neutral-50);
}

.contai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: var(--contai-shadow-xs);
  transition: all var(--contai-duration-fast) ease;
}

.contai-status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.contai-status-badge.contai-status-active {
  background: linear-gradient(135deg, #10b981 0%, var(--contai-success) 100%);
  color: #ffffff;
  border: 1px solid var(--contai-success);
}

.contai-status-badge.contai-status-active::before {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.contai-status-badge.contai-status-inactive {
  background: linear-gradient(135deg, #ef4444 0%, var(--contai-error) 100%);
  color: #ffffff;
  border: 1px solid var(--contai-error);
}

.contai-status-badge.contai-status-inactive::before {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.contai-status-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--contai-shadow-sm);
}

/* Pagination */

.contai-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--contai-spacing-md);
  margin-top: var(--contai-spacing-lg);
  padding-top: var(--contai-spacing-lg);
  border-top: 1px solid var(--contai-neutral-300);
}

.contai-pagination-info {
  font-size: 14px;
  color: var(--contai-neutral-600);
  font-weight: 500;
}

/* Empty State */

.contai-empty-state-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.contai-empty-state-icon .dashicons {
  font-size: 80px;
  width: 80px;
  height: 80px;
  color: var(--contai-neutral-400);
  background: var(--contai-neutral-100);
  border-radius: 50%;
  padding: 20px;
}

.contai-empty-state-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--contai-neutral-700);
}

.contai-empty-state-description {
  margin: 0;
  font-size: 15px;
  color: var(--contai-neutral-600);
  line-height: 1.7;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Loading States */

.contai-button-action[disabled],
.button-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.contai-button-action[disabled]::after,
.button-primary[disabled]::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Transitions */

.contai-settings-section,
.contai-stat-card,
.contai-table,
.contai-status-badge,
.contai-button-action,
.button {
  will-change: transform;
}

/* Focus States */

.button:focus,
.contai-button-action:focus {
  outline: 3px solid var(--contai-primary-glow);
  outline-offset: 2px;
}

/* Responsive */

@media (max-width: 768px) {
  .contai-queue-stats {
    grid-template-columns: 1fr;
  }

  .contai-stat-card {
    padding: 20px;
  }

  .contai-stat-value {
    font-size: 32px;
  }

  .contai-stat-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .contai-form-actions,
  .contai-queue-form .contai-button-group {
    flex-direction: column;
  }

  .contai-form-actions .button,
  .contai-queue-form .button {
    width: 100%;
    justify-content: center;
  }

  .contai-internal-links-table {
    font-size: 12px;
  }

  .contai-internal-links-table th,
  .contai-internal-links-table td {
    padding: 10px 8px;
  }

  .contai-settings-section {
    padding: 20px;
  }

  .contai-section-title {
    font-size: 18px;
  }
}
