/* —— Global Reset & Body —— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #F7F9F8;
  color: #333333;
  line-height: 1.6;
}

/* Ensure header and footer only take as much height as their content */
header,
footer {
  flex: 0 0 auto;
}

/* —— Main Wrapper & Content —— */
.main-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 0;
  display: flex;
  min-height: calc(100vh - 64px); /* Adjust based on header/footer height */
  position: relative;
}

.content {
  background: #FFFFFF;
  padding: 32px;
  margin-left: 2px; /* Sidebar width + some spacing */
  min-height: 100%;
  width: calc(100% - 256px);
}

/* —— Sidebar Styles —— */
.sidebar {
  position: sticky;
  top: 0px;
  left: 50%;
  transform: translateX(calc(-480px + 16px)); /* Half of max-width minus padding */
  width: 240px;
  background: #F7F9F8;
  padding: 16px;
      max-height: 100vh;
  overflow-y: auto;
  z-index: 10;
}


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

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

.sidebar a {
  display: block;
  color: #333333;
  text-decoration: none;
  padding-left: 8px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.sidebar a:hover {
  background: rgba(31,154,90, 0.1);
}


/* Ensure parent topic stays active when subsection is active */
.sidebar a.active {
  color: #1F9A5A;
  border-left: 4px solid #1F9A5A;
  padding-left: 12px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-weight: bold;
}

/* Subsection styling */
.sidebar .subsections {
  margin-left: 16px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.sidebar .subsections li {
  margin-bottom: 4px;
}

.sidebar .subsections a {
  font-size: 0.85rem; /* Smaller than main topics */
  color: #555;
  padding-left: 4px;
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: 1.3;
}

.sidebar .subsections a:hover {
  color: #1F9A5A;
  background: rgba(31,154,90, 0.05);
}

/* Active subsection - different color from main topic active */
.sidebar .subsections a.active-subsection {
  color: #2E7D49; /* Darker green than main active */
  background: rgba(31,154,90, 0.1);
  border-left: 3px solid #2E7D49; /* Thinner border than main active */
  padding-left: 9px; /* Adjust for border */
  font-weight: 500; /* Slightly bolder but not as bold as main active */
}




/* —— Button‐style Pills (inline references) —— */
.btn-pill {
  display: inline-block;
  background: #E6F4EC;
  border: 1px solid #E0E5E2;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9rem;
  color: #333333;
}


/* Optional: headings */
h1, h2, h3, h4 {
  margin-top: 0;
  color: #1F9A5A;
}

h3 {
  color: #333333;
  font-size: 1.1rem;
  margin-bottom: 8px;
}




/* —— Example‐Render Wrapper —— */
.example-render {
  background: #F7FAF8;            /* very light green‐gray background to distinguish from text */
  border: 1px solid #E0E5E2;      /* light gray border */
  border-radius: 4px;             /* subtle rounding */
  padding: 16px;                  /* inner padding for breathing room */
  margin: 16px 0;                 /* space above and below the example */
}

/* —— Progress Bar Styles —— */
.progress-bar {
  background: #E0E5E2;            /* light gray track */
  border-radius: 4px;
  width: 100%;                    /* full width of its container */
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  background: #1F9A5A;            /* primary green fill */
  width: 0%;                      /* initial 0% fill; updated dynamically in JS */
  height: 100%;
  transition: width 0.3s ease;    /* smooth fill animation */
}

/* —— Score Circle Styles —— */
.score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(
    #1F9A5A 0% 70%,
    #E0E5E2 70% 100%
  ); /* 70% in green, rest in gray—adjust percentage dynamically */
  display: inline-block;
  vertical-align: middle;
  margin: 0 auto 12px auto;
  position: relative;
}
.score-circle > span {
  display: block;
  text-align: center;
  line-height: 80px;
  font-size: 1.25rem;
  color: #333333;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

/* —— Metric List Styles —— */
.metric-list {
  width: 100%;
}
.metric-list .serp-dsh-metric {
  background: #E6F4EC;            /* light gray background */
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 0.95rem;
}

/* —— Card Styles (for illustration) —— */
.card.serp-dsh-card {
  background: #FFFFFF;
  border: 1px solid #E0E5E2;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  width: 100%;
  margin: 0 auto;
}
.card.serp-dsh-card .card-header {
  background: #E6F4EC;
  text-align: center;
  padding: 16px;
}
.card.serp-dsh-card .card-header h3 {
  margin: 0;
  color: #1F9A5A;
  font-size: 1.25rem;
}
.card.serp-dsh-card .card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* —— “View Details” Button Styling —— */
.view-details-btn {
  background: #1F9A5A;
  color: #FFFFFF;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.view-details-btn:hover {
  background: #178A4C;  /* slightly darker green on hover */
}

/* —— Responsive Design —— */
@media (max-width: 768px) {
  .main-wrapper {
    flex-direction: column;
    padding: 16px;
  }
  
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    margin-bottom: 16px;
    transform: none;
  }
  
  .content {
    margin-left: 0;
    width: 100%;
  }
}