:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --primary: #007bff;
  --text: #343a40;
  --muted: #6c757d;
  --line: #e2e6ea;
  --nav: #1f242a;
  --success: #1f9d55;
  --warning: #f59f00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.22rem 1.9rem;
  background: var(--nav);
  border-bottom: 1px solid #2f3842;
}

.brand {
  position: absolute;
  left: 1.9rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.66rem;
  display: flex;
  align-items: center;
  gap: 0.78rem;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
  border: 1px solid #44515f;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.15rem;
}

.topbar a {
  color: #d6dee6;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.12rem;
}

.topbar a.active {
  color: #fff;
}

.page {
  padding: 6.45rem 1.4rem 1.6rem;
  width: min(1260px, 100%);
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.card:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn.secondary {
  background: #e9eef5;
  color: #2f3945;
}

.btn.ghost {
  background: #fff;
  color: #2f3945;
  border: 1px solid #d3dce8;
}

/* Home page */
.home-page {
  position: relative;
  overflow: hidden;
}

.home-bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.45;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: #dcecff;
  top: 20px;
  right: -80px;
  animation: floatSlow 8s ease-in-out infinite;
}

.orb-b {
  width: 220px;
  height: 220px;
  background: #e7f4ef;
  bottom: 10px;
  left: -70px;
  animation: floatSlow 10s ease-in-out infinite reverse;
}

.home-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.home-right {
  display: grid;
  gap: 0.9rem;
  animation: liftIn 0.7s ease;
}

.home-hero {
  padding: 1.5rem;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: liftIn 0.5s ease;
}

.home-hero h1 {
  margin: 0.1rem 0 0.7rem;
  font-size: clamp(2rem, 3.8vw, 3rem);
  line-height: 1.08;
}

.home-kicker {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.home-hero p {
  color: var(--muted);
  max-width: 60ch;
}

.home-pill-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.home-pill {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #d8e7fb;
  color: #21558f;
  font-size: 0.82rem;
  font-weight: 600;
}

.home-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
}

.home-actions .btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 123, 255, 0.2);
}

.home-live-chips {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.home-live-chips span {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d9e7fb;
  background: #f5f9ff;
  color: #2562a9;
}

.home-focus-strip {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.home-focus-strip > div {
  border: 1px solid #dfe7f0;
  border-radius: 10px;
  padding: 0.7rem;
  background: #fbfdff;
}

.home-focus-strip strong {
  font-size: 0.92rem;
}

.home-focus-strip p {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}

.info-panel {
  padding: 1rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #d8e6fb;
}

.home-page .info-panel::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 123, 255, 0.18) 0%, rgba(0, 123, 255, 0) 70%);
  pointer-events: none;
}

.home-image-card {
  position: relative;
  padding: 0.8rem;
  min-height: 220px;
  display: grid;
  place-items: center;
  background: #f9fcff;
  border-color: #dce8f5;
  overflow: hidden;
}

.home-hero-image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
  animation: softZoom 9s ease-in-out infinite;
}

.home-image-badge {
  position: absolute;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d8e1ec;
  font-size: 0.77rem;
  font-weight: 700;
  color: #2f3b47;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.home-image-badge.top {
  top: 0.8rem;
  left: 0.8rem;
}

.home-image-badge.bottom {
  right: 0.8rem;
  bottom: 0.8rem;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 123, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.25);
  animation: scan 4.5s linear infinite;
}

.info-panel h3 {
  margin: 0 0 0.5rem;
  position: relative;
  z-index: 1;
}

.home-page .info-panel h3 + p {
  margin-top: 0;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.home-page .info-panel h3:last-of-type {
  margin-top: 0.45rem;
  padding-top: 0.7rem;
  border-top: 1px dashed #d3e0f1;
}

.pipeline {
  margin-top: 1rem;
  padding: 1rem;
  position: relative;
  z-index: 2;
  animation: liftIn 0.85s ease;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.pipeline-grid {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  position: relative;
}

.pipeline-grid::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 123, 255, 0.12), rgba(0, 123, 255, 0.35), rgba(0, 123, 255, 0.12));
  z-index: 0;
  animation: pulseLine 3s ease-in-out infinite;
}

.pipeline-step {
  background: #f9fbff;
  border: 1px solid #dfe8f5;
  border-radius: 10px;
  padding: 0.7rem;
  font-weight: 600;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.08);
}

