/* ======================= */
/* Variáveis principais    */
/* ======================= */
:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --sucess-color: #43fc4c;
  --sucess-border-color: #00bb09;
  --accent-color: #f8f9fa;
  --text-color: #333;
  --background-color: #f4f5f7;

  /* Títulos e destaques */
  --header-text-color: #ffffff;
  --section-title-color: var(--primary-color);
  --subsection-title-color: #495057;

  /* Código */
  --code-bg: #2d3748;
  --code-header-bg: #4a5568;
  --code-text-color: #e2e8f0;

  /* Cards / Benefits */
  --card-bg: #ffffff;
  --card-border-top: var(--primary-color);
  --card-shadow: rgba(0, 0, 0, 0.1);

  /* Sidebar */
  --sidebar-bg: var(--accent-color);
  --sidebar-shadow: rgba(0, 0, 0, 0.07);
  --sidebar-link-bg-hover: #e9ecef;
  --sidebar-link-text: var(--primary-color);
  --sidebar-link-hover-text: #495057;

  /* Botões */
  --nav-tab-bg: var(--accent-color);
  --nav-tab-text: var(--primary-color);
  --nav-tab-border: var(--primary-color);
  --nav-tab-hover-bg: #e9ecef;
  --nav-tab-hover-text: #495057;
}

/* ======================= */
/* Reset e estrutura       */
/* ======================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  display: flex;
  align-items: center;
  flex-flow: column wrap;
}

article {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 30px;
  margin: 0 20px;
}

header {
  text-align: center;
  color: var(--header-text-color);
  margin-bottom: 40px;
  padding: 40px 20px;
  max-width: 60em;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.content {
  display: flex;
  background: var(--card-bg);
  border-radius: 15px;
  box-shadow: 0 20px 40px var(--card-shadow);
  overflow: hidden;
  margin: 0 5px 30px 5px;
  width: 99%;
  max-width: 80em;
}

/* ======================= */
/* RoadMap    */
/* =======================  */

.roadmap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
}

/* botão Iniciar */
.btn-start {
  background: var(--primary-color);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.12);
  z-index: 3;
}

/* container reserva espaço */
.roadmap-container {
  max-width: 90%;
  padding: 1.2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  /* controle espaço entre itens */
  position: relative;
}

/* linha (depois dos inputs no DOM) */
.roadmap-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 55px;
  /* distanciamento do topo do container */
  width: 6px;
  height: 0;
  /* começa com 0; será aumentado por :checked */
  background: var(--primary-color);
  border-radius: 4px;
  transition: height 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 0;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.08);
}

.desc {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* itens (labels) */
.desc-start,
.desc-1,
.desc-2,
.desc-3,
.desc-4,
.desc-5,
.desc-6,
.desc-fim {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.roadmap-item {
  display: none;
  /* somente aparece quando permitido pelo CSS */
  padding: 0.6rem 1rem;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  background: #fff;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  z-index: 2;
  /* acima da linha */
  transition: all 0.2s ease;
  width: 220px;
  text-align: center;
}

.roadmap-fim {
  display: none;
  /* somente aparece quando permitido pelo CSS */
  padding: 0.6rem 1rem;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  background: #fff;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  z-index: 2;
  /* acima da linha */
  transition: all 0.2s ease;
  width: 220px;
  text-align: center;
}

.roadmap-item:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-3px);
}
.roadmap-fim:hover {
  transform: translateY(-3px);
  background: var(--sucess-color);
  border: 2px solid var(--sucess-color);
  color: #fff;
}
#fim:checked ~ .roadmap-fim {
  background: var(--sucess-color) !important;
  border: 2px solid var(--sucess-color) !important;
  color: #fff;
}

/* inputs escondidos */
input[type="checkbox"] {
  position: absolute;
  left: -9999px;
}

/* Cada passo revela o próximo (os inputs estão antes dos labels) */
#start:checked ~ .item-1,
#step1:checked ~ .item-2,
#step2:checked ~ .item-3,
#step3:checked ~ .item-4,
#step4:checked ~ .item-5,
#step5:checked ~ .roadmap-fim {
  display: inline-block;
  animation: fadeIn 0.35s ease;
}

#start:not(:checked) ~ .desc-start {
  display: flex !important;
}
#start:checked ~ .desc-1 {
  display: flex !important;
}
#step1:checked ~ .desc-1 {
  display: none !important;
}
#step1:checked ~ .desc-2 {
  display: flex !important;
}
#step2:checked ~ .desc-2 {
  display: none !important;
}
#step2:checked ~ .desc-3 {
  display: flex !important;
}
#step3:checked ~ .desc-3 {
  display: none !important;
}
#step3:checked ~ .desc-4 {
  display: flex !important;
}
#step4:checked ~ .desc-4 {
  display: none !important;
}
#step4:checked ~ .desc-5 {
  display: flex !important;
}
#step5:checked ~ .desc-5 {
  display: none !important;
}
#step5:checked ~ .desc-6 {
  display: flex !important;
}
#fim:checked ~ .desc-6 {
  display: none !important;
}
#fim:checked ~ .desc-fim {
  display: flex !important;
}

