/* ============================================================
   public/css/editor.css – Editor page styles
   ============================================================ */

/* ── Layout ──────────────────────────────────────────────── */
.editor-layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
  background: #f0f2f8;
}

/* ── Left Panel (frame picker) ───────────────────────────── */
.ep-left {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--bo);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ep-left-head {
  padding: 14px 16px;
  font-family: var(--fm);
  font-weight: 700;
  font-size: .9rem;
  border-bottom: 1px solid var(--bo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ep-left-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bo);
  flex-shrink: 0;
}
.ep-left-search input {
  width: 100%;
  padding: 7px 12px;
  border: 1.5px solid var(--bo);
  border-radius: 8px;
  font-family: var(--fb);
  font-size: .82rem;
  outline: none;
  transition: border-color .2s;
}
.ep-left-search input:focus { border-color: var(--or); }
.ep-frame-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}
.ep-frame-item {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .15s;
  background: #f8f9fa;
  position: relative;
}
.ep-frame-item:hover  { border-color: var(--or); transform: translateY(-2px); }
.ep-frame-item.active { border-color: var(--or); box-shadow: 0 0 0 2px rgba(255,107,53,.2); }
.ep-frame-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ep-frame-item-lbl {
  padding: 4px 6px;
  font-size: .65rem;
  font-weight: 600;
  color: var(--mu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-frame-item-stats {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .6rem;
  padding: 2px 5px;
  display: flex;
  gap: 6px;
}

/* ── Center Canvas ───────────────────────────────────────── */
.ep-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.ep-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #fff;
  border-bottom: 1px solid var(--bo);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.ep-tbtn {
  padding: 6px 13px;
  border: 1.5px solid var(--bo);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--fb);
  white-space: nowrap;
}
.ep-tbtn:hover, .ep-tbtn.act {
  border-color: var(--or);
  background: #fff8f4;
  color: var(--or);
}
.ep-tbtn.danger:hover { border-color: #ef4444; background: #fee2e2; color: #dc2626; }
.ep-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  position: relative;
}
.ep-canvas-box {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  background: #fff;
  cursor: crosshair;
  user-select: none;
}
.ep-canvas-box canvas { display: block; max-width: 100%; max-height: calc(100vh - var(--nav-h) - 120px); }
.ep-canvas-hint {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; pointer-events: none; color: var(--mu);
}
.ep-canvas-hint .ci { font-size: 3rem; }
.ep-canvas-hint p { font-weight: 600; font-size: .9rem; }
.ep-canvas-hint small { font-size: .76rem; color: #aaa; }
.ep-info {
  padding: 6px 16px;
  background: #fff;
  border-top: 1px solid var(--bo);
  font-size: .74rem;
  color: var(--mu);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* ── Right Sidebar (controls) ────────────────────────────── */
.ep-right {
  width: 272px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--bo);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ep-right-head {
  padding: 14px 16px;
  font-family: var(--fm);
  font-weight: 700;
  font-size: .9rem;
  color: var(--or);
  border-bottom: 1px solid var(--bo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ep-right-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}
.ep-sec {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f0f0f0;
}
.ep-sec:last-child { border-bottom: none; margin-bottom: 0; }
.ep-lbl {
  display: block;
  font-weight: 700;
  font-size: .78rem;
  margin-bottom: 7px;
  color: var(--tx);
}
.ep-ubtn {
  width: 100%;
  padding: 9px;
  border: 2px dashed var(--or);
  background: #fff8f4;
  border-radius: 9px;
  font-weight: 600;
  color: var(--or);
  cursor: pointer;
  font-size: .82rem;
  transition: background .2s;
  font-family: var(--fb);
}
.ep-ubtn:hover { background: #ffeee5; }
.ep-crow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  margin-top: 7px;
}
.ep-crow label { min-width: 58px; color: var(--mu); flex-shrink: 0; }
.ep-crow input[type=color] {
  width: 30px; height: 30px;
  border: 2px solid var(--bo);
  border-radius: 6px; cursor: pointer; padding: 2px;
}
.ep-srow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .76rem;
  margin-top: 6px;
}
.ep-srow label { min-width: 60px; color: var(--mu); flex-shrink: 0; }
.ep-srow input[type=range] { flex: 1; accent-color: var(--or); cursor: pointer; }
.ep-srow .sv { min-width: 34px; font-size: .72rem; color: var(--mu); text-align: right; }
.ep-hint {
  font-size: .71rem;
  color: var(--mu);
  margin-top: 6px;
  background: #f8f9fa;
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid var(--or);
  line-height: 1.5;
}
.ep-tinput {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--bo);
  border-radius: 8px;
  font-family: var(--fb);
  font-size: .84rem;
  outline: none;
  transition: border-color .2s;
}
.ep-tinput:focus { border-color: var(--or); }
.ep-select {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--bo);
  border-radius: 8px;
  font-family: var(--fb);
  font-size: .82rem;
  outline: none;
  background: #fff;
  cursor: pointer;
}

/* Photobooth slot list */
.pb-slot-list { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.pb-slot-item {
  display: flex; align-items: center; gap: 8px;
  background: #f8f9fa; border-radius: 8px; padding: 6px 8px;
}
.pb-slot-thumb {
  width: 40px; height: 40px; border-radius: 6px;
  border: 1.5px solid var(--bo); object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; background: #efefef;
}
.pb-slot-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.pb-slot-btn {
  flex: 1; padding: 5px 8px;
  border: 1.5px dashed var(--or);
  background: #fff8f4; border-radius: 7px;
  font-size: .74rem; font-weight: 600; color: var(--or);
  cursor: pointer; font-family: var(--fb);
}

/* Export section */
.ep-export-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--gr), #04b889);
  color: #fff; border: none; border-radius: 10px;
  font-weight: 700; font-size: .88rem; cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(6,214,160,.3);
  transition: transform .15s;
  font-family: var(--fb);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ep-export-btn:hover { transform: translateY(-2px); }

/* Frame info panel */
.frame-meta-box {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.frame-meta-box img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.frame-meta-box .fi-name { font-weight: 700; font-size: .85rem; margin-bottom: 3px; }
.frame-meta-box .fi-stats { font-size: .74rem; color: var(--mu); display: flex; gap: 10px; }

/* Loading overlay */
.canvas-loading {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.75);
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; z-index: 10;
}

/* Responsive */
@media (max-width: 900px) {
  .ep-left  { display: none; }
  .ep-right { width: 220px; }
}
@media (max-width: 640px) {
  .editor-layout { flex-direction: column; height: auto; }
  .ep-right { width: 100%; border-left: none; border-top: 1px solid var(--bo); }
  .ep-center { min-height: 60vh; }
}