.pipeline-step:hover {
  transform: translateY(-2px);
  border-color: #b9d2f2;
  box-shadow: 0 10px 18px rgba(0, 123, 255, 0.14);
}

.pipeline-step::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ec5fe;
  box-shadow: 0 0 0 4px rgba(158, 197, 254, 0.2);
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes softZoom {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes scan {
  0% {
    top: 14%;
  }
  100% {
    top: 86%;
  }
}

@keyframes pulseLine {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Dashboard page */
.dashboard-split {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 1rem;
  align-items: start;
}

.dashboard-left {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.dashboard-right {
  display: grid;
  gap: 0.9rem;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
}

.sidebar {
  position: sticky;
  top: 5.7rem;
  align-self: start;
  padding: 1rem;
}

.sidebar h3 {
  margin: 0 0 0.8rem;
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar li {
  padding: 0.45rem 0;
  color: var(--muted);
}

.dashboard-main {
  display: grid;
  gap: 1rem;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.dashboard-title {
  margin: 0;
}

.dashboard-actions {
  display: flex;
  gap: 0.55rem;
}

.analysis-form {
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.analysis-form label {
  font-weight: 600;
}

.analysis-form input,
.analysis-form textarea {
  width: 100%;
  border: 1px solid #ced6df;
  border-radius: 10px;
  padding: 0.65rem;
  font-family: inherit;
}

.mentor-panel {
  border-top: 1px dashed #d4dce7;
  padding-top: 0.9rem;
}

.mentor-panel textarea {
  width: 100%;
  border: 1px solid #ced6df;
  border-radius: 10px;
  padding: 0.65rem;
  font-family: inherit;
  resize: vertical;
}

.mentor-reply {
  margin-top: 0.7rem;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid #d9e2ec;
  background: #f8fbff;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.metric {
  padding: 0.8rem;
}

.metric h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric p {
  margin: 0.35rem 0 0;
  font-size: 2rem;
  font-weight: 700;
}

.skills-row,
.insight-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.section-card {
  padding: 1rem;
}

.tags {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tag {
  background: #edf4ff;
  border: 1px solid #d7e8ff;
  color: #20599b;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.warn-list li {
  color: #8a4f03;
  margin: 0.35rem 0;
}

.graph-path {
  margin: 0.35rem 0;
  border-left: 3px solid var(--primary);
  padding-left: 0.55rem;
}

.dashboard-roadmap {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.dashboard-roadmap li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  padding: 0.6rem;
  background: #f9fbfe;
  cursor: move;
}

.dashboard-roadmap li.dragging {
  opacity: 0.5;
}

.dashboard-roadmap input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Progress page */
.progress-layout {
  display: grid;
  gap: 1rem;
}

.progress-page {
  position: relative;
}

.progress-head {
  padding: 1rem;
}

.progress-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #d7e4f4;
  overflow: hidden;
  position: relative;
}

.progress-hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  right: -120px;
  top: -130px;
  background: radial-gradient(circle, rgba(0, 123, 255, 0.16) 0%, rgba(0, 123, 255, 0) 70%);
}

.progress-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.progress-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #cde0fb;
  background: #eef5ff;
  color: #1f5fa9;
  font-size: 0.78rem;
  font-weight: 700;
}

.progress-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.progress-bar-shell {
  height: 18px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
  margin-top: 0.55rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #007bff, #50a2ff);
  transition: width 0.25s ease;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.28);
  animation: progressPulse 2.4s ease-in-out infinite;
}

.timeline-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0.8rem;
}

.weekly-roadmap,
.progress-status,
.improvement-chart {
  padding: 1rem;
}

.roadmap-timeline {
  border-color: #d7e4f4;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}

.week-card {
  border: 1px solid #dce4ee;
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.55rem;
  background: #fafcff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.week-card:hover {
  transform: translateY(-1px);
  border-color: #b9d2f2;
  box-shadow: 0 8px 14px rgba(0, 123, 255, 0.1);
}

.week-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.week-card.done {
  border-left: 4px solid var(--success);
  background: #f2fbf5;
}

.week-card.pending {
  border-left: 4px solid var(--warning);
  background: #fffaf0;
}

.status-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.completed-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f3fbf6 100%);
  border-color: #d6ecde;
}

.pending-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fff9f1 100%);
  border-color: #f1e2c2;
}

.bar-list {
  display: grid;
  gap: 0.5rem;
}