/* quando marcado, estilo do próprio item (input + label são adjacentes) */
#step1:checked + .item-1,
#step2:checked + .item-2,
#step3:checked + .item-3,
#step4:checked + .item-4,
#step5:checked + .item-5,
#fim:checked + .roadmap-fim {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.08);
}

/* Crescimento da linha conforme progresso (os valores são aproximados — ajuste ao seu gap/altura) */
#start:checked ~ .line-1 {
  height: 54px;
}

#step1:checked ~ .line-2 {
  height: 120px;
}

#step2:checked ~ .line-3 {
  height: 186px;
}

#step3:checked ~ .line-4 {
  height: 262px;
}

#step4:checked ~ .line-5 {
  height: 338px;
}

#step5:checked ~ .line-6 {
  height: 422px;
}

/* animação entrada */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================= */
/* Títulos e subtítulos     */
/* ======================= */
.section-title {
  color: var(--section-title-color);
  font-size: 2rem;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--section-title-color);
  padding-bottom: 10px;
}

.subsection-title {
  color: var(--subsection-title-color);
  font-size: 1.5rem;
  margin: 30px 0 15px 0;
}

/* ======================= */
/* Código                  */
/* ======================= */
.code-container {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  overflow-x: auto;
}

.code-header {
  background: var(--code-header-bg);
  color: var(--header-text-color);
  padding: 10px 20px;
  margin: -20px -20px 20px -20px;
  font-weight: bold;
  border-radius: 10px 10px 0 0;
}

.code {
  color: var(--code-text-color);
  font-family: "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ======================= */
/* Cards / Benefits         */
/* ======================= */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.benefit-card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--card-shadow);
  border-top: 4px solid var(--card-border-top);
  transition: transform 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-5px);
}

.benefit-title {
  color: var(--section-title-color);
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 10px;
}

/* ======================= */
/* Analogia                 */
/* ======================= */
.analogy-box {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 25px;
  border-radius: 15px;
  margin: 25px 0;
  border-left: 5px solid #ff6b6b;
}

.analogy-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #d63031;
  margin-bottom: 15px;
}

/* ======================= */
/* Sidebar / navegação      */
/* ======================= */
.sidebar {
  min-width: 240px;
  background: var(--sidebar-bg);
  border-radius: 15px;
  box-shadow: 0 4px 12px var(--sidebar-shadow);
  padding: 30px 10px;
  margin-right: 30px;
  height: fit-content;
}

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

.sidebar li {
  margin-bottom: 12px;
}

.sidebar .nav-tab {
  display: block;
  padding: 12px 18px;
  color: var(--sidebar-link-text);
  background: none;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

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

.active-nav {
  color: var(--secondary-color) !important;
}

/* Accordion */
.sidebar.accordion details {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
}

.sidebar.accordion summary {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--primary-color);
}

.sidebar.accordion summary::-webkit-details-marker {
  display: none;
}

.sidebar.accordion summary::after {
  content: "▸";
  margin-left: auto;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.sidebar.accordion details[open] summary::after {
  transform: rotate(90deg);
}

.sidebar.accordion ul {
  margin: 0;
  padding: 8px 0 10px 0;
}
.sidebar.accordion li {
  list-style: none;
}

.sidebar.accordion .nav-tab:hover,
.sidebar.accordion .nav-tab:focus {
  background: var(--accent-color);
  outline: none;
}

.sidebar .active-nav {
  background: var(--primary-color);
  color: #fff !important;
}

/* ======================= */
/* Footer                  */
/* ======================= */
footer {
  display: flex;
  flex-flow: column wrap;
  background: var(--background-color);
  color: var(--text-color);
  border-radius: 15px 15px 0 0;
  width: 99%;
  max-width: 80em;
}

footer .footer-inner {
  padding: 16px 20px;
  text-align: center;
  font-size: 0.95rem;
}

.footer-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-direction: row wrap;
}

.footer-links {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

footer .footer-links a {
  color: var(--primary-color);
  text-decoration: underline;
}

footer .footer-links a:hover,
footer .footer-links a:focus {
  color: #111827;
  outline: none;
}

.buttons-footer {
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s;
}

.buttons-footer:hover {
  background: var(--secondary-color);
}
.buttons-footer:active {
  background: var(--primary-color);
}

/* ======================= */
/* Responsivo               */
/* ======================= */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  .tab-content {
    padding: 20px;
  }
  .code {
    white-space: pre-line;
  }
}

@media (max-width: 900px) {
  .content {
    flex-direction: column;
  }
  .sidebar {
    margin-right: 0;
    margin-bottom: 20px;
    width: 100%;
  }
}
