/* ============================================
   PDF TO EXCEL — Zam Vision Product
   Theme: Orange #f97316 accent, dark bg
   ============================================ */

:root {
  --primary: #f97316;
  --primary-dim: rgba(249, 115, 22, 0.15);
  --primary-glow: rgba(249, 115, 22, 0.25);
  --bg: #0a0e1a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-elevated: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(249, 115, 22, 0.4);
  --text-primary: #f0f0f5;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.3);
  --success: #22c55e;
  --error: #ef4444;
  --radius: 16px;
  --radius-sm: 12px;
}

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

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.logo:hover {
  color: var(--text-secondary);
}

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: 0;
}

/* Card */
.card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.6;
}

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary) 0%, #ea580c 100%);
  color: #fff;
  margin: 0 auto 20px;
}

.card-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.card-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 16px;
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.drop-zone.has-file {
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary-dim);
  padding: 16px 20px;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-icon {
  color: var(--text-muted);
  opacity: 0.6;
}

.drop-text {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.drop-hint {
  color: var(--text-muted);
  font-size: 12px;
}

/* File Info */
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.file-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.file-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.file-remove:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Convert Button */
.convert-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.convert-btn:not(:disabled) {
  background: linear-gradient(135deg, var(--primary) 0%, #ea580c 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--primary-dim);
}

.convert-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px var(--primary-glow);
}

.convert-btn:not(:disabled):active {
  transform: translateY(0);
}

/* Progress */
.progress-section {
  text-align: center;
  padding: 24px 0;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--primary-dim);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}

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

.progress-text {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.progress-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ea580c);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Results */
.result-section {
  text-align: center;
  padding: 16px 0 0;
}

.result-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  border: 2px solid rgba(34, 197, 94, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--success);
}

.result-title {
  color: var(--success);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-info {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* Table Preview */
.preview-wrap {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.preview-toggle:hover {
  background: var(--primary-dim);
}

.preview-table-wrap {
  max-height: 300px;
  overflow: auto;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.preview-table th {
  padding: 8px 10px;
  background: var(--bg-elevated);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-table tr:hover td {
  background: var(--bg-elevated);
}

/* Download Button */
.download-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(34, 197, 94, 0.25);
}

.reset-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Error */
.error-section {
  text-align: center;
  padding: 16px 0 0;
}

.error-text {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 20px;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 560px) {
  .card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .card-title {
    font-size: 20px;
  }

  .drop-zone {
    padding: 24px 16px;
  }
}
