/* ============================================================
   NIA INVITE — DESIGN THEME BUILDER
   ============================================================ */

.theme-page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
}


/* ------------------------------------------------------------
   HEADER
   ------------------------------------------------------------ */

.theme-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.theme-eyebrow {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  margin-bottom: 6px;
}

.theme-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
}

.theme-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.theme-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* ------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------ */

.theme-btn {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: 0.2s ease;
}

.theme-btn:hover {
  transform: translateY(-1px);
}

.theme-btn-secondary {
  background: var(--surface);
  color: var(--text);
}

.theme-btn-gold {
  background: var(--gold-gradient);
  color: #17120a;
  border-color: var(--border-gold);
}


/* ------------------------------------------------------------
   PANEL
   ------------------------------------------------------------ */

.theme-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 18px;
  margin-bottom: 16px;
}

.theme-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.theme-panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.theme-panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}


/* ------------------------------------------------------------
   SELECT
   ------------------------------------------------------------ */

.theme-select,
.theme-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
}

.theme-select:focus,
.theme-input:focus {
  border-color: var(--border-gold);
}


/* ------------------------------------------------------------
   LAYOUT
   ------------------------------------------------------------ */

.theme-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.theme-main {
  min-width: 0;
}

.theme-preview-panel {
  position: sticky;
  top: 20px;
}


/* ------------------------------------------------------------
   FORM
   ------------------------------------------------------------ */

.theme-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.theme-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.theme-form-grid span,
.theme-color-field > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.theme-field-wide {
  grid-column: 1 / -1;
}

textarea.theme-input {
  resize: vertical;
}


/* ------------------------------------------------------------
   COLORS
   ------------------------------------------------------------ */

.theme-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-color-field {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px;
}

.theme-color-control {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  margin-top: 7px;
}

.theme-color-control input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}


/* ------------------------------------------------------------
   TOGGLES
   ------------------------------------------------------------ */

.theme-toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.theme-toggle {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.72rem;
  cursor: pointer;
}

.theme-toggle input {
  accent-color: var(--gold);
}

.theme-range {
  display: block;
  margin-top: 15px;
}

.theme-range > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 8px;
}

.theme-range strong {
  color: var(--gold);
}

.theme-range input {
  width: 100%;
  accent-color: var(--gold);
}


/* ------------------------------------------------------------
   DECORATIVE ASSETS
   ------------------------------------------------------------ */

.theme-asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.theme-asset-slot {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.theme-asset-slot strong {
  display: block;
  color: var(--text);
  font-size: 0.75rem;
}

.theme-asset-slot small {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  margin-top: 4px;
}


/* ------------------------------------------------------------
   PREVIEW
   ------------------------------------------------------------ */

.theme-preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
}

.theme-preview-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.theme-preview-head span {
  display: block;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.theme-preview-head strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 0.9rem;
}


.theme-preview {
  position: relative;
  min-height: 510px;
  overflow: hidden;

  background:
    var(--tp-background);

  color: var(--tp-text);

  display: flex;
  align-items: center;
  justify-content: center;

  isolation: isolate;

  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}


.theme-preview::before {
  content: "";
  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      145deg,
      var(--tp-primary),
      transparent 55%,
      var(--tp-accent)
    );

  opacity: var(--tp-overlay);
  z-index: -1;
}


.theme-preview.has-gradient {
  background:
    linear-gradient(
      145deg,
      var(--tp-background),
      var(--tp-surface)
    );
}


.theme-preview.has-glow {
  box-shadow:
    inset 0 0 80px
    var(--tp-primary);
}


.theme-preview.has-shadow
  .theme-preview-content {
  box-shadow:
    0 18px 50px
    rgba(0,0,0,0.35);
}


.theme-preview.has-blur::before {
  filter: blur(22px);
  transform: scale(1.15);
}


.theme-preview-content {
  width: 76%;
  max-width: 290px;
  padding: 30px 22px;
  text-align: center;

  border:
    1px solid
    var(--tp-border);

  border-radius: 18px;

  background:
    color-mix(
      in srgb,
      var(--tp-surface) 82%,
      transparent
    );

  backdrop-filter: blur(8px);
}


.theme-preview-content small {
  color: var(--tp-accent);
  letter-spacing: 3px;
  font-size: 0.58rem;
}


.theme-preview-content h1 {
  margin: 14px 0 8px;
  color: var(--tp-text);
  font-family: var(--tp-heading-font);
  font-size: 2rem;
}


.theme-preview-content p {
  color: var(--tp-muted);
  font-family: var(--tp-body-font);
  font-size: 0.75rem;
}


.theme-preview-divider {
  width: 45px;
  height: 1px;
  margin: 18px auto;
  background: var(--tp-accent);
}


.theme-preview-content button {
  border: 1px solid var(--tp-accent);
  background: transparent;
  color: var(--tp-text);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 1px;
}


.theme-preview-ornament {
  position: absolute;
  top: 18px;
  right: 22px;
  color: var(--tp-accent);
  font-size: 1.5rem;
}


.theme-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.65rem;
}


/* ------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------ */

@media (max-width: 900px) {

  .theme-grid {
    grid-template-columns: 1fr;
  }

  .theme-preview-panel {
    position: relative;
    top: auto;
  }

}


@media (max-width: 650px) {

  .theme-page {
    padding: 14px;
  }

  .theme-header {
    flex-direction: column;
  }

  .theme-header-actions {
    width: 100%;
  }

  .theme-header-actions button {
    flex: 1;
  }

  .theme-form-grid,
  .theme-color-grid,
  .theme-asset-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}
