/* =============================================
   EDITOR STYLES — Fixed Clipping Magic Dual Pane
   ============================================= */

html, body {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: #e9ecef;
  font-family: var(--font-sans);
}

/* TOP TOOLBAR */
.cm-toolbar {
  height: 48px;
  min-height: 48px;
  background-color: #ffffff;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 100;
}

.cm-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cm-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.cm-btn:hover {
  background-color: #f8f9fa;
  border-color: #ced4da;
  color: #212529;
}

.cm-btn.active {
  background-color: #e6f0ff;
  border-color: #0066ff;
  color: #0066ff;
}

.circle-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.green-bg { background-color: #28a745; }
.red-bg { background-color: #dc3545; }

.cm-divider {
  width: 1px;
  height: 24px;
  background-color: #dee2e6;
  margin: 0 8px;
}

.btn-download-primary {
  height: 34px;
  padding: 0 16px;
  background-color: #0066ff;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-download-primary:hover {
  background-color: #0052cc;
}

/* WORKSPACE DUAL PANES */
.cm-workspace {
  flex: 1;
  display: flex;
  flex-direction: row;
  width: 100%;
  height: calc(100vh - 48px - 38px);
  overflow: hidden;
  position: relative;
  background-color: #d0d7de;
}

.cm-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.cm-pane-header {
  height: 30px;
  min-height: 30px;
  background-color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #ced4da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  z-index: 10;
  user-select: none;
}

.cm-pane-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
}

.cm-pane-body canvas {
  display: block;
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

#marksCanvas {
  position: absolute;
  pointer-events: auto;
  cursor: crosshair;
}

.cm-splitter {
  width: 2px;
  background-color: #495057;
  height: 100%;
  z-index: 20;
}

/* BOTTOM BAR */
.cm-bottom-bar {
  height: 38px;
  min-height: 38px;
  background-color: #ffffff;
  border-top: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-sizing: border-box;
  flex-shrink: 0;
  font-size: 12px;
  color: #6c757d;
  z-index: 100;
}

.bottom-bar-group {
  display: flex;
  align-items: center;
  gap: 18px;
}

.bottom-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #495057;
}

.bottom-item:hover {
  color: #0066ff;
}

.pill-btn {
  background-color: #0066ff;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.bottom-bar-center {
  font-size: 12px;
  color: #495057;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
}

.bottom-bar-right {
  font-weight: 600;
  color: #495057;
  font-size: 12px;
}
