/*
 * Pixel Calculator plugin styles
 * Dedicated stylesheet to avoid conflicts with theme styles.
 */

.pwc-container {
  position: relative;
  min-height: 12.5rem;
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
}

.pwc-container .pwlc-app {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  margin-inline: 0 !important;
}

.pwlc-app {
  font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
  color: #0f172a;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.pwlc-app *,
.pwlc-app *::before,
.pwlc-app *::after {
  box-sizing: border-box;
}

.pwlc-app input,
.pwlc-app select,
.pwlc-app textarea {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: 400 !important;
  color: inherit !important;
  text-transform: none !important;
}

.pwlc-app button {
  font-family: inherit !important;
  color: inherit !important;
  text-transform: none !important;
}

.pwlc-app .pwlc-field {
  display: block;
}

.pwlc-app .pwlc-field__label,
.pwlc-app .pwlc-field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.01em;
}

.pwlc-app .pwlc-field__hint,
.pwlc-app .pwlc-field-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.pwlc-app .pwlc-field-hint--static {
  margin-top: 0;
}

.pwlc-app .pwlc-field-hint--truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pwlc-app .pwlc-field-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pwlc-app .pwlc-field-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pwlc-app .pwlc-field--flex {
  flex: 1 1 0%;
}

.pwlc-app .pwlc-field-control {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 400 !important;
  line-height: 1.45;
  padding: 0.5rem 0.65rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pwlc-app .pwlc-field-control option,
.pwlc-app .pwlc-field-control optgroup {
  font-weight: 400 !important;
}

.pwlc-app .pwlc-field-control:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.pwlc-app .pwlc-field-control:disabled,
.pwlc-app .pwlc-field-control[disabled] {
  background-color: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.pwlc-app select.pwlc-field-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23455666' stroke-width='1.8'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.pwlc-app .pwlc-field-control--sm {
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

.pwlc-app .pwlc-field-control--center {
  text-align: center;
}

.pwlc-app .pwlc-field-control--textarea {
  min-height: 8rem;
  resize: vertical;
}

.pwlc-app .pwlc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  padding: 0.6rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.pwlc-app .pwlc-button:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.pwlc-app .pwlc-button:focus {
  outline: none;
}

.pwlc-app .pwlc-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

.pwlc-app .pwlc-button:disabled,
.pwlc-app .pwlc-button[disabled] {
  background-color: #cbd5f5;
  color: #f8fafc;
  cursor: not-allowed;
  box-shadow: none;
}

.pwlc-app .pwlc-button--ghost {
  background-color: #ffffff;
  color: #2563eb;
  border-color: #cbd5f5;
}

.pwlc-app .pwlc-button--ghost:hover {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.pwlc-app .pwlc-button--ghost:disabled,
.pwlc-app .pwlc-button--ghost[disabled] {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.pwlc-app .pwlc-button--success {
  background-color: #16a34a;
}

.pwlc-app .pwlc-button--success:hover {
  background-color: #15803d;
}

.pwlc-app .pwlc-button--danger {
  background-color: #dc2626;
}

.pwlc-app .pwlc-button--danger:hover {
  background-color: #b91c1c;
}

.pwlc-app .pwlc-button--muted {
  background-color: #1f2937;
}

.pwlc-app .pwlc-button--muted:hover {
  background-color: #111827;
}

.pwlc-app .pwlc-button--sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.pwlc-app .pwlc-button--xs {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.pwlc-app .pwlc-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1 1 0%;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  background-color: #f1f5f9;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.pwlc-app .pwlc-tab-button:hover {
  background-color: #e2e8f0;
}

.pwlc-app .pwlc-tab-button:focus {
  outline: none;
}

.pwlc-app .pwlc-tab-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.pwlc-app .pwlc-tab-button--active {
  background-color: #2563eb;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.pwlc-app .pwlc-tab-button--utility {
  flex: 0 0 auto;
  width: auto;
  min-width: 150px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .pwlc-app .pwlc-tab-button--utility {
    width: 100%;
  }
}

.pwlc-app .pwlc-tab-button--utility[disabled],
.pwlc-app .pwlc-tab-button--utility-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.pwlc-app .pwlc-export-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  border: 1px solid #cbd5f5;
  background-color: #f8fafc;
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.pwlc-app .pwlc-export-button:hover {
  background-color: #e0e7ff;
  color: #1e40af;
}

.pwlc-app .pwlc-export-button:focus {
  outline: none;
}

.pwlc-app .pwlc-export-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.pwlc-app .pwlc-export-button__icon {
  font-size: 1.125rem;
  line-height: 1;
}

.pwlc-app .pwlc-export-button__label {
  line-height: 1;
}

.pwlc-app .pwlc-export-button[disabled],
.pwlc-app .pwlc-export-button--busy {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  background-color: #f1f5f9;
  color: #475569;
}

.pwlc-app .pwlc-exportable {
  font-size: 1rem;
  line-height: 1.6;
}

.pwlc-app .pwlc-exportable table,
.pwlc-app .pwlc-exportable th,
.pwlc-app .pwlc-exportable td {
  font-size: inherit;
  line-height: inherit;
}

.pwlc-app .pwlc-accordion-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: 0.9rem;
  border: 1px solid #d1d5db;
  background-color: #f8fafc;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.pwlc-app .pwlc-accordion-trigger:hover {
  background-color: #eef2ff;
}

.pwlc-app .pwlc-accordion-trigger:focus {
  outline: none;
}

.pwlc-app .pwlc-accordion-trigger:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.pwlc-app .pwlc-accordion-trigger__icon {
  font-size: 1.3rem;
  line-height: 1;
}

.pwlc-app .pwlc-static-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  border-radius: 0.75rem;
  border: 1px dashed #cbd5f5;
  background-color: #f8fafc;
  color: #475569;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.pwlc-app .pwlc-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: #0f172a;
}

.pwlc-app input[type="checkbox"].pwlc-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid #94a3b8;
  accent-color: #2563eb;
}

.pwlc-app input[type="checkbox"].pwlc-checkbox:focus {
  outline: none;
}

.pwlc-app input[type="checkbox"].pwlc-checkbox:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.pwlc-app .pwlc-stepper-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  background-color: #f3f4f6;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.pwlc-app .pwlc-stepper-button:hover {
  background-color: #e5e7eb;
}

