/**
 * Maintenance Center admin styles.
 *
 * @package Polanger_Maintenance_Center
 */

.pmc-admin {
  margin-top: 20px;
}

.pmc-admin,
.pmc-admin * {
  box-sizing: border-box;
}

.pmc-admin__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 22px;
  margin-bottom: 24px;
  padding: 30px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.34), transparent 42%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 52%, #312e81 100%);
  color: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16);
}

.pmc-admin__eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pmc-admin__hero-copy h2 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #ffffff;
}

.pmc-admin__hero-copy p {
  margin: 0;
  max-width: 60rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.75;
}

.pmc-admin__hero-state {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pmc-admin__hero-state--live {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.14);
}

.pmc-admin__hero-state--idle,
.pmc-admin__hero-state--scheduled {
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.pmc-admin__hero-state--warning {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.24);
}

.pmc-admin__hero-label {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pmc-admin__hero-state strong {
  font-size: 24px;
  line-height: 1.2;
}

.pmc-admin__hero-state p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.pmc-admin__hero-state .button {
  width: fit-content;
}

.pmc-admin__hero-state .button,
.pmc-admin__hero-state .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-color: rgba(255, 255, 255, 0.88);
  background: #ffffff;
  color: #1e1b4b;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
}

.pmc-admin__hero-state .button:hover,
.pmc-admin__hero-state .button:focus,
.pmc-admin__hero-state .button-secondary:hover,
.pmc-admin__hero-state .button-secondary:focus {
  border-color: #ffffff;
  background: #eef2ff;
  color: #111827;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.3);
}

.pmc-admin__layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}

.pmc-admin__nav,
.pmc-panel,
.pmc-summary-card {
  border: 1px solid #dbe4f0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.pmc-admin__nav {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.pmc-admin__nav-item {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  color: #334155;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.pmc-admin__nav-item:hover,
.pmc-admin__nav-item:focus {
  background: #eef2ff;
  color: #312e81;
  text-decoration: none;
}

.pmc-admin__nav-item.is-active {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(79, 70, 229, 0.18);
}

.pmc-admin__content {
  min-width: 0;
}

.pmc-admin__summary {
  position: sticky;
  top: 110px;
}

.pmc-panel {
  padding: 26px;
}

.pmc-panel__head {
  margin-bottom: 24px;
}

.pmc-panel__head h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.pmc-panel__head p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
}

.pmc-subsection {
  display: grid;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.pmc-subsection__head {
  display: grid;
  gap: 6px;
}

.pmc-subsection__head h4 {
  margin: 0;
  font-size: 18px;
}

.pmc-subsection__head p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.pmc-content-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
}

.pmc-content-card__head {
  display: grid;
  gap: 6px;
}

.pmc-content-card__head h5 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #111827;
}

.pmc-content-card__head p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.pmc-content-card__grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

.pmc-content-card__grid--media {
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 320px);
}

