/* ==========================================================================
   Serum 2 Themer Bridge Stylesheet
   Inherits design tokens and aesthetic values from mesoneir.com styles.css
   ========================================================================== */

/* Token Mapping: Connect Osmotic variables to Mesoneir :root variables */
:root {
  --themer-bg: var(--background);
  --themer-sidebar: var(--sidebar);
  --themer-panel: var(--panel);
  --themer-panel-raised: var(--panel-raised);
  --themer-line: var(--line);
  --themer-accent: var(--accent);
  --themer-accent-dark: var(--accent-dark);
  --themer-ink: var(--ink);
  --themer-muted: var(--muted);
  --themer-dim: var(--dim);

  /* Osmotic App variable compatibility mappings */
  --bg-darkest: var(--background);
  --bg-sidebar: var(--sidebar);
  --bg-panel: var(--panel);
  --border-color: var(--line);
  --accent-cyan: var(--accent);
  --text-main: var(--ink);
  --text-muted: var(--muted);
  --font-family: var(--font-sans);
}

/* Page shell & layout */
.themer-page main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  background: var(--themer-bg);
}

.themer-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topline Header */
.themer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 16px 36px;
  border-bottom: 1px solid var(--themer-line);
  background: var(--themer-sidebar);
}

.themer-topline__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.themer-topline__location {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--themer-accent);
}

.themer-topline__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--themer-ink);
}

.themer-topline__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Form Inputs & Buttons matching Mesoneir aesthetic */
.themer-input {
  height: 38px;
  padding: 0 14px;
  background: var(--themer-panel);
  border: 1px solid var(--themer-line);
  color: var(--themer-ink);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.themer-input:focus {
  border-color: var(--themer-accent);
  box-shadow: 0 0 0 1px var(--themer-accent);
}

.themer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 160ms ease;
}

.themer-btn--primary {
  background: var(--themer-accent);
  color: #100e0a;
}

.themer-btn--primary:hover {
  background: var(--themer-accent-dark);
  color: #ffffff;
}

.themer-btn--subtle {
  background: transparent;
  border-color: var(--themer-line);
  color: var(--themer-muted);
}

.themer-btn--subtle:hover {
  background: var(--themer-panel);
  border-color: var(--themer-accent);
  color: var(--themer-ink);
}

/* Workspace layout */
.themer-workspace {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 72px);
}

/* Control sidebar */
.themer-controls {
  width: 380px;
  min-width: 320px;
  max-width: 420px;
  background: var(--themer-sidebar);
  border-right: 1px solid var(--themer-line);
  overflow-y: auto;
  max-height: calc(100vh - 72px);
  position: sticky;
  top: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.themer-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.themer-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--themer-line);
  padding-bottom: 8px;
}

.themer-panel__header h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--themer-dim);
}


/* Palette Presets */
.palette-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.palette-card {
  background: var(--themer-panel);
  border: 1px solid var(--themer-line);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.palette-card:hover {
  border-color: var(--themer-accent);
  background: var(--themer-panel-raised);
}

.palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.palette-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--themer-ink);
}

.palette-tags {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--themer-dim);
}

.palette-swatches {
  display: flex;
  height: 18px;
  border: 1px solid var(--themer-line);
  overflow: hidden;
}

.swatch {
  flex: 1;
  height: 100%;
}

/* Controls list & pickers */
.controls-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--themer-panel);
  border: 1px solid var(--themer-line);
  padding: 10px 14px;
  gap: 12px;
}

.control-item label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.control-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--themer-ink);
}

.desc {
  font-size: 10px;
  color: var(--themer-dim);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-wrap input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid var(--themer-line);
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.color-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-wrap input[type="color"]::-webkit-color-swatch {
  border: none;
}

.hex-val {
  font-family: monospace;
  font-size: 11px;
  color: var(--themer-muted);
  width: 56px;
  text-align: right;
}

/* Sliders */
.slider-item {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val {
  font-family: monospace;
  font-size: 11px;
  color: var(--themer-accent);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--themer-line);
  outline: none;
  border-radius: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--themer-accent);
  cursor: pointer;
  border: 1px solid #100e0a;
  transition: transform 120ms ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Center Synth Preview Area */
.themer-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--themer-bg);
  overflow: hidden;
}

