/* ===== Base ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar { flex-shrink: 0; }

/* ═══════════════════════════════════════
   LANDING — Two zones
═══════════════════════════════════════ */
.two-zones {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  transition: background 0.2s;
}

.zone-generate {
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
}

.zone-edit {
  background: #ffffff;
}

/* Drop zone (the clickable/droppable area) */
.zone-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  min-height: 240px;
  border: 2px dashed #ced4da;
  border-radius: 16px;
  padding: 40px 24px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  color: #6c757d;
}

.zone-drop:hover,
.zone-drop.dragging {
  border-color: #0d6efd;
  background: #f0f6ff;
  color: #0d6efd;
}

.zone-generate .zone-drop:hover,
.zone-generate .zone-drop.dragging {
  border-color: #198754;
  background: #f0fff4;
  color: #198754;
}

.zone-icon {
  font-size: 3rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.zone-drop:hover .zone-icon,
.zone-drop.dragging .zone-icon {
  opacity: 1;
}

.zone-title {
  font-size: 18px;
  font-weight: 700;
  color: #212529;
  margin-top: 8px;
}

.zone-subtitle {
  font-size: 13px;
  line-height: 1.6;
}

/* Result after extraction */
.zone-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.zone-filename {
  font-weight: 600;
  font-size: 14px;
  color: #212529;
  word-break: break-all;
  max-width: 300px;
}

/* ===== Generate zone — language picker row ===== */
.zone-lang-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.zone-lang-label {
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   Searchable language picker component
   (used in generate zone + add-lang form)
═══════════════════════════════════════ */
.lang-picker {
  position: relative;
  display: inline-block;
  min-width: 200px;
}

.lang-picker-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: border-color 0.15s;
}

.lang-picker-trigger:hover,
.lang-picker-trigger:focus {
  border-color: #0d6efd;
  outline: none;
}

.lp-flag  { font-size: 18px; line-height: 1; }
.lp-name  { flex: 1; font-weight: 500; }
.lp-code  { font-size: 11px; color: #adb5bd; font-weight: 600; text-transform: uppercase; }
.lp-arrow { font-size: 10px; color: #adb5bd; margin-left: 2px; }

.lang-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  width: 240px;
  overflow: hidden;
}

.lang-picker-search {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  outline: none;
}

.lang-picker-list {
  max-height: 220px;
  overflow-y: auto;
}

.lang-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.lang-picker-item:hover { background: #f8f9fa; }
.lang-picker-item.active { background: #e7f1ff; font-weight: 600; }

.lp-item-name { flex: 1; }
.lp-item-code {
  font-size: 11px;
  color: #adb5bd;
  text-transform: uppercase;
  font-weight: 600;
}

.lang-picker-empty {
  padding: 12px;
  font-size: 13px;
  color: #adb5bd;
  text-align: center;
}

/* Picker inside add-lang form — slightly smaller */
.lang-add-form .lang-picker {
  min-width: 180px;
}

.lang-add-form .lang-picker-trigger {
  padding: 4px 8px;
  font-size: 12px;
}

.lang-add-form .lang-picker-dropdown {
  width: 220px;
}

/* ═══════════════════════════════════════
   EDITOR LAYOUT
═══════════════════════════════════════ */
.editor-layout {
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.editor-topbar {
  background: #212529;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid #333;
}

.editor-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== Language bar ===== */
.lang-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.lang-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  color: #6c757d;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lang-tab-name { font-weight: 600; }
.lang-tab-code { font-size: 10px; opacity: 0.7; text-transform: uppercase; }

.lang-tab:hover { background: #e9ecef; color: #212529; }

.lang-tab.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

.lang-del {
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
  padding: 0 2px;
  border-radius: 50%;
  transition: opacity 0.15s;
}
.lang-del:hover { opacity: 1; }

.lang-add-btn {
  padding: 4px 12px;
  border: 1px dashed #ced4da;
  border-radius: 20px;
  background: none;
  font-size: 12px;
  color: #6c757d;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lang-add-btn:hover { border-color: #0d6efd; color: #0d6efd; }

.lang-add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 4px 10px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.lang-code-input {
  width: 90px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.lang-code-input:focus { outline: none; border-color: #0d6efd; }

.lang-copy-select {
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
}

.lang-form-ok {
  padding: 3px 10px;
  background: #0d6efd;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.lang-form-ok:hover { background: #0b5ed7; }

.lang-form-cancel {
  padding: 3px 8px;
  background: none;
  border: none;
  font-size: 12px;
  color: #6c757d;
  cursor: pointer;
}
.lang-form-cancel:hover { color: #212529; }

/* Badge in scene title */
.lang-badge {
  font-size: 11px;
  font-weight: 700;
  background: #0d6efd;
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
}

/* ===== Scene Nav ===== */
.scene-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #444;
  text-align: left;
  transition: background 0.15s;
}

.scene-btn:hover  { background: #e9ecef; }
.scene-btn.active { background: #0d6efd; color: white; font-weight: 600; }

.scene-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  background: #dee2e6;
  color: #555;
  margin-left: auto;
}
.scene-btn.active .scene-badge {
  background: rgba(255,255,255,0.25);
  color: white;
}

/* ===== Slide cards ===== */
.slide-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}

.slide-header {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.slide-header .slide-id {
  font-weight: 700;
  font-size: 13px;
  color: #0d6efd;
  background: #e7f1ff;
  padding: 2px 10px;
  border-radius: 20px;
}

.slide-header .slide-count {
  font-size: 12px;
  color: #888;
  margin-left: auto;
}

.slide-body {
  padding: 16px 20px;
  display: grid;
  gap: 14px;
}

/* ===== Variable field ===== */
.var-field label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  word-break: break-all;
  flex: 1;
}

.var-field textarea {
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  line-height: 1.5;
}

.var-field textarea:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.var-field textarea.modified {
  border-color: #198754;
  background: #f0fff4;
}

/* ===== Variable field — label row ===== */
.var-field-labelrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.var-field-labelrow label {
  margin-bottom: 0;
}

.var-translate-btn {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  color: #6c757d;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}

.var-translate-btn:hover {
  background: #e7f1ff;
  border-color: #0d6efd;
}

.var-translate-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ===== Scene translate toolbar ===== */
.scene-translate-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: #f0f6ff;
  border: 1px solid #cfe2ff;
  border-radius: 10px;
  flex-wrap: wrap;
}

.translate-from-label {
  font-size: 13px;
  color: #6c757d;
  white-space: nowrap;
  font-weight: 500;
}

.translate-src-select {
  width: auto !important;
  min-width: 160px;
  font-size: 13px;
}

/* ===== Variable hints (reference values) ===== */
.var-hints {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
}

.hint-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  line-height: 1.4;
}

.hint-label {
  font-weight: 600;
  color: #adb5bd;
  white-space: nowrap;
  flex-shrink: 0;
}

.hint-value {
  color: #adb5bd;
  font-style: italic;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

.hint-reset {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
  color: #6c757d;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.hint-reset:hover {
  background: #e7f1ff;
  border-color: #0d6efd;
  color: #0d6efd;
}

/* ===== Scene heading ===== */
.scene-title {
  font-size: 22px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 4px;
}

.scene-subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 24px;
}

/* ===== Content scroll area ===== */
.editor-body > main {
  overflow-y: auto;
}
