/*
 * OPLEX — pulpit configuration modal styles.
 * Loaded by frontend/index.html alongside dashboard-home.css. The modal
 * itself lives on document.body (teleported), so its styles live outside
 * the .dash-content scope.
 */

.pulpit-config-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.pulpit-config-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pulpit-config-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.pulpit-config-modal__panel {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transform: translateY(-8px);
  transition: transform 200ms ease;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e5e7eb;
}

.pulpit-config-modal.is-open .pulpit-config-modal__panel {
  transform: translateY(0);
}

.pulpit-config-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pulpit-config-modal__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f3f4f6;
  letter-spacing: -0.01em;
}

.pulpit-config-modal__close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.pulpit-config-modal__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f3f4f6;
}

.pulpit-config-modal__body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pulpit-config-modal__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

.pcm-footer-spacer { flex: 1; }

/* ---------- Sections ---------- */

.pcm-section { display: flex; flex-direction: column; gap: 8px; }

.pcm-section__title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.pcm-section__hint {
  margin: 0 0 4px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

/* ---------- Order list ---------- */

.pcm-order {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pcm-order__empty {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  background: rgba(239, 68, 68, 0.06);
  border: 1px dashed rgba(239, 68, 68, 0.25);
  border-radius: 8px;
}

.pcm-order__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: grab;
  transition: background 100ms, border-color 100ms, opacity 100ms;
}

.pcm-order__item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.pcm-order__item.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.pcm-order__item.is-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.pcm-order__handle {
  color: #6b7280;
  cursor: grab;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.pcm-order__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pcm-order__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pcm-order__label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #e5e7eb;
}

.pcm-order__arrows {
  display: inline-flex;
  gap: 2px;
}

.pcm-order__arrow {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}

.pcm-order__arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: #f3f4f6;
}

.pcm-order__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ---------- Catalog ---------- */

.pcm-catalog {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pcm-catalog__group { display: flex; flex-direction: column; gap: 6px; }

.pcm-catalog__group-title {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.pcm-catalog__items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.pcm-catalog__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: background 100ms, border-color 100ms;
}

.pcm-catalog__item:hover { background: rgba(255, 255, 255, 0.05); }

.pcm-catalog__item.is-checked {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.30);
}

.pcm-catalog__item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.pcm-catalog__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pcm-catalog__icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pcm-catalog__label {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: #d1d5db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcm-flash {
  animation: pcm-flash-anim 320ms ease;
}

@keyframes pcm-flash-anim {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  100% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ---------- Radios + checkboxes ---------- */

.pcm-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pcm-radios label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #d1d5db;
  transition: background 100ms, border-color 100ms;
}

.pcm-radios label:hover { background: rgba(255, 255, 255, 0.05); }

.pcm-radios input[type="radio"] {
  width: 12px;
  height: 12px;
  accent-color: #3b82f6;
}

.pcm-radios label:has(input:checked) {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.40);
  color: #93c5fd;
}

.pcm-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pcm-checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #d1d5db;
  cursor: pointer;
}

.pcm-checks input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
}

.pcm-subsection {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.pcm-subsection__label {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

/* ---------- Footer buttons ---------- */

.pcm-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
  font-family: inherit;
}

.pcm-btn--primary {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.pcm-btn--primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.pcm-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.pcm-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.20);
  color: #f3f4f6;
}