.themer-preview__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--themer-line);
  background: var(--themer-panel);
}

.themer-preview__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--themer-muted);
}

.themer-preview__status {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--themer-accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.themer-preview__status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--themer-accent);
}

.themer-canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background-image: radial-gradient(var(--themer-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

#preview-canvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--themer-line);
  background: #080807;
}

/* Modal & Progress Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 7, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.modal {
  background: var(--themer-sidebar);
  border: 1px solid var(--themer-line);
  padding: 32px 36px;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--themer-line);
  border-top-color: var(--themer-accent);
  border-radius: 50%;
  animation: themer-spin 0.8s linear infinite;
}

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

.modal h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--themer-ink);
}

.modal p {
  margin: 0;
  font-size: 12px;
  color: var(--themer-muted);
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background: var(--themer-line);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--themer-accent);
  transition: width 150ms ease;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 980px) {
  .themer-page main {
    margin-left: 0;
    margin-top: 65px;
  }

  .themer-shell {
    min-height: auto;
  }

  .themer-workspace {
    flex-direction: column;
    min-height: auto;
  }

  .themer-controls {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--themer-line);
  }

  .themer-preview {
    min-height: 480px;
  }

  .themer-canvas-container {
    min-height: 400px;
  }
}

@media (max-width: 600px) {
  .themer-topline {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .themer-topline__actions {
    width: 100%;
  }

  .themer-topline__actions .themer-input {
    flex: 1;
  }
}


/* ==========================================================================
   Serum Themer SEO & Guide Styles + Post-Export Conversion
   ========================================================================== */

.themer-seo-section {
  border-top: 1px solid var(--themer-line);
  background: var(--themer-bg);
  padding: 64px 32px 80px;
}

.themer-seo-container {
  max-width: 1080px;
  margin: 0 auto;
}

.themer-seo-header {
  margin-bottom: 40px;
}

.themer-seo-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 12px 0 14px;
}

.themer-seo-subtitle {
  color: var(--themer-muted);
  font-size: 15px;
  max-width: 640px;
  margin: 0;
  line-height: 1.7;
}

.themer-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.themer-guide-card {
  background: var(--themer-panel);
  border: 1px solid var(--themer-line);
  padding: 32px 28px;
}

.themer-guide-card h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--themer-ink);
  letter-spacing: -0.01em;
}

.themer-steps-list {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--themer-muted);
  font-size: 13px;
  line-height: 1.65;
}

.themer-steps-list strong {
  color: var(--themer-ink);
}

.themer-steps-list code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  font-family: monospace;
  font-size: 12px;
  border: 1px solid var(--themer-line);
  color: var(--themer-accent);
}

.themer-faq-item {
  margin-bottom: 20px;
}

.themer-faq-item:last-child {
  margin-bottom: 0;
}

.themer-faq-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--themer-ink);
}

.themer-faq-item p {
  margin: 0;
  font-size: 13px;
  color: var(--themer-muted);
  line-height: 1.65;
}

.themer-promo-banner {
  background:
    radial-gradient(ellipse at 80% 50%, rgba(200, 166, 107, 0.1), transparent 60%),
    var(--themer-sidebar);
  border: 1px solid var(--themer-line);
  padding: 36px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.themer-promo-banner__copy h3 {
  margin: 8px 0 10px;
  font-size: 22px;
  font-weight: 500;
  color: var(--themer-ink);
}

.themer-promo-banner__copy p {
  margin: 0;
  font-size: 14px;
  color: var(--themer-muted);
  max-width: 620px;
  line-height: 1.7;
}

.themer-promo-banner__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Post-export modal card */
.export-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.export-success.hidden {
  display: none;
}

.export-success__badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--themer-accent);
}

.export-success__text {
  font-size: 13px;
  color: var(--themer-muted);
  line-height: 1.65;
  margin: 0;
}

.export-success__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

