/**
 * Settings Lint Message Styles
 *
 * Uses CSS Custom Properties from the Design System.
 */

/* Import design system variables */
@import url('../../../styles/design-system.css');

/* Inline Messages */
.prorank-settings-lint-inline {
  margin-top: var(--pr-spacing-small, 8px);
}

.prorank-settings-lint-message {
  display: flex;
  align-items: flex-start;
  gap: var(--pr-spacing-xsmall, 4px);
  padding: var(--pr-spacing-small, 8px) var(--pr-spacing-medium, 12px);
  margin-bottom: var(--pr-spacing-xsmall, 4px);
  border-radius: var(--pr-radius-small, 4px);
  font-size: var(--pr-font-size-small, 13px);
  line-height: 1.5;
  animation: slideIn var(--pr-motion-duration-fast, 200ms)
    var(--pr-motion-easing-standard, ease-in-out);
}

.prorank-settings-lint-message:last-child {
  margin-bottom: 0;
}

/* Message Types */
.prorank-settings-lint-message--error {
  background: var(--pr-color-error-bg, #fee);
  color: var(--pr-color-error-text, #d32f2f);
  border: 1px solid var(--pr-color-error-border, #fcc);
}

.prorank-settings-lint-message--warning {
  background: var(--pr-color-warning-bg, #fff8e1);
  color: var(--pr-color-warning-text, #f57c00);
  border: 1px solid var(--pr-color-warning-border, #ffe0b2);
}

.prorank-settings-lint-message--info {
  background: var(--pr-color-info-bg, #e3f2fd);
  color: var(--pr-color-info-text, #1976d2);
  border: 1px solid var(--pr-color-info-border, #bbdefb);
}

/* Icon */
.prorank-settings-lint-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.prorank-settings-lint-message--error .prorank-settings-lint-icon {
  color: var(--pr-color-error, #d32f2f);
}

.prorank-settings-lint-message--warning .prorank-settings-lint-icon {
  color: var(--pr-color-warning, #f57c00);
}

.prorank-settings-lint-message--info .prorank-settings-lint-icon {
  color: var(--pr-color-info, #1976d2);
}

/* Text */
.prorank-settings-lint-text {
  flex: 1;
  word-break: break-word;
}

/* Block Display */
.prorank-settings-lint-block {
  margin-bottom: var(--pr-spacing-large, 24px);
}

.prorank-settings-lint-notice {
  margin-bottom: var(--pr-spacing-small, 8px) !important;
}

.prorank-settings-lint-notice:last-child {
  margin-bottom: 0 !important;
}

/* Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Field Highlight */
.prorank-field-has-error {
  position: relative;
}

.prorank-field-has-error input,
.prorank-field-has-error textarea,
.prorank-field-has-error select {
  border-color: var(--pr-color-error-border, #fcc) !important;
  background-color: var(--pr-color-error-bg, #fef7f7) !important;
}

.prorank-field-has-warning input,
.prorank-field-has-warning textarea,
.prorank-field-has-warning select {
  border-color: var(--pr-color-warning-border, #ffe0b2) !important;
  background-color: var(--pr-color-warning-bg, #fffcf5) !important;
}

/* Accessibility */
.prorank-settings-lint-message:focus-within {
  outline: 2px solid var(--pr-color-primary, #2271b1);
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .prorank-settings-lint-message {
    border-width: 2px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .prorank-settings-lint-message {
    animation: none;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .prorank-settings-lint-message--error {
    background: rgb(211 47 47 / 10%);
    border-color: rgb(211 47 47 / 30%);
  }

  .prorank-settings-lint-message--warning {
    background: rgb(245 124 0 / 10%);
    border-color: rgb(245 124 0 / 30%);
  }

  .prorank-settings-lint-message--info {
    background: rgb(25 118 210 / 10%);
    border-color: rgb(25 118 210 / 30%);
  }
}

/* WordPress Admin Dark Mode */
.wp-admin.prorank-dark-theme .prorank-settings-lint-message--error {
  background: rgb(211 47 47 / 15%);
  border-color: rgb(211 47 47 / 40%);
  color: #ff6b6b;
}

.wp-admin.prorank-dark-theme .prorank-settings-lint-message--warning {
  background: rgb(245 124 0 / 15%);
  border-color: rgb(245 124 0 / 40%);
  color: #ffa726;
}

.wp-admin.prorank-dark-theme .prorank-settings-lint-message--info {
  background: rgb(25 118 210 / 15%);
  border-color: rgb(25 118 210 / 40%);
  color: #42a5f5;
}
