/* ====================================================
   ADAS Dashboard — 자동차 기업 톤 (다크 네이비 + 주황금)
   ==================================================== */

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

:root {
  /* 배경 */
  --bg-deep: #0A1628;
  --bg-card: #152238;
  --bg-card-hover: #1A2B45;
  --bg-elevated: #1F3050;

  /* 텍스트 */
  --text-primary: #F5F1E8;
  --text-secondary: #B0B8C8;
  --text-muted: #6B7896;

  /* 액센트 */
  --accent: #D4A24C;
  --accent-bright: #E8B45C;
  --accent-dim: rgba(212, 162, 76, 0.15);

  /* 상태 */
  --color-done: #4FD1B5;
  --color-active: #E8B45C;
  --color-pending: #8896B0;
  --color-warning: #E87A5C;
  --color-empty: #2A3A55;

  /* 보더 */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* 카테고리 (10단계) */
  --cat-data: #8896B0;
  --cat-model: #A3D854;
  --cat-system: #D4A24C;
}

body {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding: 0;
  background-image:
    radial-gradient(at 0% 0%, rgba(212, 162, 76, 0.06) 0%, transparent 50%),
    radial-gradient(at 100% 100%, rgba(79, 209, 181, 0.04) 0%, transparent 50%);
}

/* ====================================================
   HERO HEADER
   ==================================================== */
.hero {
  padding: 56px 64px 48px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(212, 162, 76, 0.03), transparent);
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  left: 64px; bottom: -1px;
  width: 80px; height: 3px;
  background: var(--accent);
}

.hero-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.hero-meta .tag {
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  text-transform: uppercase;
  font-weight: 500;
}
.hero-meta .date {
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 64px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-weight: 300;
}

.hero-author {
  display: inline-block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 4px;
  border-left: 3px solid var(--accent);
}

.hero-status {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(232, 122, 92, 0.08);
  border: 1px solid rgba(232, 122, 92, 0.2);
  border-radius: 4px;
  font-size: 12px;
  color: var(--color-warning);
  margin-left: 12px;
}

.status-dot {
  width: 8px; height: 8px;
  background: var(--color-warning);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* ====================================================
   SECTION 공통
   ==================================================== */
.section {
  padding: 56px 64px;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 500;
}

.section-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.section-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}

/* ====================================================
   01: 요약 카드 그리드
   ==================================================== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.summary-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  opacity: 0.6;
}

.summary-card.highlight::before { opacity: 1; }
.summary-card.highlight {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  font-weight: 500;
}

.summary-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.summary-value.accent {
  color: var(--accent-bright);
}

.summary-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 6px;
}

.summary-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ====================================================
   02: 워크플로우 사이클 (10단계)
   ==================================================== */
.workflow-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  overflow-x: auto;
}

.workflow-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.workflow-stage {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 10px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  cursor: default;
}

.workflow-stage:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.workflow-stage[data-cat="data"] { border-left: 3px solid var(--cat-data); }
.workflow-stage[data-cat="model"] { border-left: 3px solid var(--cat-model); }
.workflow-stage[data-cat="system"] { border-left: 3px solid var(--cat-system); }

