/* ============================================
   A3 Score Maker — Static JS Version
   Theme: "Ableton Faithful" (Cyan accent)
   ============================================ */

@font-face {
    font-family: 'NanumBarunGothic';
    src: url('NanumBarunGothic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
  --bg: #0d0d0d;
  --card: #1a1a1a;
  --border: #2a2a2a;
  --accent: #4cc9f0;
  --text: #f0f0f0;
  --secondary: #999999;
  --highlight: #00e5a0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* 공통 네비 바 */
.mk-nav { position:relative; display:flex; align-items:center; justify-content:space-between; padding:0 18px; height:48px; background:var(--card); border-bottom:1px solid var(--border); flex-shrink:0; z-index:100; }
.mk-nav__title { position:absolute; left:210px; right:0; text-align:center; pointer-events:none; }
.mk-nav__back { color:var(--secondary); font-size:0.8rem; font-weight:600; text-decoration:none; transition:color 0.2s; }
.mk-nav__back:hover { color:var(--accent); }
.mk-nav__title { font-size:0.95rem; font-weight:700; color:var(--accent); }
.mk-nav__lang { background:var(--border); color:var(--text); border:1px solid var(--accent); padding:4px 12px; border-radius:20px; cursor:pointer; font-size:0.75rem; font-weight:600; transition:all 0.2s; }
.mk-nav__lang:hover { background:var(--accent); color:var(--bg); }

.app { display: flex; height: calc(100vh - 48px); }

/* Sidebar */
.sidebar {
    width: 210px; min-width: 210px; background: var(--card); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow-y: auto;
    flex-shrink: 0;
}
.sidebar h2 { padding: 10px 12px; font-size: 0.7rem; color: var(--secondary); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-section { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sidebar-section label { display: block; font-size: 12px; color: var(--secondary); margin-bottom: 5px; }
.sidebar-section input {
    width: 100%; padding: 8px; background: var(--border); border: 1px solid #333;
    color: #fff; border-radius: 4px; font-size: 13px;
}
.sidebar-section input:focus { outline: none; border-color: var(--accent); }

/* Upload area */
.upload-area {
    margin: 10px 12px; padding: 15px; border: 2px dashed #333;
    border-radius: 8px; text-align: center; cursor: pointer;
    transition: all 0.3s;
}
.upload-area:hover,
.upload-area.dragover { border-color: var(--accent); background: rgba(76, 201, 240, 0.1); }
.upload-area p { color: var(--secondary); font-size: 13px; }

/* Page pool */
.page-pool { padding: 10px 12px; flex: 1; overflow-y: auto; }
.page-pool-item {
    display: flex; align-items: center; padding: 6px; margin-bottom: 6px;
    background: var(--border); border-radius: 6px; cursor: grab; transition: all 0.2s;
}
.page-pool-item:hover { background: #333; }
.page-pool-item.in-layout { opacity: 0.4; }
.page-pool-item img { width: 40px; height: 56px; object-fit: cover; border-radius: 3px; margin-right: 8px; }
.page-pool-item .info { font-size: 11px; line-height: 1.4; }
.page-pool-item .info .filename { color: #ccc; font-weight: 500; }
.page-pool-item .info .pagenum { color: var(--secondary); }

/* Main content */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Toolbar */
.canvas-tb {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}
.tb-left, .tb-right { display: flex; gap: 6px; align-items: center; }
.tb-left { flex: 1; }
.tb-center { display: flex; gap: 6px; align-items: center; justify-content: center; }
.tb-right { flex: 1; justify-content: flex-end; }

.btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #333; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #3ab5d6; }
.btn-export { background: var(--highlight); color: var(--bg); }
.btn-export:hover { background: #00c98c; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Zoom controls */
.zoom-btn { padding: 4px 10px !important; font-size: 16px !important; line-height: 1; }

/* Layout canvas wrap */
.layout-canvas-wrap { flex: 1; position: relative; overflow: hidden; }

/* Layout canvas */
.layout-canvas { position: absolute; inset: 0; overflow: auto; padding: 20px; transition: background 0.2s; --sheet-max-width: 1100px; }
.layout-canvas.file-dragover { background: rgba(76, 201, 240, 0.05); outline: 2px dashed var(--accent); outline-offset: -10px; }

/* Empty state */
.canvas-empty { position: absolute; inset: 20px; border: 2px dashed #333; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  cursor: pointer; transition: all 0.3s; color: #999; z-index: 5; }
.canvas-empty:hover { border-color: var(--accent); color: var(--accent); }
.canvas-empty.hidden { display: none; }

.a3-sheet {
    background: #fff; margin: 0 auto 40px; position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4); border-radius: 4px;
    width: var(--sheet-max-width, 1100px); max-width: calc(100% - 40px); aspect-ratio: 1.414 / 1;
}
.a3-sheet .sheet-header {
    position: absolute; top: 0; left: 0; right: 0;
    padding: 8px 15px; display: flex; justify-content: space-between;
    font-size: var(--header-font, 12px); color: #333; font-weight: 500;
    font-family: 'NanumBarunGothic', 'Pretendard', -apple-system, sans-serif;
}
.a3-sheet .sheet-body {
    position: absolute; top: 30px; bottom: 10px; left: 10px; right: 10px;
    display: flex; gap: 5px; align-items: stretch;
    justify-content: flex-start;
}
.a3-col {
    flex: 1; display: flex; flex-direction: column; gap: 5px;
    min-height: 0; min-width: 0;
}
.a3-slot {
    flex: 1; border: 2px dashed #ccc; border-radius: 4px;
    display: flex; align-items: flex-start; justify-content: center;
    position: relative; transition: all 0.2s; min-height: 0;
    padding-top: 5px; overflow: hidden;
}
.a3-slot.dragover { border-color: var(--accent); background: rgba(76, 201, 240, 0.1); }
.a3-slot.empty { background: #f5f5f5; }
.a3-slot.empty::after { content: '페이지를 여기에 드롭'; color: var(--secondary); font-size: 12px; }
.a3-slot img { max-width: 100%; max-height: 100%; object-fit: contain; }
.a3-slot .remove-btn {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
    border-radius: 50%; background: var(--accent); color: var(--bg); border: none;
    cursor: pointer; font-size: 14px; line-height: 22px; text-align: center;
    opacity: 0; transition: opacity 0.2s;
}
.a3-slot:hover .remove-btn { opacity: 1; }

/* Sheet controls */
.sheet-controls {
    position: absolute; bottom: -35px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 5px; z-index: 10; flex-wrap: nowrap; white-space: nowrap;
}
.sheet-controls button {
    padding: 4px 12px; font-size: 12px; background: var(--border); color: #ccc;
    border: 1px solid #444; border-radius: 4px; cursor: pointer;
}
.sheet-controls button:hover { background: #444; }

.add-sheet {
    width: var(--sheet-max-width, 1100px); max-width: calc(100% - 40px); margin: 10px auto 40px;
    padding: 15px; border: 2px dashed #333; border-radius: 8px;
    text-align: center; cursor: pointer; color: var(--secondary); font-size: 13px;
    transition: all 0.3s;
}
.add-sheet:hover { border-color: var(--accent); color: var(--accent); }

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--secondary);
}
.progress-wrap { flex: 1; max-width: 200px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; display: none; }
.progress-wrap.active { display: block; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.15s; width: 0%; }

/* Back link (deprecated — replaced by .mk-nav) */