.pmc-content-card__grid--text {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.pmc-content-card__grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pmc-stack {
  display: grid;
  gap: 22px;
}

.pmc-grid {
  display: grid;
  gap: 18px;
}

.pmc-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pmc-grid--content {
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
}

.pmc-field {
  display: grid;
  gap: 8px;
}

.pmc-field > label {
  margin: 0;
}

.pmc-field .description,
.pmc-toggle-row .description,
.pmc-preview-card__head p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.pmc-form textarea,
.pmc-form select,
.pmc-form input[type="text"],
.pmc-form input[type="url"],
.pmc-form input[type="number"],
.pmc-form input[type="datetime-local"] {
  width: 100%;
}

.pmc-toggle-row {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #f8fafc;
}

.pmc-toggle-row .pdt-toggle-switch {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pmc-mode-grid,
.pmc-role-grid,
.pmc-check-grid {
  display: grid;
  gap: 12px;
}

.pmc-mode-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pmc-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.pmc-check-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.pmc-mode-card,
.pmc-role-card,
.pmc-check-card,
.pmc-alignment-option {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: #f8fafc;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.pmc-mode-card:hover,
.pmc-role-card:hover,
.pmc-check-card:hover,
.pmc-alignment-option:hover,
.pmc-mode-card:focus-within,
.pmc-role-card:focus-within,
.pmc-check-card:focus-within,
.pmc-alignment-option:focus-within {
  transform: translateY(-1px);
  border-color: #94a3ff;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.09);
}

.pmc-mode-card.is-selected,
.pmc-role-card.is-selected,
.pmc-check-card.is-selected,
.pmc-alignment-option.is-selected {
  border-color: #4f46e5;
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.98)),
    #ffffff;
  box-shadow: 0 16px 32px rgba(79, 70, 229, 0.1);
}

.pmc-mode-card input,
.pmc-role-card input,
.pmc-check-card input {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.pmc-mode-card__title,
.pmc-role-card__label,
.pmc-check-card__title {
  display: block;
  padding-right: 24px;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.pmc-mode-card__description,
.pmc-role-card__hint,
.pmc-check-card__description {
  display: block;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.pmc-alignment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pmc-alignment-option {
  min-width: 108px;
  max-width: 160px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.pmc-alignment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pmc-alignment-option__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 18px;
}

.pmc-alignment-option__label {
  display: block;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.pmc-alignment-option.is-selected .pmc-alignment-option__icon {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
}

.pmc-content-card .pmc-alignment-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pmc-alignment-options--icons-only {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pmc-alignment-options--icons-only .pmc-alignment-option {
  min-width: 0;
  max-width: none;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: 0;
  padding: 14px;
}

.pmc-content-card .pmc-alignment-option {
  min-width: 0;
  max-width: none;
  padding: 5px 16px;
  border-radius: 0px;
  background: #f8fafc;
  box-shadow: none;
}

.pmc-content-card .pmc-alignment-option:hover,
.pmc-content-card .pmc-alignment-option:focus-within {
  transform: none;
  border-color: #cbd5e1;
  box-shadow: none;
}

.pmc-content-card .pmc-alignment-option.is-selected {
  border-color: #4f46e5;
  box-shadow: none;
}

.pmc-media {
  display: grid;
  gap: 12px;
}

.pmc-media__preview {
  position: relative;
  min-height: 190px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(129, 140, 248, 0.08), rgba(15, 23, 42, 0.04)),
    #f8fafc;
  overflow: hidden;
  text-align: center;
  color: #64748b;
}

.pmc-media__preview.has-image {
  border-style: solid;
}

.pmc-media__preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #ffffff;
}

.pmc-media__preview span {
  padding: 22px;
  font-size: 14px;
  line-height: 1.6;
}

.pmc-media__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pmc-preview-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #dbe4f0;
  border-radius: 22px;
  background: #f8fafc;
}

.pmc-preview-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
}

.pmc-preview-card__head h4 {
  margin: 0 0 6px;
  font-size: 17px;
}

.pmc-conditional {
  display: none;
}

.pmc-conditional.is-visible {
  display: grid;
  gap: 18px;
}

.pmc-form .wp-editor-wrap {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  overflow: hidden;
}

.pmc-form .wp-editor-tabs {
  padding: 0 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.pmc-form .mce-top-part::before,
.pmc-form .quicktags-toolbar {
  border-bottom-color: #e2e8f0;
}

.pmc-form .wp-editor-container textarea.wp-editor-area {
  border: 0;
}

.pmc-form .CodeMirror,
.pmc-form .CodeMirror-wrap {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
}

.pmc-editor-preview {
  padding: 16px 18px;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: #f8fafc;
}

.pmc-editor-preview p:last-child {
  margin-bottom: 0;
}

.pmc-summary-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.pmc-summary-card h3 {
  margin: 0 0 2px;
  font-size: 20px;
}

.pmc-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f7;
  color: #475569;
}

.pmc-summary-row strong {
  color: #0f172a;
}

.pmc-summary-label {
  display: block;
  margin-top: 4px;
}

.pmc-summary-card input[type="text"] {
  width: 100%;
}

.pmc-summary-button {
  width: 100%;
  justify-content: center;
}

.pmc-form .submit {
  margin-top: 24px;
}

@media (max-width: 1280px) {
  .pmc-admin__layout {
    grid-template-columns: 1fr;
  }

  .pmc-admin__nav,
  .pmc-admin__summary {
    position: static;
  }

  .pmc-admin__nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 1fr);
    overflow-x: auto;
  }
}

@media (max-width: 1100px) {
  .pmc-admin__hero,
  .pmc-grid--two,
  .pmc-grid--content,
  .pmc-mode-grid,
  .pmc-content-card__grid--media,
  .pmc-content-card__grid--text,
  .pmc-content-card__grid--two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 782px) {
  .pmc-admin__hero,
  .pmc-panel,
  .pmc-summary-card {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .pmc-admin__nav {
    grid-auto-columns: minmax(150px, 1fr);
  }

  .pmc-role-grid,
  .pmc-check-grid {
    grid-template-columns: 1fr;
  }

  .pmc-content-card .pmc-alignment-options {
    grid-template-columns: 1fr;
  }

  .pmc-alignment-options--icons-only {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pmc-alignment-option {
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
  }

  .pmc-media__actions,
  .pmc-preview-card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .pmc-admin__hero-state .button {
    width: 100%;
    justify-content: center;
  }
}
