:root {
  --bg-dark: #070a12;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-card: rgba(255, 255, 255, 0.08);
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #3b82f6 50%, #8b5cf6 100%);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Background Glowing Blobs */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
}
.blob-1 {
  width: 480px;
  height: 480px;
  background: #2563eb;
  top: -80px;
  left: -100px;
}
.blob-2 {
  width: 520px;
  height: 520px;
  background: #7c3aed;
  bottom: -100px;
  right: -120px;
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
}

/* App Header */
.app-header {
  text-align: center;
  margin-bottom: 36px;
}
.brand-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 14px;
}
.brand-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto;
}
.brand-subtitle strong {
  color: #38bdf8;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.tab-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}
.tab-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.3);
}
.tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.divider-text {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #64748b;
  margin: 18px 0;
  position: relative;
}
.divider-text::before, .divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 32%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

textarea {
  width: 100%;
  min-height: 150px;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #f8fafc;
  outline: none;
  resize: vertical;
  transition: all 0.2s ease;
}
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin-bottom: 32px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Drop Zone */
.drop-zone {
  position: relative;
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 24px;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.06);
  box-shadow: 0 0 25px var(--primary-glow);
}
.drop-zone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.drop-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.drop-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.file-info {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #e0f2fe;
  margin-top: 10px;
}
.btn-clear {
  background: none;
  border: none;
  color: #f87171;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
}
.drop-hint {
  margin-top: 18px;
  font-size: 13px;
  color: #64748b;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.drop-hint code {
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Settings Form */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
}
.form-group input, .form-group select {
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: #f8fafc;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}
.form-group small {
  font-size: 12px;
  color: #64748b;
}

/* Buttons */
.form-actions {
  display: flex;
  justify-content: flex-end;
}
.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
  transition: all 0.25s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(56, 189, 248, 0.5);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Status Card */
.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
.status-badge {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Progress Bar */
.progress-container {
  margin-bottom: 24px;
}
.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}
#progress-text {
  color: #38bdf8;
}
#sub-status-text {
  color: var(--text-muted);
}

/* Terminal Console */
.terminal-container {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
}
.terminal-bar {
  background: #0b1120;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.terminal-dots {
  display: flex;
  gap: 6px;
}
.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.tdot.red { background: #ef4444; }
.tdot.yellow { background: #f59e0b; }
.tdot.green { background: #10b981; }
.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #64748b;
}
.terminal-screen {
  padding: 16px;
  height: 180px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}
.terminal-line {
  margin-bottom: 4px;
  word-break: break-all;
}

/* Download Section */
.download-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.warning-alert {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.warning-icon {
  font-size: 24px;
  line-height: 1;
}
.warning-alert strong {
  display: block;
  color: #fbbf24;
  font-size: 14px;
  margin-bottom: 4px;
}
.warning-alert p {
  color: #d1d5db;
  font-size: 13px;
  line-height: 1.5;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  text-decoration: none;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
  transition: all 0.25s ease;
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(16, 185, 129, 0.5);
}
.download-icon {
  font-size: 32px;
}
.download-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
}
.download-sub {
  display: block;
  font-size: 13px;
  color: #d1fae5;
  margin-top: 2px;
}

.download-done {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: #6ee7b7;
  font-size: 14px;
  text-align: center;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
  color: #475569;
}
