:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.25);
  --border-active: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.03) 0px, transparent 100%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  letter-spacing: 0.5px;
}

.navbar-brand h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.navbar-brand span {
  font-size: 12px;
  color: var(--text-muted);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34d399;
  animation: pulse 2s infinite ease-in-out;
}

.vps-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 9999px;
}

/* CONTAINER */
.container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 36px;
  flex: 1;
}

/* TAB BAR */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* GRID */
.grid-2col {
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1080px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* CARDS */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.form-card {
  padding: 28px;
}

.status-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* CARD HEADER - STACKED TITLE AND DESCRIPTION */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  gap: 16px;
}

.card-header-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.35;
  color: #f8fafc;
}

.card-header p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  margin-top: 6px;
}

.form-input, .form-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-select option {
  background: #0f172a;
  color: #fff;
}

/* DROPZONE */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dropzone:hover, .dropzone.drag-active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.dropzone-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.dropzone-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* FILE INFO BOX */
.file-info-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
}

.file-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-info-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.file-info-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.file-preview-content {
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: var(--radius-sm);
  max-height: 90px;
  overflow-y: auto;
  line-height: 1.5;
  white-space: pre-wrap;
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--accent-rose);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-danger:hover {
  text-decoration: underline;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

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

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
}

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

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

/* STEPPER */
.stepper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}

.step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  transition: all 0.25s;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
}

.step-desc {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Stepper States */
.step-item.running {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.step-item.running .step-icon {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  animation: pulse-border 1.5s infinite;
}

.step-item.running .step-title {
  color: #38bdf8;
}

.step-item.completed {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
}

.step-item.completed .step-icon {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

.step-item.completed .step-title {
  color: #e2e8f0;
}

.step-item.failed {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.4);
}

.step-item.failed .step-icon {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fb7185;
}

/* BADGES - NATURAL VIETNAMESE CAPITALIZATION */
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.badge-idle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.badge-running {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  animation: pulse 2s infinite;
}

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

.badge-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

/* CONSOLE BOX */
.console-box {
  background: #06090f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.console-header {
  background: #0d131f;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.console-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.console-dot.red { background: #ef4444; }
.console-dot.yellow { background: #f59e0b; }
.console-dot.green { background: #10b981; }

.console-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.console-body {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  max-height: 220px;
  min-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #070b12;
}

.console-line {
  line-height: 1.4;
  word-break: break-word;
}
.console-line.text-muted { color: #64748b; }
.console-line.text-info { color: #38bdf8; }
.console-line.text-success { color: #34d399; font-weight: 600; }
.console-line.text-warn { color: #fbbf24; }
.console-line.text-error { color: #f87171; font-weight: 700; }

/* COMPLETION BOX */
.completion-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  animation: slideDown 0.4s ease;
}

.completion-header {
  font-size: 15px;
  color: #34d399;
}

.completion-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* PROJECTS HISTORY GRID */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.project-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s ease;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

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

.project-title {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}

.project-path {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  word-break: break-all;
}

.project-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-label {
  color: var(--text-subtle);
  font-size: 10px;
  display: block;
}

.stat-value {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 700;
}

.project-actions {
  display: flex;
  gap: 8px;
}

/* ANIMATIONS */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
