/* ===== Design System ===== */
:root {
  --bg: #0a0a0f;
  --bg-elevated: #111118;
  --bg-card: #15151e;
  --bg-input: #0d0d14;
  --bg-hover: #1a1a24;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #f0f0f5;
  --text-muted: #8a8a9a;
  --text-dim: #5a5a6a;
  --accent: #3b82f6;
  --accent-glow: rgba(59,130,246,0.25);
  --accent-hover: #2563eb;
  --accent-secondary: #8b5cf6;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Centered Page ===== */
.centered-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
  position: relative;
}

/* ===== Top Bar ===== */
.top-bar {
  text-align: center;
  margin-bottom: 1.5rem;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.hero-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.hero-logo svg {
  width: 100%;
  height: 100%;
}

.hero-title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--text);
  text-transform: uppercase;
}

/* ===== Top Navigation ===== */
.top-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.top-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.top-nav a:hover {
  color: var(--text);
}

.top-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== Form Card ===== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.form-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.form-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group.narrow {
  max-width: 160px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 0 1px var(--accent);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.form-textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 80px;
}

.form-textarea.lg { min-height: 120px; }
.form-textarea.xl { min-height: 180px; }

/* Input with hint */
.input-with-hint {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.input-with-hint .form-input,
.input-with-hint .form-textarea {
  flex: 1;
}

.input-hint {
  flex-shrink: 0;
  width: 200px;
  padding-top: 0.875rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ===== Mode Cards ===== */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.mode-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.mode-card.active {
  border-color: var(--accent);
  background: rgba(59,130,246,0.06);
}

.mode-card .mode-icon {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.mode-card .mode-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.mode-card .mode-scenarios {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mode-card .mode-scenarios li {
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 0.1rem 0;
  padding-left: 0.75rem;
  position: relative;
}

.mode-card .mode-scenarios li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.6rem;
}

/* ===== Submit Button ===== */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.btn-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-submit svg {
  flex-shrink: 0;
}

/* ===== Result ===== */
.result {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.result.success {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.15);
  color: var(--success);
}

.result.error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.15);
  color: var(--danger);
}

.result a {
  color: inherit;
  text-decoration: underline;
}

/* ===== Sparkle Decoration ===== */
.sparkle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 1.5rem;
  color: var(--text-dim);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* ===== Status & Reports Pages (Sidebar Layout) ===== */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0; top: 0;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sidebar-brand .logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: #fff;
}

.sidebar-brand .brand-text {
  font-size: 0.95rem; font-weight: 600;
  color: var(--text);
}

.sidebar-brand .brand-text small {
  display: block;
  font-size: 0.7rem; font-weight: 400;
  color: var(--text-dim); margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar-nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.sidebar-nav a.active {
  background: rgba(59,130,246,0.1);
  color: var(--accent);
}

.sidebar-footer {
  padding: 1rem 1.5rem 0;
  border-top: 1px solid var(--border);
}

.sidebar .lang-switch {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
}

.sidebar .lang-switch:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.main {
  flex: 1;
  margin-left: 240px;
  padding: 2.5rem 3rem;
  max-width: 900px;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.page-header .page-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}

.badge-pending { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-processing { background: rgba(59,130,246,0.12); color: var(--accent); }
.badge-completed { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-failed { background: rgba(239,68,68,0.12); color: var(--danger); }

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--text-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .centered-page { padding: 1rem; }
  .hero-title { font-size: 1.25rem; }
  .top-nav { gap: 1rem; font-size: 0.8rem; }
  .form-card { padding: 1.5rem; }
  .mode-grid { grid-template-columns: 1fr; }
  .input-with-hint { flex-direction: column; gap: 0.25rem; }
  .input-hint { width: auto; padding-top: 0; }
  .form-row { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 1.5rem; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
