/* -----------------------------------------------------------
   COLLAPSIBLE SECTIONS
----------------------------------------------------------- */
.collapsible-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  position: relative;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              padding-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: max-height, opacity;
}

.collapsible-content label {
  margin-top: -0.1rem;
  margin-bottom: 0rem;
}

details[open] .collapsible-content {
  max-height: 3000px;
  opacity: 1;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              padding-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

details {
  transition: all 0.3s ease;
}

details summary {
  transition: background-color 0.2s ease;
  cursor: pointer;
  user-select: none;
  position: relative;
  list-style: none;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::marker {
  display: none;
}

details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  color: #5ba543;
  font-size: 1.2em;
  line-height: 1;
  vertical-align: middle;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover {
  background-color: #f9f9f9;
  border-radius: 4px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.collapsible-summary {
  /* Additional styling for collapsible summaries */
}

.collapsible-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  color: #5ba543;
  font-size: 1.2em;
  line-height: 1;
  vertical-align: middle;
}

details[open] .collapsible-summary::before {
  transform: rotate(90deg);
}

.collapsible-summary:hover {
  background-color: #f9f9f9;
}

.details-section {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.details-summary {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.details-summary:hover {
  background-color: #f0f0f0;
}

.details-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e0e0e0;
  overflow: visible !important;
  position: relative;
}

.details-content label {
  margin-top: 4px;
  margin-bottom: 2px;
  font-weight: 500;
}

.details-content textarea,
.details-content input,
.details-content select {
  padding: 8px 10px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.details-content textarea {
  min-height: 136px;
}

.details-summary .summary-arrow {
  transition: transform 0.3s ease;
}

details[open] .summary-arrow {
  transform: rotate(180deg);
}

/* Nested collapsibles */
#advanced-sender-details .collapsible-content,
#final-notes-details .collapsible-content {
  gap: 0.5rem !important;
  padding-left: 0.75rem !important;
  margin-top: 0.25rem !important;
}

#advanced-sender-details summary,
#final-notes-details summary {
  padding: 0.3rem 0 !important;
  font-size: 0.95rem;
}

/* Sender details specific */
#sender-details[open] summary .chevron-icon {
  transform: rotate(-180deg);
  transition: transform 0.3s ease;
}

#sender-details summary .chevron-icon {
  transition: transform 0.3s ease;
}

/* SEO Details (FAQ) */
.seo-details summary {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
}

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

.seo-details summary::before {
  content: "▸";
  margin-right: 6px;
  transition: transform 0.2s ease;
}

.seo-details[open] > summary::before {
  transform: rotate(90deg);
}

.seo-details h3 {
  text-align: center;
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.seo-details details {
  margin-top: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  padding: 0.75rem 1rem;
}

.seo-details details summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  list-style: none;
  position: relative;
  padding-left: 1.2rem;
  font-weight: 500;
  font-size: 1rem;
}

.seo-details details summary::before {
  content: "▸";
  position: absolute;
  left: 0;
  transition: transform 0.2s ease;
}

.seo-details details[open] > summary::before {
  transform: rotate(90deg);
}

.seo-details details[open] summary {
  border-bottom: 1px solid #eee;
  margin-bottom: 0.5rem;
}

.seo-details details p {
  margin: 0;
  padding-top: 0.5rem;
  line-height: 1.6;
  color: #555;
}

.seo-details a:hover {
  text-decoration: underline;
}
