

/* Radio Buttons style */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-card {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 8px;
  background-color: var(--card-bg);
  transition: background-color 0.3s, border-color 0.3s;
  border: 1px solid var(--card-border-color);
}

.radio-card:hover .radio-content {
  border-color: var(--card-border-color);
}

.radio-card input {
  display: none;
}

/* Add subtle borders between main radio options */
.radio-group .radio-card + .radio-card .radio-content {
  border-top: 1px solid var(--card-border-color) !important;
}

/* Main level radio buttons only (not sub-options) */
.radio-group > .radio-card input:checked + .radio-content {
  background-color: var(--highlight-color-opacity);
  border-color: var(--highlight-color-opacity);
}

/* Fallback for any radio cards not in suboptions */
.radio-card:not(.suboptions .radio-card) input:checked + .radio-content {
  background-color: var(--highlight-color-opacity);
  border-color: var(--highlight-color-opacity);
}

.radio-circle {
  width: 20px;
  height: 20px;
  border: 2px solid var(--card-border-color);
  border-radius: 50%;
  background-color: var(--secondary-color);
  /* White center */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, border-color 0.3s;
}

.radio-card input:checked+.radio-content .radio-circle {
  border: 5px solid var(--highlight-color-opacity-medium);
}

.radio-label {
  font-size: 16px;
  font-weight: 500;
}

/* Modern subtle arrow icon styling */
.arrow-icon {
  margin-left: auto;
  width: 16px;
  height: 16px;
  position: relative;
  transition: transform 0.3s ease;
  opacity: 0.6;
}

.arrow-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  transform: translate(-50%, -50%) rotate(-45deg);
  transition: all 0.3s ease;
}

/* Hover effect for arrow */
.radio-card:hover .arrow-icon {
  opacity: 1;
}

.radio-card:hover .arrow-icon::after {
  border-color: var(--primary-color);
}

/* Sub-options container styling - LEVEL 2 */
.suboptions {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-top: 1px solid var(--card-border-color);
  background-color: var(--card-bg);
  border-radius: 0 0 8px 8px;
  border: 1px solid var(--card-border-color);
}

/* Reset any inherited styling for sub-option radio cards */
.suboptions .radio-card {
  background: none !important;
  margin: 0;
  border: none;
  border-radius: 0;
}

.suboptions .radio-content {
  padding: 12px 18px; /* Normal padding - visual hierarchy from container styling */
  border: none;
  border-top-left-radius: 0 !important; /* Force no top border radius for all suboptions */
  border-top-right-radius: 0 !important; /* Force no top border radius for all suboptions */
  background-color: var(--secondary-color) !important; /* Force white background for sub-options */
  position: relative;
}

/* Ensure first suboption has no top border radius to seamlessly connect with main option */
.suboptions .radio-card:first-child .radio-content {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

/* More specific override for all suboption radio content to ensure no top radius */
.mainConditionCard.open + * .suboptions .radio-card:first-child .radio-content,
.suboptions .radio-card:first-of-type .radio-content,
.radio-card .suboptions .radio-card:first-child .radio-content {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-radius: 0 !important;
}

/* Remove visual dots - radio buttons are clear enough */

/* Add borders between sub-options with higher specificity */
.suboptions .radio-card + .radio-card .radio-content {
  border-top: 1px solid var(--card-border-color) !important;
}

.suboptions .radio-card:hover .radio-content {
  background-color: var(--card-bg) !important; /* Override any inherited styling */
  border-color: transparent;
}

.suboptions .radio-card:last-child .radio-content {
  border-bottom-left-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

/* Ensure middle suboptions have no border radius at all */
.suboptions .radio-card:not(:first-child):not(:last-child) .radio-content {
  border-radius: 0 !important;
}

.suboptions .radio-card input:checked + .radio-content {
  border-color: transparent;
}

/* Main condition card styling when expanded */
.mainConditionCard {
  border-radius: 8px;
  /* margin-bottom: 12px; */
  transition: border-color 0.3s, background-color 0.3s;
}


.mainConditionCard.open .radio-content {
  background-color: var(--highlight-color-opacity);
  border-color: var(--highlight-color-opacity);
  border-radius: 8px 8px 0 0;
  font-weight: 600; /* Emphasize selected main condition */
}

.mainConditionCard.open .arrow-icon {
  transform: rotate(90deg);
}

/* LEVEL 3: Multi-select styling - make it clearly distinct */
#suboptionCustomCheckbox {
  margin: 12px 0 0 0; /* No left indentation - visual hierarchy from styling */
  padding: 20px; /* Increased padding for better spacing */
  background-color: var(--card-bg);
  border: 2px dashed var(--highlight-color); /* Dashed border to distinguish from solid borders */
  border-radius: 8px;
  position: relative;
}

/* Override any conflicting multi-select styles with higher specificity */
#suboptionCustomCheckbox.suboptionMultiSelectCheckboxGroup {
  margin: 8px !important;
  padding: 0px !important;
  background-color: var(--card-bg) !important;
  border: 2px dashed var(--highlight-color-opacity) !important;
  border-radius: 8px !important;
  width: auto !important;
}

#suboptionCustomCheckbox::before {
  content: 'Wähle die betroffenen Bereiche:';
  position: absolute;
  top: -10px;
  left: 12px;
  background-color: var(--secondary-color);
  padding: 0 8px;
  font-size: 12px;
  color: var(--primary-color);
  font-weight: 500;
}

#suboptionCustomCheckbox .suboptionMultiSelectCheckboxCard {
  margin-bottom: 8px;
}

#suboptionCustomCheckbox .suboptionMultiSelectCheckboxContent {
  padding: 12px 16px; /* Slightly increased padding for better spacing */
  background-color: var(--card-bg); 
  border: 1px solid var(--card-border-color);
  border-radius: 6px;
  transition: all 0.2s ease;
}

#suboptionCustomCheckbox .suboptionMultiSelectCheckboxCard:hover .suboptionMultiSelectCheckboxContent {
  border-color: var(--highlight-color);
  box-shadow: 0 2px 4px rgba(120, 209, 210, 0.2);
}

/* Loading States - using specific class name to avoid Power Pages conflicts */
.radio-group.kanna-radio-loading {
  pointer-events: none; /* Disable all interactions during loading */
}

.radio-card.selected-loading .radio-content {
  background-color: var(--highlight-color-opacity);
  border-color: var(--highlight-color);
  position: relative;
}

.radio-card.disabled-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Ensure radio cards never rotate - protect against any CSS conflicts */
.radio-card, .radio-content, .radio-label {
  transform: none !important;
  animation: none !important;
}

/* No CSS animations needed - using JavaScript-based loading indicator */

/* Prevent text selection during loading */
.radio-group.kanna-radio-loading * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

@media (max-width: 768px) {
  .radio-content {
    padding: 12px 16px;
  }

  .radio-label {
    font-size: 14px;
  }
  
  .suboptions .radio-content {
    padding: 10px 16px; /* No indentation on mobile either */
  }
}