/* Accordion/Collapse Component Fixes */

/* Hide radio buttons but keep them functional */
.collapse input[type="radio"],
.collapse input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  z-index: -1;
}

/* Style the collapse component */
.collapse {
  position: relative;
  border: 1px solid hsl(var(--b3));
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.collapse:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Style the collapse title */
.collapse-title {
  position: relative;
  padding: 1rem 3rem 1rem 1rem;
  font-weight: 600;
  cursor: pointer;
  background-color: hsl(var(--b1));
  transition: background-color 0.3s ease;
  user-select: none; /* Prevent text selection */
  display: flex;
  align-items: center;
}

.collapse-title:hover {
  background-color: hsl(var(--b2));
}

.collapse-title:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--p) / 0.3);
}

/* Remove margin from h3 in collapse title */
.collapse-title h3 {
  margin-bottom: 0;
}

/* Style the collapse arrow - pointing DOWN by default */
.collapse-arrow .collapse-title::after {
  content: '';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-75%) rotate(45deg);
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid hsl(var(--bc));
  border-bottom: 2px solid hsl(var(--bc));
  transition: transform 0.3s ease;
  pointer-events: none; /* Ensure clicks pass through to the title */
}

/* Rotate arrow when open - pointing UP */
.collapse-arrow input[type="radio"]:checked ~ .collapse-title::after,
.collapse-arrow input[type="checkbox"]:checked ~ .collapse-title::after,
.collapse-arrow .collapse-title[aria-expanded="true"]::after {
  transform: translateY(-25%) rotate(-135deg);
}

/* Style the collapse content */
.collapse-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  transition: max-height 0.5s ease, padding 0.3s ease;
  opacity: 0;
  transition: max-height 0.5s ease, padding 0.3s ease, opacity 0.3s ease;
}

/* Show content when radio is checked */
.collapse input[type="radio"]:checked ~ .collapse-content,
.collapse input[type="checkbox"]:checked ~ .collapse-content,
.collapse .collapse-title[aria-expanded="true"] + .collapse-content {
  max-height: 2000px; /* Larger value to accommodate more content */
  padding: 0.75rem 1rem; /* Reduced vertical padding */
  opacity: 1;
}

/* Remove card styling inside collapse content */
.collapse-content .card {
  box-shadow: none;
  border-radius: 0;
}

.collapse-content .card-body {
  padding: 0.75rem 0; /* Reduced vertical padding */
}

/* Focus styles for keyboard navigation */
.collapse input[type="radio"]:focus-visible + .collapse-title,
.collapse input[type="checkbox"]:focus-visible + .collapse-title {
  outline: 2px solid hsl(var(--p));
  outline-offset: 2px;
}


#why-important .card-body{
  height: auto;
}
