/* WD Restrictions Admin Styles */

.wdr-settings-wrap {
  max-width: 1200px;
  margin: 20px auto;
}

/* Hidden title for WordPress notice placement */
.wdr-screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.wdr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 20px 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wdr-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wdr-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
  border-radius: 10px;
}

.wdr-header-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.wdr-header-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #1d2327;
}

.wdr-header-version {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #f0f0f1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #50575e;
  vertical-align: middle;
}

.wdr-header-right {
  display: flex;
  align-items: center;
}

.wdr-header-review {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f0b849 0%, #d69e2e 100%);
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(214, 158, 46, 0.3);
}

.wdr-header-review:hover {
  background: linear-gradient(135deg, #d69e2e 0%, #b8860b 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(214, 158, 46, 0.4);
}

.wdr-header-review:focus {
  color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 184, 73, 0.4);
}

.wdr-header-review svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Admin Notices Container */
.wdr-notices {
  margin-bottom: 20px;
}

.wdr-notices:empty {
  display: none;
}

.wdr-notices .notice,
.wdr-notices .updated,
.wdr-notices .error,
.wdr-notices .update-nag {
  margin: 0 0 10px 0;
}

.wdr-notices .notice:last-child,
.wdr-notices .updated:last-child,
.wdr-notices .error:last-child {
  margin-bottom: 0;
}

.wdr-form {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Tabs Navigation */
.wdr-tabs {
  margin-top: 20px;
}

.wdr-tabs-nav {
  display: flex;
  gap: 4px;
  background: #fff;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #dcdcde;
}

.wdr-tab-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #50575e;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wdr-tab-button:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #2271b1;
}

.wdr-tab-button.active {
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background: #f0f0f1;
  background: #2271b1;
}

.wdr-tab-button .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

/* Tab Content */
.wdr-tabs-content {
  background: #fff;
  padding: 0;
}

.wdr-tab-content {
  display: none;
  padding: 30px;
  animation: fadeIn 0.3s ease;
}

.wdr-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards */
.wdr-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 20px;
}

.wdr-card h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 18px;
  color: #1d2327;
}

.wdr-card > .description {
  margin-top: 0;
  margin-bottom: 24px;
  color: #646970;
}

/* Toggle Switch */
.wdr-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.wdr-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.wdr-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #dcdcde;
  transition: 0.3s;
  border-radius: 24px;
}

.wdr-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.wdr-toggle input:checked + .wdr-toggle-slider {
  background-color: #2271b1;
}

.wdr-toggle input:focus + .wdr-toggle-slider {
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
}

.wdr-toggle input:checked + .wdr-toggle-slider:before {
  transform: translateX(24px);
}

/* Page Selector */
.wdr-page-selector {
  max-width: 600px;
}

.wdr-page-selector-header {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.wdr-page-selector-header input[type="text"] {
  flex: 1;
}

.wdr-page-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  padding: 8px;
}

/* Custom scrollbar for page list */
.wdr-page-list::-webkit-scrollbar {
  width: 8px;
}

.wdr-page-list::-webkit-scrollbar-track {
  background: #f0f0f1;
  border-radius: 4px;
}

.wdr-page-list::-webkit-scrollbar-thumb {
  background: #c3c4c7;
  border-radius: 4px;
}

.wdr-page-list::-webkit-scrollbar-thumb:hover {
  background: #a7aaad;
}

.wdr-page-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.wdr-page-item:hover {
  background: #f6f7f7;
  border-color: #e0e0e0;
}

.wdr-page-item input[type="checkbox"] {
  margin: 0 10px 0 0;
  cursor: pointer;
}

.wdr-page-item input[type="checkbox"]:checked {
  accent-color: #2271b1;
}

.wdr-page-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1d2327;
}

.wdr-page-indent {
  color: #8c8f94;
  font-size: 12px;
}

.wdr-child-count {
  font-size: 12px;
  color: #646970;
  font-weight: normal;
}

.wdr-page-id {
  font-size: 11px;
  color: #8c8f94;
  font-family: "Courier New", monospace;
  background: #f0f0f1;
  padding: 2px 6px;
  border-radius: 3px;
}

.wdr-page-item input[type="checkbox"]:checked ~ .wdr-page-title {
  font-weight: 600;
  color: #2271b1;
}

/* Checkbox Groups */
.wdr-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.wdr-checkbox-label {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wdr-checkbox-label:hover {
  background: #fff;
  border-color: #2271b1;
}

.wdr-checkbox-label input[type="checkbox"] {
  margin: 0 8px 0 0;
}

/* Form Table Enhancements */
.form-table th {
  width: 200px;
  padding: 20px 10px 20px 0;
  vertical-align: top;
}

.form-table td {
  padding: 20px 10px;
}

.form-table .description {
  margin-top: 8px;
  font-size: 13px;
}

/* Post Type Restrictions */
.wdr-post-type-item {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.wdr-post-type-item h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #1d2327;
}

.wdr-post-type-options {
  padding-left: 60px;
}

.wdr-post-type-options .wdr-field {
  margin-bottom: 16px;
}

.wdr-post-type-options .wdr-field:last-child {
  margin-bottom: 0;
}

.wdr-post-type-options .wdr-field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1d2327;
}

/* Select2 Compatibility */
.wdr-select2 {
  min-height: 40px;
}

/* Submit Button */
.wdr-form .submit {
  margin: 0;
  padding: 24px 30px;
  border-top: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.wdr-form .button-primary {
  padding: 8px 24px;
  height: auto;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 782px) {
  .wdr-tabs-nav {
    flex-direction: column;
  }

  .wdr-tab-button {
    justify-content: flex-start;
  }

  .wdr-checkbox-group {
    grid-template-columns: 1fr;
  }

  .form-table th,
  .form-table td {
    display: block;
    width: 100%;
    padding: 10px 0;
  }

  .wdr-post-type-options {
    padding-left: 0;
  }
}

/* Notice Styles */
.wdr-notice {
  padding: 12px 16px;
  margin: 16px 0;
  border-left: 4px solid;
  border-radius: 4px;
}

.wdr-notice.success {
  background: #d5f5e3;
  border-color: #27ae60;
  color: #145a32;
}

.wdr-notice.warning {
  background: #fcf3cf;
  border-color: #f39c12;
  color: #7d6608;
}

.wdr-notice.error {
  background: #fadbd8;
  border-color: #e74c3c;
  color: #78281f;
}

/* Loading State */
.wdr-loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.wdr-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2271b1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Redirect Selector */
.wdr-redirect-selector .wdr-redirect-page-select {
  min-width: 200px;
}

.wdr-redirect-selector .wdr-custom-url-field {
  margin-top: 10px;
}