.pwlc-app .pwlc-stepper-button:focus {
  outline: none;
}

.pwlc-app .pwlc-stepper-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.pwlc-app .pwlc-stepper-button:active {
  transform: translateY(1px);
}

.pwlc-app a {
  color: inherit;
}

.pwlc-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #f9fafb;
  color: #1f2937;
}

.pwlc-loading__spinner {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  border: 0.35rem solid #d1d5db;
  border-top-color: #2563eb;
  animation: pwlc-spin 0.9s linear infinite;
}

.pwlc-loading__text {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@keyframes pwlc-spin {
  to {
    transform: rotate(360deg);
  }
}

.pwlc-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.pwlc-toggle-card__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.01em;
}

.pwlc-app .pwlc-section-heading {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
  text-transform: none;
}

.pwlc-app .pwlc-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #4b5563;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.pwlc-app .pwlc-icon-button:hover {
  background-color: #f3f4f6;
}

.pwlc-app .pwlc-icon-button:focus {
  outline: none;
}

.pwlc-app .pwlc-icon-button:focus-visible {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.65);
}

.pwlc-app .pwlc-visual-controls {
  --pwlc-visual-control-size: 2.9rem;
  display: grid;
  grid-template-columns: repeat(3, var(--pwlc-visual-control-size));
  grid-template-rows: repeat(3, var(--pwlc-visual-control-size));
  gap: 0;
  padding: 0.5rem;
  border-radius: 1.4rem;
  background-color: transparent;
  box-shadow: none;
  color: #f8fafc;
}

.pwlc-app .pwlc-visual-controls__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--pwlc-visual-control-size);
  height: var(--pwlc-visual-control-size);
  padding: 0.1rem;
  border: none;
  border-radius: 0;
  background: rgba(37, 99, 235, 0.6);
  color: inherit;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pwlc-app .pwlc-visual-controls__button:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.72);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.32);
}

.pwlc-app .pwlc-visual-controls__button:focus {
  outline: none;
}

.pwlc-app .pwlc-visual-controls__button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.45), 0 16px 28px rgba(37, 99, 235, 0.32);
}

.pwlc-app .pwlc-visual-controls__button:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.pwlc-app .pwlc-visual-controls__button--zoom-in {
  border-top-left-radius: 1.2rem;
  border-top-right-radius: 1.2rem;
}

.pwlc-app .pwlc-visual-controls__button--pan-left {
  border-top-left-radius: 1.2rem;
  border-bottom-left-radius: 1.2rem;
}

.pwlc-app .pwlc-visual-controls__button--pan-right {
  border-top-right-radius: 1.2rem;
  border-bottom-right-radius: 1.2rem;
}

.pwlc-app .pwlc-visual-controls__button--zoom-out {
  border-bottom-left-radius: 1.2rem;
  border-bottom-right-radius: 1.2rem;
}

.pwlc-app .pwlc-visual-controls__icon {
  font-size: 1.4rem;
  line-height: 1;
  color: currentColor;
  transition: color 0.2s ease;
}

.pwlc-app .pwlc-visual-controls__button:hover .pwlc-visual-controls__icon,
.pwlc-app .pwlc-visual-controls__button:focus-visible .pwlc-visual-controls__icon {
  color: #eef2ff;
}

.pwlc-app .pwlc-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 3.5rem;
  height: 1.9rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background-color: #d1d5db;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.18);
  appearance: none;
  -webkit-appearance: none;
}

.pwlc-app .pwlc-toggle-switch:hover {
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.24);
}

.pwlc-app .pwlc-toggle-switch:focus {
  outline: none;
}

.pwlc-app .pwlc-toggle-switch:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.pwlc-app .pwlc-toggle-switch__thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.25);
  transition: transform 0.3s ease;
}

.pwlc-app .pwlc-toggle-switch--on {
  background-color: #22c55e;
}

.pwlc-app .pwlc-toggle-switch--on .pwlc-toggle-switch__thumb {
  transform: translateX(1.6rem);
}

.pwlc-app .pwlc-toggle-switch:active .pwlc-toggle-switch__thumb {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.3);
}

.pwlc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .pwlc-toggle-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .pwlc-toggle-card__label {
    font-size: 0.9rem;
  }
}
