:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-hover: #21262d;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  padding: 48px 24px 32px;
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.08) 0%, transparent 100%);
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 1rem;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 64px;
  flex: 1;
  width: 100%;
}

/* Input */
.input-section {
  margin-bottom: 40px;
}

.input-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.input-box label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-row input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.input-row input::placeholder {
  color: var(--text-secondary);
}

.input-row button {
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.input-row button:hover {
  background: var(--accent-hover);
}

.hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 12px;
}

.hint strong {
  color: var(--accent);
}

/* Result */
.result-section {
  margin-bottom: 40px;
}

.result-section.hidden {
  display: none;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 16px;
  border-left: 4px solid var(--border);
}

.timeline-item.past {
  border-left-color: var(--success);
}

.timeline-item.current {
  border-left-color: var(--warning);
  background: rgba(210, 153, 34, 0.08);
}

.timeline-item.future {
  border-left-color: var(--accent);
}

.timeline-item .age-badge {
  min-width: 70px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.timeline-item .age-badge.past { color: var(--success); }
.timeline-item .age-badge.current { color: var(--warning); }
.timeline-item .age-badge.future { color: var(--accent); }

.timeline-item .info {
  flex: 1;
}

.timeline-item .info .year {
  font-size: 1.1rem;
  font-weight: 600;
}

.timeline-item .info .desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.past {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
}

.status-badge.current {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
}

.status-badge.future {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

/* Alert */
.alert {
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.alert.warning {
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--warning);
}

.alert.info {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--accent);
}

.alert.success {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--success);
}

/* Table */
.table-section h2,
.note-section h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 40px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--bg-secondary);
}

th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-hover);
}

td:first-child {
  font-weight: 600;
  color: var(--accent);
}

/* Note */
.note-section {
  margin-bottom: 40px;
}

.note-section ul {
  list-style: none;
  padding: 0;
}

.note-section li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.note-section li strong {
  color: var(--warning);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 600px) {
  .header h1 { font-size: 1.4rem; }
  .input-row { flex-direction: column; }
  .input-row button { width: 100%; }
  .timeline-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .timeline-item .age-badge { font-size: 1.2rem; }
}

.timeline-item .info .window {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 3px 10px;
}

.timeline-item.current .info .window {
  border-color: rgba(210, 153, 34, 0.5);
  color: var(--warning);
}

.timeline-item.future .info .window {
  border-color: rgba(88, 166, 255, 0.4);
  color: var(--accent);
}

/* Thanh progress hiển thị vị trí hiện tại */
.progress-bar {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
}

.progress-bar .progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.progress-bar .progress-track {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--accent));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-bar .progress-marker {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-secondary);
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--accent);
}