/* Contrast checker — color picker popover (mirrored from module-icons.css) */

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.color-swatch:hover {
  border-color: #adb5bd;
}

.color-swatch[aria-expanded="true"] {
  border-color: #6c757d;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Popover panel — full width of color input + swatch row */
.vb-contrast-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  z-index: 20;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--border-color-light, #dee2e6);
  border-radius: var(--border-radius-card, 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  max-height: calc(300px + 1rem);
  overflow-y: auto;
}

.vb-contrast-popover[hidden] {
  display: none !important;
}

.vb-contrast-popover-body {
  padding: 4px 0 8px;
}

.vb-contrast-group-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  position: relative;
}

.vb-contrast-group-row:not(:last-child) {
  padding-bottom: 14px;
}

.vb-contrast-group-row:not(:first-child) {
  padding-top: 14px;
}

.vb-contrast-group-row:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background-color: var(--border-color, #e0e0e0);
}

.vb-contrast-group-row:last-child {
  border-bottom: none;
}

.vb-contrast-group-label {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-color, #6b6f7e);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.vb-contrast-group-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.vb-contrast-custom-row .vb-contrast-group-colors {
  flex-wrap: nowrap;
}

/* Color circle buttons */
.vb-contrast-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
  padding: 0;
  flex-shrink: 0;
  box-shadow: none;
}

.vb-contrast-color-btn:hover {
  transform: scale(1.1);
}

.vb-contrast-color-btn.active {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.vb-contrast-color-btn:focus {
  outline: none;
}

.vb-contrast-color-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35);
  outline-offset: 2px;
}

.vb-contrast-color-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.vb-contrast-color-reset:hover {
  border-color: #9ca3af;
  transform: scale(1.1);
}

.vb-contrast-color-reset svg {
  width: 14px;
  height: 14px;
  color: #6b7280;
}

.vb-contrast-color-reset:hover svg {
  color: #1f2937;
}

/* Custom color picker (eyedropper) */
.vb-contrast-color-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vb-contrast-color-picker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.vb-contrast-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.vb-contrast-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
  opacity: 0;
}

.vb-contrast-color-picker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
  opacity: 0;
}

.vb-contrast-color-picker:hover {
  transform: scale(1.1);
}

.vb-contrast-color-picker.active {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.vb-contrast-color-picker:focus {
  outline: none;
}

.vb-contrast-color-picker:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35);
  outline-offset: 2px;
}

.vb-contrast-color-picker-icon {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 1;
  transition: color 0.15s ease;
}

/* Result badges (moved from inline snippet) */
.result-badge {
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: bold;
  min-width: 50px;
  text-align: center;
  background-color: #e9ffe9 !important;
  color: #4CAF50;
}

.result-badge.fail {
  background-color: rgba(255, 235, 238, 1) !important;
  color: #ff002a !important;
}
