/* ============================================
   BALI SADHU PHOTO — index.css
   v2 — Responsive: Desktop + iPad + Mobile
   ============================================ */

:root {
  --gold:          #C8922A;
  --gold-light:    #E8B84B;
  --gold-dark:     #8B6318;
  --gold-pale:     #FDF3DC;
  --green:         #2D6A4F;
  --green-light:   #52B788;
  --green-dark:    #1B4332;
  --green-pale:    #D8F3DC;
  --cream:         #FAF6EE;
  --dark:          #1A1208;
  --dark-mid:      #2C2010;
  --text-main:     #2C2010;
  --text-muted:    #7A6640;
  --border:        rgba(200, 146, 42, 0.25);
  --border-strong: rgba(200, 146, 42, 0.5);
  --radius:        16px;
  --radius-sm:     8px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  /* PENTING: hilangkan overflow:hidden agar mobile bisa scroll */
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(200, 146, 42, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 80%, rgba(45, 106, 79, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* === ORNAMEN === */
.bali-ornament {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
}
.bali-ornament.top-right { top: -40px; right: -40px; width: 300px; height: 300px; }
.bali-ornament.bottom-left { bottom: -40px; left: -40px; width: 250px; height: 250px; }

/* === TOPBAR === */
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 246, 238, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon { width: 36px; height: 36px; }

.logo-text { display: flex; flex-direction: column; line-height: 1; }

.logo-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--gold-dark);
  letter-spacing: 0.02em;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.topbar-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  background: var(--green-pale);
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* === STEP NAV === */
.step-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: rgba(250, 246, 238, 0.7);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.step-nav::-webkit-scrollbar { display: none; }

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  opacity: 0.45;
  flex-shrink: 0;
}
.step-item.active  { opacity: 1; }
.step-item.done    { opacity: 0.7; }

.step-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}

.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}
.step-item.active .step-num { background: var(--gold); color: white; }
.step-item.done   .step-num { background: var(--green); color: white; }
.step-item.done .step-num::before { content: '✓'; font-size: 11px; }
.step-item.done .step-num-inner { display: none; }

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
}

.step-divider {
  width: 24px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* === MAIN LAYOUT === */
.main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 24px 24px;
  min-height: calc(100vh - 120px);
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === UPLOAD ZONE === */
.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(253, 243, 220, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 32px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  /* min-height agar tetap besar di semua device */
  min-height: 300px;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C8922A' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: rgba(200, 146, 42, 0.06);
}

.upload-zone.hidden { display: none; }

.upload-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(200, 146, 42, 0.12);
}

.upload-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
}

.upload-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-top: 4px;
}

.upload-formats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.format-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gold-pale);
  color: var(--gold-dark);
  border: 1px solid rgba(200, 146, 42, 0.2);
}

.upload-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* === BUTTONS === */
.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  /* Penting untuk touch: area yang cukup besar */
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-browse:hover { background: var(--gold-dark); }
.btn-browse:active { transform: scale(0.97); }

.btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  min-height: 52px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-next:hover { background: var(--gold-dark); }
.btn-next:active { transform: scale(0.97); }

.btn-reupload {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-family: 'DM Sans', sans-serif;
  min-height: 40px;
  padding: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* === PREVIEW PANEL === */
.preview-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 24px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
}
.preview-panel.visible { display: flex; }

.preview-img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.preview-name {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
}

/* === CUSTOM TOAST (ganti alert) === */
.bsp-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark-mid);
  color: var(--gold-pale);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.bsp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === SIDEBAR === */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  padding: 18px;
}

.sidebar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.recent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recent-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  position: relative;
  background: var(--cream);
  touch-action: manipulation;
}
.recent-item:hover { border-color: var(--gold); }
.recent-item:active { transform: scale(0.97); }

.recent-item img { width: 100%; height: 100%; object-fit: cover; }

.recent-item-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
.recent-item:hover .recent-item-del { display: flex; }

/* === INFO & TIPS CARDS === */
.info-card {
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: var(--radius-sm);
  background: var(--green-pale);
  padding: 14px 16px;
}
.info-card-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.info-card-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-card-steps li {
  font-size: 12px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-card-steps li::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green-light);
  flex-shrink: 0;
}

.tips-card {
  border: 1px solid rgba(200, 146, 42, 0.2);
  border-radius: var(--radius);
  background: var(--gold-pale);
  padding: 14px 16px;
}
.tips-card-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tips-card-body {
  font-size: 12px;
  color: var(--gold-dark);
  line-height: 1.7;
}

#fileInput { display: none; }

/* ============================================
   RESPONSIVE — iPad (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr 260px;
    padding: 20px 20px;
    gap: 16px;
  }
  .topbar { padding: 12px 20px; }
}

/* ============================================
   RESPONSIVE — Mobile (<= 768px)
   Sidebar pindah ke bawah, layout 1 kolom
   ============================================ */
@media (max-width: 768px) {
  .topbar {
    padding: 12px 16px;
  }

  .logo-sub { display: none; }

  .topbar-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Step nav: label pendek */
  .step-item { padding: 10px 10px; }
  .step-label { font-size: 11px; }

  /* Layout jadi 1 kolom, sidebar turun ke bawah */
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 16px;
    gap: 16px;
    min-height: unset;
  }

  .sidebar {
    order: 2; /* sidebar ada di bawah */
  }

  .left-panel {
    order: 1;
  }

  .upload-zone {
    padding: 36px 20px;
    gap: 14px;
    min-height: 260px;
  }

  .upload-title { font-size: 20px; }
  .upload-icon-wrap { width: 68px; height: 68px; }

  /* Sembunyikan ornamen Bali di mobile agar ga ganggu */
  .bali-ornament { display: none; }
}

/* ============================================
   RESPONSIVE — Small Mobile (<= 480px)
   ============================================ */
@media (max-width: 480px) {
  .topbar { padding: 10px 14px; }
  .logo-main { font-size: 16px; }
  .logo-icon { width: 30px; height: 30px; }

  .step-label { display: none; }
  .step-item { padding: 10px 8px; }

  .main { padding: 12px; gap: 12px; }

  .upload-zone {
    padding: 28px 16px;
    min-height: 220px;
  }

  .upload-title { font-size: 18px; }

  .btn-browse { font-size: 13px; padding: 12px 24px; }
  .btn-next { font-size: 13px; }

  .sidebar-card { padding: 14px; }
}
