/**
 * Titles & Meta Settings Styles
 * Modern design system for 2025
 */

.prorank-titles-meta-settings {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  background: #f8f9fb;
  min-height: 100vh;
}

/* Header Section */
.prorank-titles-meta-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  padding: 32px;
  border-radius: 16px;
  margin-bottom: 32px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
}

.prorank-titles-meta-header h2 {
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.prorank-titles-meta-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  margin: 0;
  line-height: 1.6;
}

/* Tab Navigation */
.prorank-titles-meta-tabs {
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.prorank-titles-meta-tabs .components-tab-panel__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border: none;
  margin-bottom: 0;
}

.prorank-titles-meta-tabs .components-tab-panel__tabs button {
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #64748b;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.prorank-titles-meta-tabs .components-tab-panel__tabs button:hover {
  background: #f1f5f9;
  color: #475569;
}

.prorank-titles-meta-tabs .components-tab-panel__tabs button.is-active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Cards */
.prorank-titles-meta-settings .components-card {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
  background: #ffffff;
}

.prorank-titles-meta-settings .components-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prorank-titles-meta-settings .components-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
  border-radius: 12px 12px 0 0;
}

.prorank-titles-meta-settings .components-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prorank-titles-meta-settings .components-card-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #334155;
}

.prorank-titles-meta-settings .components-card-body {
  padding: 24px;
}

/* Form Controls */
.prorank-titles-meta-settings .components-text-control__input,
.prorank-titles-meta-settings .components-textarea-control__input,
.prorank-titles-meta-settings .components-select-control__input {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #ffffff;
}

.prorank-titles-meta-settings .components-text-control__input:focus,
.prorank-titles-meta-settings .components-textarea-control__input:focus,
.prorank-titles-meta-settings .components-select-control__input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.prorank-titles-meta-settings .components-base-control__label {
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  font-size: 14px;
}

.prorank-titles-meta-settings .components-base-control__help {
  color: #64748b;
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.5;
}

/* Separator Buttons */
.prorank-separator-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.prorank-separator-btn {
  min-width: 48px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prorank-separator-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.prorank-separator-btn.is-selected {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Fix double checkbox tick issue */
.prorank-titles-meta-settings .components-checkbox-control__input {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background: white;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prorank-titles-meta-settings .components-checkbox-control__input:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.prorank-titles-meta-settings .components-checkbox-control__input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.prorank-titles-meta-settings .components-checkbox-control__input:checked::before {
  content: none !important;
  display: none !important;
}

/* Variable Reference */
.prorank-variable-reference {
  background: linear-gradient(135deg, #f3f4f6 0%, #f9fafb 100%);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.prorank-variable-reference h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.prorank-variable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.prorank-variable-group {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
}

.prorank-variable-group strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.prorank-variable-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.prorank-variable-group li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #4b5563;
  border-bottom: 1px solid #f3f4f6;
}

.prorank-variable-group li:last-child {
  border-bottom: none;
}

.prorank-variable-group code {
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  color: #2563eb;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* Toggle Controls */
.prorank-titles-meta-settings .components-toggle-control {
  margin-bottom: 16px;
}

.prorank-titles-meta-settings .components-toggle-control .components-base-control__field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prorank-titles-meta-settings .components-toggle-control .components-form-toggle {
  position: relative;
  width: 48px;
  height: 24px;
}

.prorank-titles-meta-settings .components-toggle-control .components-form-toggle__track {
  background: #cbd5e1;
  border-radius: 12px;
  height: 24px;
  width: 48px;
}

.prorank-titles-meta-settings .components-toggle-control .components-form-toggle.is-checked .components-form-toggle__track {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.prorank-titles-meta-settings .components-toggle-control .components-form-toggle__thumb {
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.prorank-titles-meta-settings .components-toggle-control .components-form-toggle.is-checked .components-form-toggle__thumb {
  transform: translateX(24px);
}

/* Checkbox Controls - Remove duplicate styling */
.prorank-titles-meta-settings .components-checkbox-control {
  margin-bottom: 12px;
}

/* Remove the duplicate checkbox styling that causes double tick */
.prorank-titles-meta-settings .components-checkbox-control__input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  margin-right: 10px;
  position: relative;
  cursor: pointer;
  background: white;
  transition: all 0.2s ease;
}

.prorank-titles-meta-settings .components-checkbox-control__input[type="checkbox"]:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Use only one checkmark style */
.prorank-titles-meta-settings .components-checkbox-control__input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Prevent any default checkmarks */
.prorank-titles-meta-settings .components-checkbox-control__input[type="checkbox"]:checked::before {
  content: none !important;
  display: none !important;
}

/* Actions Section */
.prorank-settings-actions {
  position: relative;
  background: #f8f9fb;
  padding: 8px 20px;
  margin: 20px 0 0;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-radius: 8px;
}

.prorank-settings-actions .components-button {
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.prorank-settings-actions .components-button.is-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.prorank-settings-actions .components-button.is-primary:hover {
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
  transform: translateY(-0.5px);
}

.prorank-settings-actions .components-button.is-destructive {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.prorank-settings-actions .components-button.is-destructive:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* Notice Styles */
.prorank-titles-meta-settings .components-notice {
  border-radius: 8px;
  margin-bottom: 24px;
  border-left: 4px solid;
  padding: 16px;
}

.prorank-titles-meta-settings .components-notice.is-success {
  background: #f0fdf4;
  border-left-color: #10b981;
  color: #065f46;
}

.prorank-titles-meta-settings .components-notice.is-error {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}

.prorank-titles-meta-settings .components-notice.is-info {
  background: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e40af;
}

/* Divider */
.prorank-titles-meta-settings .components-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .prorank-titles-meta-settings {
    padding: 16px;
  }
  
  .prorank-titles-meta-header {
    padding: 24px;
  }
  
  .prorank-titles-meta-header h2 {
    font-size: 24px;
  }
  
  .prorank-variable-grid {
    grid-template-columns: 1fr;
  }
  
  .prorank-titles-meta-tabs .components-tab-panel__tabs {
    flex-direction: column;
  }
  
  .prorank-titles-meta-tabs .components-tab-panel__tabs button {
    width: 100%;
    text-align: left;
  }
}

/* Loading State */
.prorank-titles-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.prorank-titles-loading .components-spinner {
  margin-bottom: 16px;
}

.prorank-titles-loading p {
  color: #64748b;
  font-size: 14px;
}

/* Icon Styles */
.prorank-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prorank-icon svg {
  width: 100%;
  height: 100%;
}

/* Range Control Custom Styles */
.prorank-titles-meta-settings .components-range-control {
  margin-bottom: 20px;
}

.prorank-titles-meta-settings .components-range-control__slider {
  background: linear-gradient(to right, #cbd5e1 0%, #3b82f6 100%);
  height: 6px;
  border-radius: 3px;
}

.prorank-titles-meta-settings .components-range-control__thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}