/* css/backstage.css — BackstageManager styles
   Semua selector diawali .bs- atau #backstageOverlay untuk scope isolation */

/* ── Overlay fullscreen ─────────────────────────────────────────────────── */
#backstageOverlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: none;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}
#backstageOverlay.open {
  display: flex;
}

/* ── Panel utama (dua kolom) ────────────────────────────────────────────── */
.bs-panel {
  display: flex;
  width: 100%;
  height: 100%;
  animation: bsSlideIn 220ms ease-out both;
}
.bs-panel.bs-closing {
  animation: bsSlideOut 180ms ease-in both;
}

@keyframes bsSlideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes bsSlideOut {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(-100%); opacity: 0; }
}

/* ── Kolom kiri: Navigasi ───────────────────────────────────────────────── */
.bs-nav {
  width: 220px;
  flex-shrink: 0;
  background: #1e3c72;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

/* Tombol kembali */
.bs-back {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  padding: 14px 20px;
  text-align: left;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: Arial, sans-serif;
  letter-spacing: 0.3px;
}
.bs-back:hover { background: rgba(255, 255, 255, 0.22); }

/* Nama app */
.bs-app-name {
  padding: 10px 20px 18px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1em;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 8px;
}

/* Nav items */
.bs-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88em;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.14s, color 0.14s;
  font-family: Arial, sans-serif;
  border-left: 3px solid transparent;
}
.bs-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.bs-nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-left-color: #4dabf7;
  font-weight: 700;
}
.bs-nav-icon { font-size: 1.1em; }

/* Divider nav */
.bs-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 8px 0;
}

/* Footer nav */
.bs-nav-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.bs-nav-fname {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.bs-nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.65);
}
.bs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #aaa;
}
.bs-dot-saved   .bs-dot { background: #51cf66; }
.bs-dot-unsaved .bs-dot { background: #fcc419; }

/* ── Kolom kanan: Konten ────────────────────────────────────────────────── */
.bs-content {
  flex: 1;
  background: #fff;
  overflow-y: auto;
  padding: 44px 48px;
  max-width: 760px;
}

/* Tab (semua tersembunyi kecuali .active) */
.bs-tab         { display: none; }
.bs-tab.active  { display: block; }

/* Animasi tab switch */
.bs-tab-enter {
  animation: bsTabFade 150ms ease both;
}
@keyframes bsTabFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Heading utama tiap tab ─────────────────────────────────────────────── */
.bs-heading {
  font-size: 1.5em;
  font-weight: 800;
  color: #1e3c72;
  margin: 0 0 28px;
}

/* ── Tombol aksi ────────────────────────────────────────────────────────── */
.bs-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #2a5298;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  font-family: Arial, sans-serif;
  margin-bottom: 10px;
}
.bs-btn-primary:hover {
  background: #1e3c72;
  transform: translateY(-1px);
}
.bs-btn-primary:active { transform: translateY(0); }

.bs-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: #f8f9fa;
  color: #333;
  border: 1.5px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.92em;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
  font-family: Arial, sans-serif;
  margin-bottom: 10px;
}
.bs-btn-outline:hover {
  border-color: #4dabf7;
  background: #e7f5ff;
  color: #1971c2;
}

.bs-action-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 24px;
}
.bs-action-group .bs-btn-primary,
.bs-action-group .bs-btn-outline {
  margin-bottom: 0;
  min-width: 240px;
}

/* Keyboard shortcut hint */
.bs-btn-primary kbd {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.82em;
  font-family: monospace;
}

/* Divider section */
.bs-section-divider {
  border: none;
  border-top: 1px solid #e9ecef;
  margin: 28px 0;
}

/* Info file aktif */
.bs-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0f4ff;
  border: 1px solid #c5d4f8;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 0.88em;
  color: #1e3c72;
  font-weight: 600;
}

/* Stats (komponen & kabel) */
.bs-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 16px;
}
.bs-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bs-stat-num {
  font-size: 2em;
  font-weight: 800;
  color: #1e3c72;
  line-height: 1;
}
.bs-stat-label {
  font-size: 0.75em;
  color: #888;
  margin-top: 4px;
}

