/* ==========================================================================
   1. VARIABLES & SYSTEM SETUP
   ========================================================================== */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.15);
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ==========================================================================
   2. NAVBAR
   ========================================================================== */
.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  flex-shrink: 0;
  display: block;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.logo-dot {
  color: var(--primary);
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   3. HERO SECTION
   ========================================================================== */
.hero {
  text-align: center;
  padding: 40px 0 20px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.25;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ==========================================================================
   4. DROPZONE (PREMIUM CARDS)
   ========================================================================== */
.dropzone {
  background: var(--bg-card);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.dropzone:hover, 
.dropzone.dragover {
  border-color: var(--primary);
  background: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-glow);
}

.icon-circle {
  width: 64px;
  height: 64px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: var(--transition);
}

.dropzone:hover .icon-circle {
  transform: scale(1.1);
  background: var(--primary);
}

.upload-icon {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
  transition: var(--transition);
}

.dropzone:hover .upload-icon {
  stroke: #ffffff;
}

.dropzone-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.dropzone-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.highlight-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.formats-pill {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.formats-pill span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   5. WORKSPACE & PREVIEW
   ========================================================================== */
.workspace {
  margin-top: 24px;
}

.controls-card {
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.control-header label {
  font-weight: 700;
  font-size: 0.95rem;
}

.quality-badge {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  accent-color: var(--primary);
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 8px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.card-highlight {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 6px;
}

.tag-neutral {
  background: #f1f5f9;
  color: var(--text-muted);
}

.tag-success {
  background: #eff6ff;
  color: var(--primary);
}

.savings {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-bg);
  padding: 3px 8px;
  border-radius: 20px;
}

.img-wrapper {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px dashed var(--border-subtle);
  margin-bottom: 12px;
}

.img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-footer {
  margin-top: auto;
  text-align: center;
}

.file-size {
  font-weight: 800;
  font-size: 1.15rem;
}

/* ==========================================================================
   6. ACTION BUTTONS
   ========================================================================== */
.action-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:active {
  background: #f1f5f9;
  transform: scale(0.98);
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.footer {
  margin-top: auto;
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

/* ==========================================================================
   8. MOBILE RESPONSIVE OPTIMIZATIONS (HP SPECIFIC)
   ========================================================================== */
@media (max-width: 640px) {
  .navbar-wrapper {
    flex-direction: row; /* Tetap sejajar horizontal di HP */
  }

  .tagline {
    display: none; /* Sembunyikan tagline di HP agar header bersih & leluasa */
  }

  .hero {
    padding: 28px 0 16px;
  }

  .hero h1 {
    font-size: 1.65rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .dropzone {
    padding: 32px 16px;
  }

  .icon-circle {
    width: 52px;
    height: 52px;
  }

  .upload-icon {
    width: 24px;
    height: 24px;
  }

  .preview-grid {
    grid-template-columns: 1fr; /* Stack gambar atas-bawah di HP */
    gap: 12px;
  }

  .img-wrapper {
    height: 180px;
  }

  .action-buttons {
    flex-direction: column; /* Tombol stacking penuh di HP */
  }

  .btn {
    width: 100%;
    padding: 16px; /* Target sentuhan jari lebih besar */
  }
}
