/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  transition: background-color 0.3s, border-color 0.3s;
}

.header__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.header__filename {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-left: 16px;
  display: none;
}

.header__filename.visible {
  display: inline;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Workspace: 에디터 + 콘텐츠 분할 ── */
.workspace {
  display: none;
  margin-top: 60px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.workspace.visible {
  display: flex;
}

.editor-pane {
  display: none;
  flex-direction: column;
  width: 42%;
  min-width: 320px;
  max-width: 760px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background-color 0.3s, border-color 0.3s;
}

.workspace.editing .editor-pane {
  display: flex;
}

.editor-pane__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
}

.editor-pane__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.editor-pane__hint {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
}

.editor-pane__textarea {
  flex: 1;
  width: 100%;
  padding: 16px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  tab-size: 4;
}

.content-pane {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  min-width: 0;
}

@media (max-width: 768px) {
  .workspace.editing {
    flex-direction: column;
  }
  .workspace.editing .editor-pane {
    width: 100%;
    max-width: none;
    height: 45%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}

/* ── Filter Bar (content-pane 내부 sticky) ── */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: none;
  transition: background-color 0.3s, border-color 0.3s;
}

.filter-bar.visible {
  display: block;
}

.filter-bar__inner {
  display: flex;
  gap: 6px;
  padding: 8px 24px;
  overflow-x: auto;
}

/* Drop Zone */
.drop-zone-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  margin-top: 60px;
  padding: 32px;
}

.drop-zone-wrapper.hidden {
  display: none;
}

/* Diagram Container */
.diagram-container {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
  padding: 24px;
}

.diagram-container.visible {
  display: grid;
}

@media (max-width: 560px) {
  .diagram-container {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
}

/* ── Panels (Theme & Shape) ── */
.theme-panel,
.shape-panel {
  position: fixed;
  top: 60px;
  right: 0;
  width: 340px;
  height: calc(100vh - 60px);
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  z-index: 90;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease, background-color 0.3s, border-color 0.3s;
}

.theme-panel.open,
.shape-panel.open {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .theme-panel,
  .shape-panel {
    width: 100%;
  }
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Print 스타일은 css/print.css 에서 관리 */