/* Status saved/unsaved */
.bs-save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84em;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}
.bs-status-saved   { background: #d3f9d8; color: #2f9e44; }
.bs-status-unsaved { background: #fff9db; color: #e67700; }

/* ── Dropzone ───────────────────────────────────────────────────────────── */
.bs-dropzone {
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  margin-top: 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: #888;
}
.bs-dropzone:hover,
.bs-dropzone-active {
  border-color: #4dabf7;
  background: #f0f8ff;
  color: #1971c2;
}
.bs-dropzone-icon { font-size: 2.5em; margin-bottom: 10px; }
.bs-dropzone-text { font-size: 0.95em; font-weight: 600; }
.bs-dropzone-sub  { font-size: 0.8em; margin-top: 4px; opacity: 0.7; }

/* ── Recent files ───────────────────────────────────────────────────────── */
.bs-recent-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid #e9ecef;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: border-color 0.14s, background 0.14s;
}
.bs-recent-card:hover {
  border-color: #4dabf7;
  background: #f0f8ff;
}
.bs-recent-info { flex: 1; min-width: 0; }
.bs-recent-title {
  display: block;
  font-size: 0.9em;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-recent-meta {
  display: block;
  font-size: 0.75em;
  color: #888;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-recent-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.bs-recent-open {
  padding: 5px 14px;
  background: #2a5298;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.8em;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s;
  font-family: Arial, sans-serif;
}
.bs-recent-open:hover { background: #1e3c72; }
.bs-recent-del {
  padding: 5px 10px;
  background: #f8f9fa;
  color: #aaa;
  border: 1px solid #dee2e6;
  border-radius: 7px;
  font-size: 0.82em;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  font-family: Arial, sans-serif;
}
.bs-recent-del:hover { background: #ffe0e0; color: #c0392b; }

/* Empty state */
.bs-empty {
  text-align: center;
  padding: 48px 24px;
  color: #aaa;
  font-size: 0.9em;
}
.bs-empty-icon { font-size: 3em; margin-bottom: 12px; }

/* Section footer */
.bs-section-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

/* ── Form info proyek ───────────────────────────────────────────────────── */
.bs-form-group { margin-bottom: 18px; }
.bs-label {
  display: block;
  font-size: 0.82em;
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bs-input,
.bs-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.92em;
  font-family: Arial, sans-serif;
  color: #333;
  outline: none;
  transition: border-color 0.14s;
  box-sizing: border-box;
}
.bs-input:focus,
.bs-textarea:focus  { border-color: #4dabf7; }
.bs-textarea        { height: 80px; resize: vertical; }
.bs-info-msg        { font-size: 0.82em; min-height: 20px; margin-top: 8px; }
.bs-info-success    { color: #2f9e44; font-weight: 600; }

/* Metadata read-only */
.bs-meta-grid { display: flex; flex-direction: column; gap: 10px; }
.bs-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.85em;
}
.bs-meta-label { color: #888; font-weight: 600; }
.bs-meta-value { color: #333; font-weight: 500; text-align: right; }

/* ── Ekspor cards ───────────────────────────────────────────────────────── */
.bs-export-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.bs-export-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1.5px solid #dee2e6;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.14s, background 0.14s, transform 0.12s;
  font-family: Arial, sans-serif;
}
.bs-export-card:hover {
  border-color: #4dabf7;
  background: #f0f8ff;
  transform: translateX(4px);
}
.bs-export-icon { font-size: 2em; flex-shrink: 0; }
.bs-export-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bs-export-info strong { font-size: 0.95em; color: #1e3c72; }
.bs-export-info small  { font-size: 0.78em; color: #888; }
.bs-export-hint {
  font-size: 0.82em;
  color: #888;
  background: #fff9db;
  border-left: 3px solid #fcc419;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  line-height: 1.55;
}

/* ── MOBILE RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .bs-panel {
    flex-direction: column;
  }
  .bs-nav {
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 6px 8px;
    gap: 2px;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
  }
  .bs-app-name,
  .bs-divider,
  .bs-nav-footer { display: none; }
  .bs-back {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
  }
  .bs-nav-item {
    flex-direction: column;
    padding: 6px 12px;
    gap: 3px;
    font-size: 0.72em;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .bs-nav-item.active {
    border-bottom-color: #4dabf7;
    border-left: none;
  }
  .bs-content {
    padding: 20px 18px;
    max-width: 100%;
  }
  .bs-action-group .bs-btn-primary,
  .bs-action-group .bs-btn-outline {
    min-width: unset;
    width: 100%;
  }

  /* Hemat GPU di mobile */
  #backstageOverlay {
    backdrop-filter: none;
  }

  /* Heading lebih ringkas */
  .bs-heading {
    font-size: 1.2em;
    margin-bottom: 18px;
  }

  /* Stats lebih kecil */
  .bs-stat-num {
    font-size: 1.6em;
  }

  /* Export cards lebih kompak */
  .bs-export-card {
    padding: 12px 14px;
  }
  .bs-export-icon {
    font-size: 1.6em;
  }

  /* Recent meta terlalu padat di layar kecil */
  .bs-recent-meta {
    display: none;
  }

  /* Tombol aksi full-width */
  .bs-btn-primary,
  .bs-btn-outline {
    width: 100%;
    justify-content: center;
  }

  /* Cegah auto-zoom iOS saat tap input */
  .bs-input,
  .bs-textarea {
    font-size: 16px;
  }
}
