:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-color: #0f172a;
  --surface: rgba(30, 41, 59, 0.7);
  --surface-hover: rgba(51, 65, 85, 0.8);
  --border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --radius: 24px;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Background Aesthetics */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
  z-index: -1;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -2;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: rgba(99, 102, 241, 0.3);
  top: -150px;
  left: -150px;
}

.shape-2 {
  width: 600px;
  height: 600px;
  background: rgba(139, 92, 246, 0.2);
  bottom: -200px;
  right: -100px;
}

/* Navbar */
.navbar {
  padding: 24px 0;
  width: 100%;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.9;
}

.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-btn-secondary {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  font-size: 0.95rem;
}

.nav-btn-secondary:hover {
  color: var(--text-primary);
}

.nav-btn-primary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: all 0.2s;
}

.nav-btn-primary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Main Geometry */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 80px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.hero {
  text-align: center;
  margin-bottom: 48px;
}

.badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero h1 span {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Glassmorphism App Container */
.app-card {
  width: 100%;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* View 1: Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 60px 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.dz-icon {
  font-size: 48px;
  margin-bottom: 20px;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s;
}

.dropzone:hover .dz-icon {
  transform: scale(1.1);
}

.dropzone h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.dropzone p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.btn-browse {
  background: var(--text-primary);
  color: var(--bg-color);
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.btn-browse:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-browse:active {
  transform: translateY(1px);
}

.trust-strip {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* View 2: Loader */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-container h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.loader-container p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* View 3: Editor Result */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.result-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.preview-stage {
  width: 100%;
  height: 400px;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 24px;
}

.preview-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.file-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-stats span {
  font-weight: 700;
  color: var(--text-primary);
}

.btn-download {
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-download:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Responsiveness */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .app-card {
    padding: 20px;
  }

  .dropzone {
    padding: 40px 16px;
  }

  .preview-stage {
    height: 300px;
  }

  .action-bar {
    flex-direction: column-reverse;
    align-items: stretch;
    text-align: center;
  }

  .btn-download {
    justify-content: center;
  }
}