.skill-chart-panel {
  border-color: #d7e4f4;
  background: radial-gradient(circle at top right, #eef5ff 0%, #ffffff 46%, #f8fbff 100%);
}

.skill-bar-chart {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  align-items: end;
}

.skill-column {
  display: grid;
  grid-template-rows: auto 180px auto;
  gap: 0.45rem;
  align-items: end;
  padding: 0.45rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid #e2eaf5;
}

.column-head {
  min-height: 28px;
  display: flex;
  justify-content: center;
}

.vbar-track {
  height: 180px;
  border-radius: 12px;
  background: linear-gradient(180deg, #edf3fb 0%, #e6edf7 100%);
  border: 1px solid #d8e2f0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}

.vbar-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to top,
    rgba(255, 255, 255, 0.06) 0,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px,
    transparent 30px
  );
  pointer-events: none;
}

.vbar-fill {
  width: 100%;
  min-height: 24px;
  border-radius: 10px 10px 0 0;
  animation: growBar 0.8s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 16px rgba(0, 0, 0, 0.12);
}

.vbar-fill.maturity-strong {
  background: linear-gradient(180deg, #10b981 0%, #0ea5e9 100%);
}

.vbar-fill.maturity-developing {
  background: linear-gradient(180deg, #6366f1 0%, #3b82f6 100%);
}

.vbar-fill.maturity-emerging {
  background: linear-gradient(180deg, #fb923c 0%, #f59e0b 100%);
}

.chart-skill-label {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  text-transform: none;
}

.skill-bars .bar-item {
  padding: 0.2rem 0;
}

.bar-item {
  display: grid;
  grid-template-columns: 140px 1fr 110px;
  align-items: center;
  gap: 0.5rem;
}

.skill-name {
  font-weight: 600;
}

.bar-track {
  background: #e9eef5;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  background: #007bff;
  height: 100%;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.24);
  animation: barSlide 0.7s ease;
}

.maturity-badge {
  justify-self: end;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.bar-item.maturity-strong .bar-fill {
  background: linear-gradient(90deg, #0ea5e9, #10b981);
}

.bar-item.maturity-developing .bar-fill {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.bar-item.maturity-emerging .bar-fill {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.maturity-badge.maturity-strong {
  background: #eaf9f2;
  color: #166534;
  border-color: #bde7cf;
}

.maturity-badge.maturity-developing {
  background: #edf3ff;
  color: #1d4ed8;
  border-color: #cfdfff;
}

.maturity-badge.maturity-emerging {
  background: #fff4e8;
  color: #9a3412;
  border-color: #ffd8b2;
}

@keyframes progressPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1);
  }
}

@keyframes barSlide {
  from {
    width: 0 !important;
  }
}

@keyframes growBar {
  from {
    height: 0 !important;
  }
}

/* Microservices page */
.micro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.micro-card {
  padding: 1rem;
}

.micro-card h3 {
  margin: 0 0 0.45rem;
}

.status-pill {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-ok {
  background: #e7f6ec;
  color: #116431;
}

.status-dev {
  background: #fff6e8;
  color: #955a00;
}

.muted {
  color: var(--muted);
}

#dashboard-status {
  position: relative;
  margin-top: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.22s ease;
}

#dashboard-status.analysis-running {
  color: #0f4f9a;
  background: linear-gradient(120deg, #eef6ff 0%, #f7fbff 55%, #eef6ff 100%);
  border-color: #cfe3fb;
  background-size: 220% 220%;
  animation: analysisPulse 1.3s ease-in-out infinite;
  padding-right: 2.4rem;
}

#dashboard-status.analysis-running::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #7fb2ea;
  border-top-color: #1675e0;
  transform: translateY(-50%);
  animation: statusSpin 0.75s linear infinite;
}

@keyframes analysisPulse {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 rgba(22, 117, 224, 0.16);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 8px 18px rgba(22, 117, 224, 0.14);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 rgba(22, 117, 224, 0.16);
  }
}

@keyframes statusSpin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .home-layout,
  .dashboard-split,
  .dashboard-shell,
  .timeline-grid,
  .skills-row,
  .insight-row {
    grid-template-columns: 1fr;
  }

  .metrics-row,
  .pipeline-grid,
  .micro-grid,
  .status-cols {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .topbar {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .brand {
    position: static;
    margin-right: 1rem;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .nav-links {
    gap: 1rem;
  }

  .home-focus-strip {
    grid-template-columns: 1fr;
  }
}