.stage-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stage-name {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.3;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workflow-legend {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.workflow-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-legend i {
  width: 14px; height: 3px;
  display: inline-block;
}

.workflow-legend i.data { background: var(--cat-data); }
.workflow-legend i.model { background: var(--cat-model); }
.workflow-legend i.system { background: var(--cat-system); }

/* ====================================================
   03: 차종 카드 그리드 (메인 뷰)
   ==================================================== */
.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.vehicle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.vehicle-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(212, 162, 76, 0.15);
}

.vehicle-card::after {
  content: '→';
  position: absolute;
  top: 24px; right: 24px;
  color: var(--text-muted);
  font-size: 20px;
  transition: all 0.3s ease;
}

.vehicle-card:hover::after {
  color: var(--accent-bright);
  transform: translateX(4px);
}

.vehicle-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.vehicle-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.vehicle-project {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.vehicle-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.stage-current {
  color: var(--accent-bright);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.stage-next {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.stage-arrow { color: var(--text-muted); }

.functions-list {
  margin-bottom: 20px;
}

.function-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.function-name {
  width: 100px;
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.function-bar {
  flex: 1;
  height: 8px;
  background: var(--color-empty);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.function-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.function-percent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.vehicle-issues {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.issue-stat {
  flex: 1;
}

.issue-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.issue-stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--text-primary);
}

.issue-stat-value.warning { color: var(--color-warning); }
.issue-stat-value.active { color: var(--accent-bright); }
.issue-stat-value.done { color: var(--color-done); }

/* ====================================================
   04: 자동화 플로우 다이어그램
   ==================================================== */
.flow-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: stretch;
}

.flow-node {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 16px;
  text-align: center;
  position: relative;
}

.flow-node.start { border-color: var(--cat-data); }
.flow-node.process { border-color: var(--accent); background: rgba(212, 162, 76, 0.05); }
.flow-node.end { border-color: var(--color-done); }

.flow-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}

.flow-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.flow-detail {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

/* ====================================================
   05: 시간 절감 효과
   ==================================================== */
.savings-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
}

.savings-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.savings-card.before {
  border-left: 4px solid var(--color-warning);
}

.savings-card.after {
  border-left: 4px solid var(--color-done);
}

.savings-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.savings-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 72px;
  line-height: 1;
  margin-bottom: 4px;
}

.savings-card.before .savings-value { color: var(--color-warning); }
.savings-card.after .savings-value { color: var(--color-done); }

.savings-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  color: var(--text-muted);
}

.savings-detail {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.5;
}

.savings-arrow {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  color: var(--accent);
  text-align: center;
}

.savings-arrow .label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
}

/* ====================================================
   FOOTER
   ==================================================== */
.footer {
  padding: 32px 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.footer-meta {
  font-family: 'JetBrains Mono', monospace;
}

/* ====================================================
   VEHICLE 상세 페이지
   ==================================================== */
.vehicle-detail-page {
  padding: 40px 64px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 32px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.back-link:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.vehicle-detail-header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--accent);
}

.vehicle-detail-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 80px;
  color: var(--text-primary);
  line-height: 1;
}

.vehicle-detail-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-muted);
}

.vehicle-detail-stage {
  margin-left: auto;
  text-align: right;
}

.vehicle-detail-stage .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.vehicle-detail-stage .value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: var(--accent-bright);
}

.function-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}

.function-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.function-detail-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.function-stages-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.function-stage-cell {
  padding: 10px 6px;
  text-align: center;
  border-radius: 4px;
  font-size: 10px;
  border: 1px solid var(--border);
  background: var(--color-empty);
  color: var(--text-muted);
}

.function-stage-cell.done {
  background: rgba(79, 209, 181, 0.15);
  border-color: var(--color-done);
  color: var(--color-done);
}

.function-stage-cell.active {
  background: rgba(232, 180, 92, 0.15);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  animation: pulse-bg 2s infinite;
}

@keyframes pulse-bg {
  0%, 100% { background: rgba(232, 180, 92, 0.15); }
  50% { background: rgba(232, 180, 92, 0.30); }
}

.tasks-issues-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.list-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.list-item:last-child { border-bottom: none; }

.list-item-key {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-bright);
  font-size: 11px;
}

.list-item-summary {
  color: var(--text-secondary);
  flex: 1;
  margin: 0 12px;
}

.list-item-status {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
}

.list-item-status.done { background: rgba(79, 209, 181, 0.15); color: var(--color-done); }
.list-item-status.active { background: rgba(232, 180, 92, 0.15); color: var(--accent-bright); }
.list-item-status.pending { background: rgba(136, 150, 176, 0.15); color: var(--text-muted); }
.list-item-status.warning { background: rgba(232, 122, 92, 0.15); color: var(--color-warning); }

/* 반응형 */
@media (max-width: 900px) {
  .hero, .section, .footer { padding-left: 32px; padding-right: 32px; }
  .hero-title { font-size: 44px; }
  .workflow-row { grid-template-columns: repeat(5, 1fr); }
}
