/* ===== SECTION LAYOUTS - Section headers, content, collapsible functionality ===== */

/* Unified section styling */
.section {
  margin: 20px 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section border styling system - restore vertical colored lines */
.section-border {
  border-left: 4px solid transparent;
  padding-left: 8px; /* keeps content clear of border */
}

.section-border.sandbox {
  border-left-color: var(--color-sandbox);
}

.section-border.example {
  border-left-color: var(--color-examples);
}

.section-border.settings {
  border-left-color: var(--border-settings);
}

.section-border.journey {
  border-left-color: var(--color-journey);
}

.section-border.project {
  border-left-color: var(--color-project);
}

.section-border.my-projects {
  border-left-color: var(--color-project);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0; /* Remove margin to eliminate empty space */
  padding-bottom: 0; /* Remove padding to eliminate empty space */
  /* Removed border-bottom to eliminate horizontal line */
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-toggle-btn {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 16px;
}

.section-toggle-btn:hover {
  background-color: #f8f9fa;
  color: #495057;
}

.section-toggle-btn.collapsed {
  transform: rotate(-90deg);
}

.section-toggle-btn {
  transition: transform 0.3s ease;
  display: inline-block;
}

.section-content {
  overflow: hidden;
  /* Transition now handled by components.css with better easing */
}

/* Main section collapsed states now handled by components.css with smooth animations */

.section-content:not(.collapsed) {
  opacity: 1;
}

/* Section-specific layout helpers */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.section-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-row label {
  min-width: 120px;
  font-weight: 500;
  color: #495057;
}

.section-row input,
.section-row select,
.section-row textarea {
  flex: 1;
}

/* Collapsible section animations */
.section.collapsible {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.collapsible .section-content {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.collapsible.collapsed {
  background: #f8f9fa;
}

.section.collapsible.collapsed .section-header {
  /* No special styling needed since we removed border-bottom entirely */
}

/* Section footer styling */
.section-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Section status indicators */
.section-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.section-status.active {
  background: #d4edda;
  color: #155724;
}

.section-status.inactive {
  background: #f8d7da;
  color: #721c24;
}

.section-status.pending {
  background: #fff3cd;
  color: #856404;
}

/* Section loading states */
.section.loading {
  opacity: 0.7;
  pointer-events: none;
}

.section.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Section responsive behavior */
@media (max-width: 768px) {
  .section {
    margin: 15px 0;
    padding: 12px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-title {
    font-size: 16px;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-row label {
    min-width: auto;
  }
}
