/* ============================================================
   THEME CREATOR STYLES
   theme.css — Theme panel, color pickers, background controls
   ============================================================ */

.theme-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

.theme-panel.active { transform: translateX(0); }

.theme-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.theme-panel-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-primary);
}

.theme-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.theme-section {
  margin-bottom: var(--space-xl);
}

.theme-section-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: white; box-shadow: var(--shadow-glow); }

.color-picker-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.color-picker-input {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  padding: 0;
}

.color-picker-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-input::-webkit-color-swatch {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
}

/* Theme panel sliders — alpha, line thickness, future numeric controls.
   Layout: label, slider, value-readout in a single horizontal row. */
.theme-slider-row {
  display: grid;
  grid-template-columns: 90px 1fr 48px;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.theme-slider-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 600;
}
.theme-slider {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}
.theme-slider-val {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  text-align: right;
}

/* ============================================================
   TABBED SECTIONS — used by:
     - Theme panel: Background tabs (Color / Gradient / Image)
     - Settings modal: Admin / Appearance / Animations
   *Why a shared style?* — Identical visual treatment keeps both
   surfaces feeling like the same product.
   ============================================================ */
.theme-tabs,
.settings-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-medium);
  margin-bottom: var(--space-md);
}
.theme-tab,
.settings-tab {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  /* Pull the bottom border down so it sits on the parent's border line. */
  margin-bottom: -1px;
}
.theme-tab:hover,
.settings-tab:hover { color: var(--text-primary); }
.theme-tab.active,
.settings-tab.active {
  color: var(--accent-primary-light);
  border-bottom-color: var(--accent-primary);
}
.theme-tab-pane[hidden],
.settings-tab-pane[hidden] { display: none; }

.bg-image-upload {
  width: 100%;
  padding: var(--space-xl);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.bg-image-upload:hover {
  border-color: var(--accent-primary);
  color: var(--text-secondary);
}

.bg-image-preview {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  margin-top: var(--space-sm);
}

/* Share modal */
.share-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.share-link-row {
  display: flex;
  gap: var(--space-sm);
}

.share-link-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  outline: none;
}

/* Manager list */
.manager-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.manager-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.manager-item-name { color: var(--text-primary); font-weight: 500; }
.manager-item-role { color: var(--text-muted); font-size: var(--fs-xs); }

/* Image crop modal */
.crop-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.crop-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.crop-canvas { display: block; width: 100%; cursor: crosshair; }

.crop-options {
  display: flex;
  gap: var(--space-md);
  width: 100%;
}

.crop-option {
  flex: 1;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.crop-option:hover { border-color: var(--border-medium); }
.crop-option.active { border-color: var(--accent-primary); background: rgba(108,92,231,0.1); }

.crop-option-icon { font-size: var(--fs-xl); margin-bottom: var(--space-xs); }
.crop-option-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.crop-option-desc { font-size: var(--fs-xs); color: var(--text-muted); }

@media (max-width: 768px) {
  .theme-panel { width: 100%; }
}
