/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0A0D14;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.35);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent-blue: #3B82F6;
  --accent-purple: #8B5CF6;
  --accent-cyan: #06B6D4;
  --accent-green: #10B981;
  --accent-amber: #F59E0B;
  --accent-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

.hidden { display: none !important; }
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-accent { color: #38BDF8; font-weight: 700; }
.text-amber { color: var(--accent-amber); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  background: rgba(10, 13, 20, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.logo-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 18px;
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.3px;
}
.brand-by {
  font-size: 11px;
  color: var(--text-muted);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: #FFF; }
.header-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all 0.2s;
}
.header-cta-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Main */
.main-wrapper {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px;
  flex: 1;
  width: 100%;
}

.hero-section {
  text-align: center;
  margin-bottom: 36px;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #93C5FD;
  margin-bottom: 16px;
}
.hero-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 14px;
}
.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* App Card */
.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  margin-bottom: 48px;
}

/* Dropzone */
.dropzone-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 60px 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.25s;
}
.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
}
.file-hidden { display: none; }
.upload-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.dropzone-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.dropzone-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
  color: #FFF;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(59, 130, 246, 0.5);
}
.btn-batch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #7C3AED 0%, #C026D3 100%);
  border: none;
  border-radius: 12px;
  color: #FFF;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(192, 38, 211, 0.3);
}
.btn-batch:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(192, 38, 211, 0.45);
}
.btn-add-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  color: #93C5FD;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add-more:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: var(--accent-blue);
  color: #FFF;
}
.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #EF4444;
}
.btn-success {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 10px;
  color: #FFF;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: #FFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }
.btn-zip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  border: none;
  border-radius: 10px;
  color: #FFF;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
}
.btn-zip:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

/* Workspace Layout */
.workspace-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}
.gallery-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Thumbnail Strip */
.thumbnail-strip-container {
  background: rgba(10, 13, 20, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.thumbnail-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
}
.thumb-card {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  background: #000;
  flex-shrink: 0;
  transition: all 0.2s;
}
.thumb-card:hover {
  border-color: rgba(59, 130, 246, 0.6);
}
.thumb-card.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}
.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: #FFF;
  border: none;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.thumb-card:hover .thumb-remove-btn { opacity: 1; }
.thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #FFF;
}
.thumb-badge.enhanced {
  background: #059669;
  color: #FFF;
}
.thumb-add-tile {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.02);
}
.thumb-add-tile:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
}
.thumb-add-tile i { font-size: 18px; }

/* Selected info bar */
.selected-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.4);
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.file-info-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}
.file-dim {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}
.badge-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}
.badge-status.ready {
  background: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
}
.badge-status.done {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

/* Tool controls */
.tool-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  background: rgba(15, 23, 42, 0.6);
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.toggle-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  gap: 4px;
}
.pill-btn {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pill-btn.active {
  background: var(--accent-blue);
  color: #FFF;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.custom-slider {
  flex: 1;
  accent-color: var(--accent-blue);
}
.slider-val {
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  color: var(--accent-blue);
}
.control-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
}
.control-actions .btn-primary, .control-actions .btn-batch {
  width: 100%;
}

/* Progress */
.progress-bar-container {
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.progress-bar-fill {
  height: 6px;
  background: var(--accent-gradient);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
  margin-bottom: 8px;
}
.progress-status {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Comparison Viewer */
.comparison-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comparison-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.compare-tip {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-zoom-toggle {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93C5FD;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-zoom-toggle:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #FFF;
}
.btn-zoom-toggle.active {
  background: var(--accent-blue);
  color: #FFF;
  border-color: var(--accent-blue);
}

.comparison-wrapper {
  position: relative;
  width: 100%;
  max-height: 560px;
  height: 480px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: #000;
  user-select: none;
  cursor: ew-resize;
}
.comparison-wrapper.zoomed {
  cursor: grab;
}
.comparison-wrapper.zoomed .compare-img {
  transform: scale(2.2);
  transform-origin: center center;
}

.compare-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.compare-before {
  image-rendering: pixelated;
}
.compare-after {
  image-rendering: auto;
}

.compare-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-right: 2px solid #FFF;
}
.compare-overlay .compare-img {
  width: 100%;
  height: 100%;
  max-width: none;
}
.compare-label {
  position: absolute;
  top: 14px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 5;
  pointer-events: none;
}
.label-before { left: 14px; }
.label-after { right: 14px; }

.compare-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 40px;
  margin-left: -20px;
  cursor: ew-resize;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.handle-line {
  flex: 1;
  width: 2px;
  background: #FFF;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}
.handle-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFF;
  color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-size: 13px;
}

/* Download Bar */
.download-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.stats-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-item {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.stat-value {
  font-size: 13px;
  font-weight: 700;
}
.stat-arrow {
  color: var(--text-muted);
  font-size: 12px;
}
.download-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Feature Grid */
.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.4);
}
.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(10, 13, 20, 0.6);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}
.site-footer a:hover { color: #FFF; }
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dot { color: var(--text-muted); }

@media (max-width: 768px) {
  .hero-title { font-size: 30px; }
  .comparison-wrapper { height: 350px; }
  .header-nav .nav-link { display: none; }
  .workspace-top-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .download-bar { flex-direction: column; align-items: stretch; }
  .download-btns { flex-direction: column; }
}
