/* ═══════════════════════════════════════════
   THEME MODAL — Premium Create Theme Interface
   ═══════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.theme-modal {
  background: #f8fafc;
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .theme-modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #475569;
}

.theme-modal-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  flex: 1;
  overflow: hidden;
}

/* ── Left Preview Pane ── */
.theme-preview-pane {
  background: #f1f5f9;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.theme-preview-canvas {
  width: 100%;
  aspect-ratio: 16/9;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 32px;
}

.theme-preview-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

.theme-preview-logo {
  position: absolute;
  top: 24px;
  right: 24px;
  max-width: 100px;
  max-height: 40px;
  object-fit: contain;
  z-index: 2;
}

.theme-preview-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.theme-preview-question {
  font-size: 24px;
  font-weight: 800;
  max-width: 80%;
  line-height: 1.2;
}

.theme-preview-chart {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 20px 0;
}

.bar-sim {
  flex: 1;
  border-radius: 4px 4px 0 0;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ── Right Controls Pane ── */
.theme-controls-pane {
  padding: 24px;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.control-row .label {
  margin: 0;
  font-weight: 600;
  color: #475569;
}

.upload-btn-wrap .btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 16px;
  font-weight: 600;
  color: #64748b;
}

.color-circle-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.color-circle-wrap input[type="color"] {
  position: absolute;
  inset: -10px;
  width: 60px;
  height: 60px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

.text-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.palette-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.palette-preview {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.palette-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.palette-swatch:hover {
  transform: scale(1.2);
}

.modal-footer {
  margin-top: auto;
  padding-top: 24px;
}

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-block:hover {
  background: #6d28d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.hidden {
  display: none !important;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  font-size: 10px;
  cursor: help;
  margin-left: 4px;
}
