/**
 * Preset Manager UI Styles
 *
 * Uses CSS Custom Properties from the Design System.
 */

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

/* Loading state */
.prorank-preset-manager__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--pr-spacing-xlarge, 32px);
  text-align: center;
  gap: var(--pr-spacing-medium, 16px);
}

.prorank-preset-manager__loading p {
  margin: 0;
  color: var(--pr-text-secondary, #555);
  font-size: var(--pr-font-size-base, 14px);
}

/* Header */
.prorank-preset-manager__header {
  margin-bottom: var(--pr-spacing-large, 24px);
}

.prorank-preset-manager__header h3 {
  margin: 0 0 var(--pr-spacing-small, 8px);
  font-size: var(--pr-font-size-large, 16px);
  font-weight: var(--pr-font-weight-semibold, 600);
  color: var(--pr-text-primary, #1e1e1e);
}

.prorank-preset-manager__header .description {
  margin: 0;
  color: var(--pr-text-secondary, #555);
  font-size: var(--pr-font-size-small, 13px);
  line-height: 1.5;
}

/* Grid layout */
.prorank-preset-manager__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--pr-spacing-medium, 16px);
}

/* Preset card */
.prorank-preset-card {
  border: 1px solid var(--pr-border-light, #e0e0e0);
  transition: all var(--pr-motion-duration-fast, 200ms)
    var(--pr-motion-easing-standard, ease-in-out);
}

.prorank-preset-card:hover {
  border-color: var(--pr-border-hover, #ccc);
  box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
}

.prorank-preset-card__header {
  display: flex;
  align-items: center;
  gap: var(--pr-spacing-small, 8px);
}

.prorank-preset-card__header .dashicon {
  color: var(--pr-color-primary, #2271b1);
}

.prorank-preset-card__header h4 {
  margin: 0;
  font-size: var(--pr-font-size-base, 14px);
  font-weight: var(--pr-font-weight-semibold, 600);
  color: var(--pr-text-primary, #1e1e1e);
}

.prorank-preset-card__description {
  margin: 0 0 var(--pr-spacing-medium, 16px);
  color: var(--pr-text-secondary, #555);
  font-size: var(--pr-font-size-small, 13px);
  line-height: 1.5;
}

.prorank-preset-card__settings-count {
  margin: 0 0 var(--pr-spacing-medium, 16px);
  color: var(--pr-text-tertiary, #757575);
  font-size: var(--pr-font-size-xsmall, 11px);
}

.prorank-preset-card__apply-button {
  width: 100%;
  justify-content: center;
}

/* Confirmation modal */
.prorank-preset-confirm-modal {
  max-width: 500px;
}

.prorank-preset-confirm-modal p {
  margin: 0 0 var(--pr-spacing-medium, 16px);
  font-size: var(--pr-font-size-base, 14px);
  line-height: 1.5;
}

.prorank-preset-confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--pr-spacing-small, 8px);
  margin-top: var(--pr-spacing-large, 24px);
  padding-top: var(--pr-spacing-medium, 16px);
  border-top: 1px solid var(--pr-border-light, #e0e0e0);
}

/* Applying overlay */
.prorank-preset-manager__applying-overlay {
  position: fixed;
  inset: 0;
  background: rgb(255 255 255 / 90%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--pr-spacing-medium, 16px);
  z-index: 100000;
}

.prorank-preset-manager__applying-overlay p {
  margin: 0;
  font-size: var(--pr-font-size-base, 14px);
  color: var(--pr-text-primary, #1e1e1e);
}

/* Accessibility */
.prorank-preset-card__apply-button:focus {
  outline: 2px solid var(--pr-color-primary, #2271b1);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .prorank-preset-card {
    border-width: 2px;
  }

  .prorank-preset-card:hover {
    border-color: var(--pr-color-primary, #2271b1);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .prorank-preset-card {
    transition: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .prorank-preset-card {
    background: var(--pr-background-dark, #2c2c2c);
    border-color: var(--pr-border-dark, #404040);
  }

  .prorank-preset-card:hover {
    border-color: var(--pr-border-hover-dark, #555);
  }

  .prorank-preset-manager__applying-overlay {
    background: rgb(30 30 30 / 90%);
  }
}

/* WordPress Admin Dark Mode */
.wp-admin.prorank-dark-theme .prorank-preset-card {
  background: #2c2c2c;
  border-color: #404040;
}

.wp-admin.prorank-dark-theme .prorank-preset-card:hover {
  border-color: #555;
  box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
}

.wp-admin.prorank-dark-theme .prorank-preset-card__header h4 {
  color: #e0e0e0;
}

.wp-admin.prorank-dark-theme .prorank-preset-card__description {
  color: #a0a0a0;
}

.wp-admin.prorank-dark-theme .prorank-preset-confirm-modal {
  background: #2c2c2c;
  color: #e0e0e0;
}
