:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(79, 70, 229, 0.25);
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --bg-main: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.5);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Glow */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-glass);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px var(--primary-glow);
}

.nav-badges {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-tag {
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tag svg {
  color: var(--success);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 0 30px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(79, 70, 229, 0.12);
  border: 1px solid rgba(79, 70, 229, 0.3);
  border-radius: 30px;
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero h1 span {
  background: linear-gradient(135deg, #818cf8, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Tool Filters & Search */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-main);
}

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

.search-box {
  position: relative;
  min-width: 260px;
}

.search-box input {
  width: 100%;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.tool-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3), 0 0 20px var(--primary-glow);
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.badge-populer {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-efisien, .badge-paling-dicari {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pro {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  transition: var(--transition);
}

.tool-card:hover .card-icon {
  transform: scale(1.08);
}

.icon-word { background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(29, 78, 216, 0.1)); color: #60a5fa; }
.icon-pdf { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1)); color: #f87171; }
.icon-merge { background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.1)); color: #c084fc; }
.icon-split { background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), rgba(194, 65, 12, 0.1)); color: #fb923c; }
.icon-compress { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1)); color: #34d399; }
.icon-image { background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(219, 39, 119, 0.1)); color: #f472b6; }
.icon-excel { background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.1)); color: #4ade80; }
.icon-pptx { background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.1)); color: #fb923c; }

.tool-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.card-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #818cf8;
}

.tool-card:hover .card-footer svg {
  transform: translateX(4px);
}

.card-footer svg {
  transition: var(--transition);
}

/* Modal Converter Layer */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: #1e293b;
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  padding: 32px;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Modal Phases (Upload, Processing, Result) */
.phase {
  display: none;
}

.phase.active {
  display: block;
}

/* Upload Phase */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.06);
  box-shadow: 0 0 24px var(--primary-glow);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  background: rgba(79, 70, 229, 0.12);
  color: #818cf8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: var(--transition);
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-4px);
}

.dropzone h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.btn-file-select {
  background: var(--primary);
  color: white;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 16px var(--primary-glow);
  pointer-events: none;
}

.file-input-hidden {
  display: none;
}

/* File Selected List */
.selected-files-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.file-info-icon {
  color: #818cf8;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.file-size {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-remove-file {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tool Custom Options (e.g. Split ranges, Compress quality) */
.tool-options {
  margin-top: 20px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
}

.tool-options label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tool-options input, .tool-options select {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-glass);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.tool-options input:focus, .tool-options select:focus {
  border-color: var(--primary);
}

/* Action Buttons */
.modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px var(--primary-glow);
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px var(--primary-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-secondary:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Phase 2: Processing */
.processing-box {
  text-align: center;
  padding: 40px 20px;
}

.spinner-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner-icon {
  color: #818cf8;
}

.processing-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.processing-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.progress-bar-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  height: 10px;
  border-radius: 20px;
  overflow: hidden;
  max-width: 440px;
  margin: 0 auto 16px;
  position: relative;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  height: 100%;
  width: 0%;
  border-radius: 20px;
  transition: width 0.3s ease;
}

.progress-percentage {
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 24px;
}

/* Phase 3: Result */
.result-box {
  text-align: center;
  padding: 30px 10px 10px;
}

.success-badge {
  width: 80px;
  height: 80px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 2px solid rgba(16, 185, 129, 0.3);
  animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.result-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
  text-align: left;
}

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

.result-file-name {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.result-file-meta {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge-metric {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.badge-savings {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.btn-download-big {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
  text-decoration: none;
  margin-bottom: 16px;
  font-family: inherit;
}

.btn-download-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

.result-secondary-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.next-action-prompt {
  background: rgba(79, 70, 229, 0.1);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.next-action-text {
  font-size: 0.88rem;
  color: #c7d2fe;
}

.btn-quick-next {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-quick-next:hover {
  background: var(--primary-hover);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--border-glass);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }

/* Footer */
.footer {
  border-top: 1px solid var(--border-glass);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Responsiveness */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
  .modal-container {
    padding: 20px;
  }
  .next-action-prompt {
    flex-direction: column;
    align-items: flex-start;
  }
}
