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

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273548;
  --border: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
}
.logo-icon {
  color: var(--primary);
  font-size: 1.5rem;
}
.logo-accent {
  color: var(--primary);
}
.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  padding: 80px 24px 60px;
  text-align: center;
}
.hero-inner {
  max-width: 700px;
  margin: 0 auto;
}
.badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* Demo Section */
.demo-section {
  padding: 0 0 80px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.muted {
  color: var(--text-muted);
}
.small {
  font-size: 0.85rem;
}

/* Email Form */
.email-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.email-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.email-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.rate-msg {
  margin-top: 12px;
  font-size: 0.9rem;
}
.rate-msg.error {
  color: var(--danger);
}
.rate-msg.success {
  color: var(--success);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* Upload Area */
.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.credits-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.credits-badge.low {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}
.drop-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}
.link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}
.link:hover {
  text-decoration: underline;
}

/* File Info */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
#file-name {
  font-weight: 500;
}

/* Processing */
.processing-center {
  text-align: center;
  padding: 40px 20px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results */
.results-card {
  margin-bottom: 20px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.changes-log {
  margin-top: 20px;
}
.changes-log h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.change-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.change-item:last-child {
  border-bottom: none;
}
.change-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.change-count {
  font-weight: 700;
  color: var(--primary);
}

/* Preview */
.preview-card {
  margin-bottom: 24px;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.preview-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.tab {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.tab.active {
  background: var(--primary);
  color: white;
}
.table-wrapper {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
#preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
#preview-table th,
#preview-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
#preview-table th {
  background: var(--bg);
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--text-muted);
}
#preview-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}
.changed-cell {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  font-weight: 600;
}

/* Download Row */
.download-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* Credits Exhausted */
.credits-exhausted {
  text-align: center;
  padding: 30px 20px;
}
.big-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

/* Features Section */
.features-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}
.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}
.feature-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Pricing Section */
.pricing-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}
.pricing-card {
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.pricing-card h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.pricing-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
}
.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
}
.pricing-features li {
  padding: 8px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

/* Footer */
.footer {
  padding: 30px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }
  .email-row {
    flex-direction: column;
  }
  .upload-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .preview-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .download-row {
    flex-direction: column;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
