/* Modern WordPress Admin Styles */

.fp-settings-wrap {
  padding: 40px 20px 20px 0;
  max-width: 1000px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Remove default WordPress h1 */
.fp-settings-wrap > h1 {
  display: none;
}

/* Ensure WordPress admin notices appear ABOVE the header, not inside */
.fp-settings-wrap .notice,
.fp-settings-wrap .updated,
.fp-settings-wrap .error,
.fp-settings-wrap .update-nag {
  margin: 0 0 20px 0 !important;
  position: relative;
  z-index: 10;
}

/* Push header down if notices exist */
.fp-settings-wrap > .notice + .fp-header,
.fp-settings-wrap > .updated + .fp-header,
.fp-settings-wrap > .error + .fp-header {
  margin-top: 20px;
}

/* Modern Header with Logo */
.fp-header {
  background: linear-gradient(135deg, #2271b1 0%, #1a5a96 100%);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(34, 113, 177, 0.15);
}

.fp-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fp-logo-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fp-logo {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fp-title-section h1 {
  margin: 0;
  padding: 0;
  font-size: 28px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.fp-subtitle {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}

.fp-settings-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Base Settings Section */
.fp-base-settings-section {
  padding: 32px;
  background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
  border-bottom: 1px solid #e5e7eb;
}

/* Tabs Navigation */
.fp-tabs-nav {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  padding: 0 16px;
}

.fp-tab {
  padding: 16px 24px;
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.fp-tab:hover {
  color: #2271b1;
  background: rgba(34, 113, 177, 0.04);
}

.fp-tab.active {
  color: #2271b1;
  border-bottom: 2px solid #2271b1;
  background: #fff;
}

/* Settings Content */
.fp-settings-content {
  padding: 24px;
}

.fp-settings-section {
  margin-bottom: 0;
  padding: 32px;
  background: #fafbfc;
}

.fp-settings-section h2 {
  margin: 0 0 20px 0;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.01em;
}

/* Cards */
.fp-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
  overflow: hidden;
}

.fp-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #d1d5db;
}

.fp-card-header {
  background: linear-gradient(to right, #f9fafb 0%, #f3f4f6 100%);
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 16px;
}

.fp-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.01em;
}

.fp-card-content {
  padding: 24px;
}

.fp-integration-option {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.fp-integration-option .fp-integration-option-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  color: #1f2937;
}

/* Form Elements */
.form-table {
  margin: 0;
}

.form-table th {
  padding: 20px 10px 20px 0;
  width: 200px;
  font-weight: 600;
}

.form-table td {
  padding: 20px 10px;
}

.fp-form-field {
  margin-bottom: 24px;
}

.fp-form-field .inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fp-form-field .description {
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
  line-height: 1.5;
}

/* Form Elements */

.fp-label,
.firstpromoter_label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
  font-size: 14px;
}

.fp-input.regular-text,
.fp-textarea,
.firstpromoter_textarea {
  width: 100%;
  max-width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.2s ease;
  background-color: #fff;
  font-family: inherit;
}

.fp-input.regular-text:focus,
.fp-textarea:focus,
.firstpromoter_textarea:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
  outline: none;
  background-color: #fafbfc;
}

.fp_label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.fp-required {
  color: #ef4444;
  font-weight: 600;
  margin-left: 2px;
}


/* Switch Toggle */
.fp-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.fp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fp-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: all 0.3s ease;
  border-radius: 26px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fp-slider:hover {
  background-color: #b8bcc4;
}

.fp-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .fp-slider {
  background: linear-gradient(135deg, #2271b1 0%, #1a5a96 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked + .fp-slider:hover {
  background: linear-gradient(135deg, #1a5a96 0%, #135280 100%);
}

input:checked + .fp-slider:before {
  transform: translateX(22px);
}

/* Checkbox Group */
.fp-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fp-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-size: 14px;
}

.fp-checkbox-group input[type="checkbox"] {
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

/* Notices */
.fp-notice {
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fp-warning {
  background-color: #fff7ed;
  border-left: 4px solid #f97316;
  color: #9a3412;
}

/* Code Editor */
.fp-code-section textarea {
  font-family: monospace;
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
}

.fp-code-section .description {
  margin-top: 8px;
  color: #6b7280;
}

/* Submit Button Section */
.fp-submit-button {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

/* Submit Button */
.submit .button-primary,
.button-primary {
  background: linear-gradient(135deg, #2271b1 0%, #1a5a96 100%);
  border: none;
  color: white;
  padding: 12px 32px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(34, 113, 177, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.submit .button-primary:hover,
.button-primary:hover {
  background: linear-gradient(135deg, #1a5a96 0%, #135280 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.fp-divider {
  margin: 32px 0;
  border: 0;
  border-top: 2px solid #f3f4f6;
  background: linear-gradient(to right, transparent, #e5e7eb 50%, transparent);
  height: 1px;
}

.fp-integration-option-details {
  padding-top: 15px;
}

/* For smooth animations */
.fp-integration-option-details {
  transition: margin 0.2s ease;
}

.fp-integration-option-details[style*="display: none"] {
  margin-top: 0;
}

/* Status indicators */
.fp-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fp-status-indicator.active {
  background-color: #dcfce7;
  color: #166534;
}

.fp-status-indicator.inactive {
  background-color: #fef3c7;
  color: #92400e;
}

/* Success/Error messages */
.fp-message {
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 6px;
  font-weight: 500;
  border-left: 4px solid;
}

.fp-message.success {
  background-color: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}

.fp-message.error {
  background-color: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

/* Responsive design */
@media (max-width: 768px) {
  .fp-settings-wrap {
    margin: 10px 10px 0 0;
  }

  .fp-header {
    padding: 24px;
    border-radius: 8px;
  }

  .fp-logo-section {
    gap: 16px;
  }

  .fp-logo {
    width: 48px;
    height: 48px;
  }

  .fp-title-section h1 {
    font-size: 22px;
  }

  .fp-subtitle {
    font-size: 13px;
  }

  .fp-settings-container {
    border-radius: 8px;
    margin-left: -10px;
    margin-right: -10px;
  }

  .fp-card-content,
  .fp-base-settings-section,
  .fp-settings-section {
    padding: 20px;
  }

  .fp-input.regular-text,
  .fp-textarea {
    max-width: none;
  }

  .fp-integration-option {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .fp-checkbox-group {
    gap: 8px;
  }
}

/* Loading animation */
.fp-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2271b1;
  border-radius: 50%;
  animation: fp-spin 1s linear infinite;
}

@keyframes fp-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tooltip */
.fp-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.fp-tooltip .fp-tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: #374151;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  line-height: 1.4;
}

.fp-tooltip:hover .fp-tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Error states */
.fp-input.error,
.fp-textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #ef4444;
}

/* Field focus states */
.fp-form-field.focused {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

/* Copy button states */
.fp-copy-btn.copied {
  background-color: #22c55e;
  color: white;
}

/* Tooltip popup */
.fp-tooltip-popup {
  background-color: #374151;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 200px;
  word-wrap: break-word;
}

/* Smooth transitions */
* {
  box-sizing: border-box;
}

.fp-settings-wrap * {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Custom Forms Repeater */
.fp-custom-forms-repeater {
  margin-top: 12px;
}

.fp-custom-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.fp-custom-form-fields {
  flex: 1;
  display: flex;
  gap: 10px;
}

.fp-custom-form-fields .fp-field-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fp-custom-form-fields .fp-field-label span {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.fp-custom-form-fields .fp-field-label .fp-input.regular-text {
  width: 100%;
  margin-bottom: 0;
}

.fp-remove-form-row {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.fp-remove-form-row:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: #fef2f2;
}

.fp-add-form-row {
  background: none;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 10px 20px;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
}

.fp-add-form-row:hover {
  border-color: #2271b1;
  color: #2271b1;
  background: rgba(34, 113, 177, 0.04);
}

@media (max-width: 768px) {
  .fp-custom-form-fields {
    flex-direction: column;
  }
}

/* Button disabled state */
.button-primary:disabled,
.submit .button-primary:disabled {
  background: #9ca3af !important;
  transform: none !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}
