/* admin-modules.css */
:root {
  /* Accent variables used across wizard preview and utilities */
  --accent: #177BFE;
  --accent-contrast: #fff;
}

.accent-bg {
  background: var(--accent);
  color: var(--accent-contrast);
}

.accent-text {
  color: var(--accent);
}

.accent-border {
  border-color: var(--accent);
}

.modules-wizard {
  padding: 8px 0;
}

.modules-wizard .wizard-stepper {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.modules-wizard .wizard-stepper .step {
  padding: 6px 10px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  cursor: pointer;
  border-radius: 6px;
}

.modules-wizard .wizard-stepper .step.active {
  background: #177BFE;
  color: #fff;
  border-color: #177BFE;
}

.modules-wizard .wizard-pages {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.modules-wizard .wizard-pane {
  min-height: 140px;
}

/* Module preview card (legacy compat; aligned to skeleton where possible) */
.module-preview-card {
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgb(0 0 0 / 6%);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .12s ease;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.module-preview-card:hover {
  box-shadow: 0 12px 28px rgb(0 0 0 / 12%);
}

/* Legacy accent stripe kept (no-op for new skeleton) */
.module-preview-card .mpc-accent {
  height: 6px;
  background: var(--mod-accent, #177BFE);
}

.module-preview-card .mpc-body {
  padding: 14px 16px;
}

.module-preview-card .mpc-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-preview-card .mpc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: color-mix(in srgb, var(--mod-accent, #177BFE) 85%, #000 0%);
}

@supports not (background: color-mix(in srgb, #000, #fff)) {
  .module-preview-card .mpc-icon {
    background: var(--mod-accent, #177BFE);
  }
}

.module-preview-card .mpc-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  margin: 6px 0 0;
  color: #111;
}

.module-preview-card .mpc-sub {
  font-size: .75rem;
  color: #6b7280;
}

.module-preview-card .mpc-desc {
  margin: 10px 0 4px;
  color: #374151;
  font-size: .9rem;
}

.module-preview-card .mpc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
}

.module-preview-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
}

.module-preview-card .badge-free {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.module-preview-card .badge-paid {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.module-preview-card .badge-schools {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.module-preview-card .mpc-actions {
  margin-top: 12px;
}

.module-preview-card .btn.primary {
  background: var(--mod-accent, #177BFE);
  border-color: var(--mod-accent, #177BFE);
  color: #fff;
}

/* === WTV Wizard Skeleton === */

/* Stepper */
.wtv-stepper {
  margin: 8px 0 16px;
}

.wtv-stepper ol {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.wtv-stepper li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #808080;
  font-weight: 600;
}

.wtv-stepper li span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #d0d0d0;
}

.wtv-stepper li.is-active {
  color: #111;
}

.wtv-stepper li.is-active span {
  border-color: #177BFE;
  color: #177BFE;
}

/* Layout */
.wtv-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

.wtv-form-col {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 6%);
  padding: 20px;
}

.wtv-preview-col {
  position: sticky;
  top: 12px;
}

@media (width <= 1024px) {
  .wtv-grid {
    grid-template-columns: 1fr;
  }

  .wtv-preview-col {
    position: static;
  }
}

.wtv-field {
  margin-bottom: 16px;
}

.wtv-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wtv-sep {
  border: 0;
  border-top: 1px solid #eee;
  margin: 16px 0;
}

.wtv-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.wtv-btn {
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .05s ease, box-shadow .15s ease, background-color .2s ease;
}

.wtv-btn.primary {
  background: #177BFE;
  color: #fff;
}

.wtv-btn.primary:hover {
  filter: brightness(0.98);
}

.wtv-btn.primary:focus-visible {
  outline: 2px solid #0b6ad8;
  outline-offset: 2px;
}

.wtv-btn.ghost {
  background: #fff;
  color: #111;
  border-color: #ddd;
}

.wtv-btn.ghost:hover {
  background: #f7f7f7;
}

.wtv-btn.ghost:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* Preview card (skeleton specifics) */
.module-preview-card .mpc-icon-wrap {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: #F3F8FF;
  overflow: hidden;
}

.module-preview-card .mpc-subtitle {
  margin: 4px 0 8px;
  font-size: 14px;
  color: #666;
}

.module-preview-card .mpc-cta {
  margin-top: 6px;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: #177BFE;
  color: #fff;
  font-weight: 800;
  border: 0;
  cursor: pointer;
}

.module-preview-card .mpc-cta:hover {
  opacity: .95;
}

.module-preview-card .mpc-cta:focus-visible {
  outline: 2px solid #0b6ad8;
  outline-offset: 2px;
}

/* Accent preview (will be set inline by JS) */
.module-preview-card[data-accent] {
  --acc: var(--accent-color, #177BFE);
}

/* === Icon Gallery === */
.icon-gallery-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 45%);
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Ensure the hidden attribute actually hides the overlay */
.icon-gallery-overlay[hidden] {
  display: none !important;
}

/* Only show overlay when it is not hidden */
.icon-gallery-overlay:not([hidden]) {
  display: grid;
}

.icon-gallery {
  width: min(980px, 100%);
  max-height: min(80vh, 840px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgb(0 0 0 / 22%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.icon-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.icon-gallery-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-gallery-search {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 220px;
}

.icon-gallery-grid {
  padding: 14px 16px 18px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .05s ease, border-color .15s ease;
}

.icon-item:hover {
  box-shadow: 0 8px 20px rgb(0 0 0 / 10%);
  border-color: #dbeafe;
}

.icon-item:focus-visible {
  outline: 2px solid #0b6ad8;
  outline-offset: 2px;
}

.icon-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.icon-name {
  font-size: 12px;
  color: #555;
}

.icon-gallery-empty {
  padding: 24px;
  text-align: center;
  color: #666;
}

/* === Icon upload dropzone and progress === */
.mod-icon-dropzone {
  position: relative;
  min-height: 40px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  padding: 8px;
  transition: background-color .15s ease, border-color .15s ease;
}

.mod-icon-dropzone.is-dragover {
  background: #f0f7ff;
  border-color: #60a5fa;
}

.mod-icon-dropzone .drop-hint {
  display: none;
  font-size: 12px;
  color: #6b7280;
}

.mod-icon-preview img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}

.upload-progress {
  height: 6px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.upload-progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width .2s ease;
  border-radius: 999px;
}
