/**
 * @file
 * Base styles for NBVT Calculator.
 */

.nbvt-calculator-form {
  max-width: none;
  width: 100%;
  margin: 0;
}

/* Specific fix for bewegende delen form */
#nbvt-calculator-bewegende-delen-form {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
}

/* Ensure all form containers within bewegende delen are full width */
#nbvt-calculator-bewegende-delen-form .form-wrapper,
#nbvt-calculator-bewegende-delen-form fieldset,
#nbvt-calculator-bewegende-delen-form .groep1,
#nbvt-calculator-bewegende-delen-form .groep2 {
  max-width: none !important;
  width: 100% !important;
}

/* Container styling for groep1 and groep2 */
.groep1-container,
.groep2-container {
  max-width: none !important;
  width: 100% !important;
  margin-bottom: 20px;
}

/* Fieldset content within containers */
.groep1 .fieldset-content,
.groep2 .fieldset-content {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 15px;
  margin: 0;
  background: #fff;
}

/* Actions within groep2 containers */
.groep2 .actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #dee2e6;
}

.calculator-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.calculator-tabs .tab-link {
  padding: 10px 20px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-bottom: none;
  text-decoration: none;
  color: #333;
  margin-right: 5px;
}

.calculator-tabs .tab-link:hover {
  background: #e9e9e9;
}

.calculator-tabs .tab-link.active {
  background: #fff;
  font-weight: bold;
}

.kozijnen-results,
.bewegende-delen-results {
  margin-top: 20px;
}

.results-table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.results-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

.results-table-wrapper th,
.results-table-wrapper td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.results-table-wrapper th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.results-table-wrapper tr.valid {
  background-color: #d4edda;
}

.results-table-wrapper tr.invalid {
  background-color: #f8d7da;
}

.status-valid {
  color: #155724;
  font-weight: bold;
}

.status-invalid {
  color: #721c24;
  font-weight: bold;
}

.results-summary {
  background: #f8f9fa;
  padding: 15px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin-bottom: 20px;
}

.results-summary h4,
.results-summary h5 {
  margin-top: 0;
}

.valid-summary {
  margin-bottom: 15px;
}

.invalid-summary {
  margin-bottom: 15px;
}

.text-success {
  color: #28a745;
}

.text-danger {
  color: #dc3545;
}

.results-warning {
  margin-bottom: 20px;
}

.alert {
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeaa7;
}

.results-actions {
  text-align: center;
  margin-top: 20px;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 5px;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}

.btn-primary {
  color: #fff;
  background-color: var(--color-primary, #7b2952);
  border-color: var(--color-primary, #7b2952);
}

.btn-secondary {
  color: #6c757d;
  background-color: transparent;
  border-color: #6c757d;
}

.btn:hover {
  opacity: 0.8;
}

.status-ok {
  color: #28a745;
  font-weight: bold;
}

.status-error {
  color: #dc3545;
  font-weight: bold;
}

.error-messages {
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.no-results {
  text-align: center;
  padding: 20px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

/* Interactive windstuwdruk/vakgrootte table styles */
.windstuwdruk-vakgrootte-table,
#thrust_box_span_table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
}

.windstuwdruk-vakgrootte-table th,
.windstuwdruk-vakgrootte-table td,
#thrust_box_span_table th,
#thrust_box_span_table td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: center;
  position: relative;
}

.windstuwdruk-vakgrootte-table th,
#thrust_box_span_table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.windstuwdruk-vakgrootte-table .span-cell,
.windstuwdruk-vakgrootte-table .span_cell,
#thrust_box_span_table .span-cell,
#thrust_box_span_table .span_cell {
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.windstuwdruk-vakgrootte-table .span-cell:hover,
.windstuwdruk-vakgrootte-table .span_cell:hover,
#thrust_box_span_table .span-cell:hover,
#thrust_box_span_table .span_cell:hover {
  background-color: #f5f1f4;
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Active thrust styling will be moved after base styling to prevent override */

.windstuwdruk-vakgrootte-table tr.active-box-size,
#thrust_box_span_table tr.active-box-size {
  background-color: #e8f5e8;
}

.windstuwdruk-vakgrootte-table tr.active-box-size td:first-child,
#thrust_box_span_table tr.active-box-size td:first-child {
  background-color: var(--color-primary, #7b2952) !important;
  color: white !important;
  font-weight: bold !important;
}

/* Active column header styling - only the TH above the active cell */
.windstuwdruk-vakgrootte-table th.active-column,
#thrust_box_span_table th.active-column {
  background-color: var(--color-primary, #7b2952) !important;
  color: white !important;
  font-weight: bold !important;
}

.windstuwdruk-vakgrootte-table tr.hover-horizontal,
#thrust_box_span_table tr.hover-horizontal {
  background-color: #f0f8ff;
}

.windstuwdruk-vakgrootte-table .hover-vertical,
#thrust_box_span_table .hover-vertical {
  background-color: #f0f8ff;
}

/* Active thrust hover styling will be moved after base styling to prevent override */

/* Alternatives container */
.alternatives-container {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.alternatives-container h3 {
  margin-top: 0;
  color: #333;
}

/* Alternatives title styling */
.alternatives-title {
  font-weight: bold;
  font-size: 16px;
  color: #333;
  margin-bottom: 10px;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-left: 4px solid var(--color-primary, #7b2952);
  border-radius: 4px;
}

.alternatives-container .ajax-progress {
  text-align: center;
  padding: 20px;
}

.alternatives-container .throbber {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: url('data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wjRLEuQRNnGt7QpVdNhHJBkaK0VGJQCdHjyOhZQTrOKNdx8JAOhwqFzASn/cFAAAh+QQJCgAAACwAAAAAEAAQAAADNQi63P4QyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNQi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wjRLEuQRNnGt7QpVdNhHJBkaK0VGJQCdHjyOhZQTrOKNdx8JAOhwqFzASn/cFAAA7') no-repeat;
  animation: spin 1s linear infinite;
}

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

/* Table responsive behavior */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tussenstijl selection styles */
.tussenstijl-card {
  display: inline-block;
  margin: 10px;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  position: relative;
  min-width: 120px;
  text-align: center;
}

.tussenstijl-card:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0,123,255,0.25);
  transform: translateY(-2px);
}

.tussenstijl-card.selected {
  border-color: #007bff;
  background: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.tussenstijl-card.selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #007bff;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid white;
}

.tussenstijl-image-container {
  position: relative;
  display: inline-block;
  width: 100px;
  height: 100px;
  margin-bottom: 10px;
}

.tussenstijl-image {
  max-width: 100px;
  max-height: 100px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: opacity 0.3s ease;
}

.tussenstijl-image.holder {
  display: block;
  opacity: 1;
}

.tussenstijl-image.active {
  display: none;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
}

/* Enhanced radio button styling for tussenstijl cards */
.tussenstijl-radios input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tussenstijl-radios input[type="radio"]:checked + .tussenstijl-image-container {
  border: 2px solid #007bff;
  border-radius: 4px;
  padding: 2px;
}

.tussenstijl-radios input[type="radio"]:checked ~ .tussenstijl-image-container .tussenstijl-image.holder {
  display: none;
  opacity: 0;
}

.tussenstijl-radios input[type="radio"]:checked ~ .tussenstijl-image-container .tussenstijl-image.active {
  display: block;
  opacity: 1;
}

/* Alternative approach for when radio is inside the card */
.tussenstijl-card input[type="radio"]:checked ~ .tussenstijl-image-container .tussenstijl-image.holder {
  display: none;
  opacity: 0;
}

.tussenstijl-card input[type="radio"]:checked ~ .tussenstijl-image-container .tussenstijl-image.active {
  display: block;
  opacity: 1;
}

/* Fallback for direct image switching */
.tussenstijl-card:hover .tussenstijl-image.holder {
  opacity: 0.7;
}

.tussenstijl-card.selected .tussenstijl-image.holder {
  display: none;
}

.tussenstijl-card.selected .tussenstijl-image.active {
  display: block;
  opacity: 1;
}

/* Alternatives table styles */
.alternatives-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.alternatives-table th,
.alternatives-table td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.alternatives-table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.alternatives-table tr.current-selection {
  background-color: #d4edda;
  font-weight: bold;
}

.alternatives-table tr.alternative-option:hover {
  background-color: #f8f9fa;
}

.alternatives-table .status-current {
  color: #155724;
  font-weight: bold;
}

.alternatives-table .status-alternative {
  color: #6c757d;
}

/* Interactive table container */
.interactive-table-container {
  margin: 20px 0;
  padding: 15px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.interactive-table-container h3 {
  margin-top: 0;
  color: #333;
  border-bottom: 2px solid var(--color-primary, #7b2952);
  padding-bottom: 10px;
}

.interactive-table-container p {
  color: #6c757d;
  font-style: italic;
  margin-bottom: 15px;
}

/* Vakgrootte label styling */
.vakgrootte-label {
  font-weight: bold;
  background-color: #f8f9fa !important;
}

/* No data cells */
.span-cell.no-data {
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

.span-cell.no-data:hover {
  background-color: #f8f9fa !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Form wrapper improvements */
.nbvt-calculator-form {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Fieldset improvements */
.nbvt-calculator-form fieldset {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
}

.nbvt-calculator-form fieldset legend {
  font-weight: bold;
  color: #333;
  padding: 0 10px;
}

/* Button improvements */
.nbvt-calculator-form .form-actions {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid #dee2e6;
  margin-top: 20px;
}

/* Visually hidden class for AJAX button */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Enhanced loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.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;
  z-index: 1000;
}

/* Prevent dropdown expansion during loading states */
.loading select,
.form-wrapper.loading select,
.nbvt-calculator-form.loading select,
.ajax-progress select,
form.loading select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  min-width: 0 !important;
}

/* Ensure form containers maintain boundaries during AJAX */
.nbvt-calculator-form.loading,
.nbvt-calculator-form.ajax-progress {
  overflow: hidden;
}

.nbvt-calculator-form .form-item,
.nbvt-calculator-form .form-wrapper {
  max-width: 100%;
  box-sizing: border-box;
}

.nbvt-calculator-form .groep2 {
  max-width: 100%;
  box-sizing: border-box;
}

/* Specific fix for vakgrootte and other dropdowns */
select[name="vakgrootte"],
select[name="doorsnedeafmeting"],
select[name="sterkteklasse"],
select[name="glasgewicht"],
select[name="gebouwhoogte"],
select[name="windgebied"],
select[name="omgevingsgebied"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  min-width: 0;
}

/* Additional constraint for form elements during AJAX operations */
.nbvt-calculator-form.ajax-progress select,
.nbvt-calculator-form .ajax-progress select,
.form-item.ajax-progress select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Ensure groep2 containers don't allow overflow during loading only */
.groep2.loading,
.groep2-container.loading,
.step-2-layout .groep2.loading,
.step-3-layout .groep2.loading,
.step-4-layout .groep2.loading,
.step-5-layout .groep2.loading,
.step-6-layout .groep2.loading {
  overflow: hidden;
}

.groep2,
.groep2-container,
.step-2-layout .groep2,
.step-3-layout .groep2,
.step-4-layout .groep2,
.step-5-layout .groep2,
.step-6-layout .groep2 {
  max-width: 100%;
  box-sizing: border-box;
}

/* Fix for AJAX throbber containers to not affect layout */
.ajax-progress {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.ajax-progress .throbber {
  max-width: 100%;
  box-sizing: border-box;
}

/* Processing state for table cells */
.span-cell.processing {
  position: relative;
  opacity: 0.7;
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.span-cell.processing::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 1px solid #212529;
  border-top: 1px solid transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Debug styles for development */
.debug-info {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 10px;
  margin: 10px 0;
  font-family: monospace;
  font-size: 12px;
  border-radius: 4px;
}

.debug-info h4 {
  margin: 0 0 5px 0;
  color: #495057;
}

.debug-info pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Enhanced table cell hover states */
.windstuwdruk-vakgrootte-table .span-cell:not(.no-data):hover,
.windstuwdruk-vakgrootte-table .span_cell:not(.no-data):hover,
#thrust_box_span_table .span-cell:not(.no-data):hover,
#thrust_box_span_table .span_cell:not(.no-data):hover {
  background-color: #e3f2fd !important;
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border: 2px solid #2196f3;
  font-weight: bold;
}

/* Better visual feedback for clickable cells */
.windstuwdruk-vakgrootte-table .span-cell:not(.no-data),
.windstuwdruk-vakgrootte-table .span_cell:not(.no-data),
#thrust_box_span_table .span-cell:not(.no-data),
#thrust_box_span_table .span_cell:not(.no-data) {
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
  position: relative;
}

.windstuwdruk-vakgrootte-table .span-cell:not(.no-data):active,
.windstuwdruk-vakgrootte-table .span_cell:not(.no-data):active,
#thrust_box_span_table .span-cell:not(.no-data):active,
#thrust_box_span_table .span_cell:not(.no-data):active {
  transform: scale(0.98);
  background-color: #2196f3 !important;
  color: white !important;
}

/* Active thrust styling - moved here to prevent override by base styling */
.windstuwdruk-vakgrootte-table .span-cell.active-thrust,
.windstuwdruk-vakgrootte-table .span_cell.active-thrust,
#thrust_box_span_table .span-cell.active-thrust,
#thrust_box_span_table .span_cell.active-thrust {
  background-color: var(--color-primary, #7b2952) !important;
  color: white !important;
  font-weight: bold;
}

/* Active thrust hover styling - moved here to prevent override by base styling */
.windstuwdruk-vakgrootte-table .span-cell.active-thrust.hover-vertical,
.windstuwdruk-vakgrootte-table .span_cell.active-thrust.hover-vertical,
#thrust_box_span_table .span-cell.active-thrust.hover-vertical,
#thrust_box_span_table .span_cell.active-thrust.hover-vertical {
  background-color: var(--color-primary-dark, #5c1f3e) !important;
  color: white !important;
}

/* Enhanced alternatives loading state with better cleanup */
.alternatives-container .ajax-progress {
  text-align: center;
  padding: 30px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  margin: 15px 0;
  transition: opacity 0.3s ease;
}

/* Progress bar auto-cleanup after timeout */
.ajax-progress.timeout {
  opacity: 0.5;
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  from { opacity: 0.5; }
  to { opacity: 0; transform: scale(0.95); }
}

/* Enhanced throbber cleanup */
.throbber.cleanup {
  animation: fadeOut 0.3s ease-out forwards;
}

.alternatives-container .ajax-progress .throbber {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 12px;
  background: url('data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wjRLEuQRNnGt7QpVdNhHJBkaK0VGJQCdHjyOhZQTrOKNdx8JAOhwqFzASn/cFAAAh+QQJCgAAACwAAAAAEAAQAAADNQi63P4QyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNQi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wjRLEuQRNnGt7QpVdNhHJBkaK0VGJQCdHjyOhZQTrOKNdx8JAOhwqFzASn/cFAAA7') no-repeat;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}

.alternatives-container .ajax-progress span {
  font-size: 16px;
  color: #495057;
  font-weight: 500;
}

/* Form step progression */
.nbvt-calculator-form fieldset {
  transition: all 0.3s ease;
  position: relative;
}

.nbvt-calculator-form fieldset.step-complete {
  border-color: #28a745;
}

.nbvt-calculator-form fieldset.step-complete::before {
  content: '✓';
  position: absolute;
  top: -8px;
  right: 15px;
  background: #28a745;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Form progress bar */
.form-progress {
  margin-bottom: 20px;
  background: #f8f9fa;
  border-radius: 4px;
  overflow: hidden;
  height: 8px;
}

.form-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #28a745);
  transition: width 0.3s ease;
  width: 0%;
}

/* Form wrapper container fix - ensures proper height and visibility */
.form-progress.js-form-wrapper.form-wrapper {
  min-height: 80px;
  height: auto;
  display: block !important;
  visibility: visible !important;
  overflow: visible;
  padding: 15px 0;
  margin-bottom: 20px;
  background: transparent;
  border-radius: 0;
}

/* Hide form progress on results pages for both calculators */
.form-progress.js-form-wrapper.form-wrapper[style*="display: none"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* Fallback styling for individual Drupal form wrapper classes */
.js-form-wrapper,
.form-wrapper {
  display: block;
  visibility: visible;
  min-height: auto;
}

/* Ensure form progress container has proper layout */
.form-progress.js-form-wrapper.form-wrapper .form-progress-steps {
  margin: 10px 0 20px 0;
}

/* Override any conflicting styles that might hide the wrapper */
.form-progress.js-form-wrapper.form-wrapper:not(.visually-hidden) {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
}

/* Form progress steps */
.form-progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 20px 0;
  position: relative;
}

.form-progress-steps::before {
  content: '';
  position: absolute;
  top: 16px; /* Center with the step circles (32px height / 2) */
  left: 16px; /* Start from center of first circle */
  right: 16px; /* End at center of last circle */
  height: 2px;
  background: #dee2e6;
  z-index: 1;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  background: #fff;
  padding: 0 10px;
  min-width: 80px;
  text-align: center;
}

.progress-step .step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dee2e6;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #dee2e6;
  position: relative;
}

.progress-step .step-title {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.3s ease;
}

/* Completed step styling */
.progress-step.completed .step-number {
  background: var(--color-primary, #7b2952);
  color: #fff;
  box-shadow: 0 0 0 2px var(--color-primary, #7b2952);
}

.progress-step.completed .step-number::before {
  content: "✓";
  font-size: 16px;
  font-weight: bold;
}

.progress-step.completed .step-title {
  color: var(--color-primary, #7b2952);
  font-weight: 600;
}

/* Current step styling */
.progress-step.current .step-number {
  background: var(--color-primary, #7b2952);
  color: #fff;
  box-shadow: 0 0 0 2px var(--color-primary, #7b2952);
  animation: pulse 2s infinite;
}

.progress-step.current .step-title {
  color: var(--color-primary, #7b2952);
  font-weight: 600;
}

/* Progress line for completed steps - improved centering */
.progress-step.completed::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 55px);
  width: calc(100% + 70px);
  height: 2px;
  background: var(--color-primary, #7b2952);
  z-index: 1;
  transform: translateY(-50%);
}

/* Don't show line after the last completed step */
.progress-step.completed:last-child::after {
  display: none;
}

/* Pulse animation for current step */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 2px var(--color-primary, #7b2952), 0 0 0 4px rgba(123, 41, 82, 0.3);
  }
  50% {
    box-shadow: 0 0 0 2px var(--color-primary, #7b2952), 0 0 0 8px rgba(123, 41, 82, 0.1);
  }
  100% {
    box-shadow: 0 0 0 2px var(--color-primary, #7b2952), 0 0 0 4px rgba(123, 41, 82, 0.3);
  }
}

/* Responsive progress steps */
@media (max-width: 768px) {
  .form-progress-steps {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .form-progress-steps::before {
    display: none;
  }
  
  .progress-step {
    min-width: 60px;
    margin-bottom: 10px;
  }
  
  .progress-step .step-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
    margin-bottom: 5px;
  }
  
  .progress-step .step-title {
    font-size: 11px;
  }
  
  .progress-step.completed + .progress-step::before {
    display: none;
  }
}

/* Enhanced visibility for completed steps */
.progress-step.completed {
  transform: scale(1.05);
}

.progress-step.completed .step-number {
  box-shadow: 0 0 0 2px var(--color-primary, #7b2952), 
              0 2px 8px rgba(123, 41, 82, 0.3);
}

/* Better contrast for step titles */
.progress-step .step-title {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.progress-step.completed .step-title {
  background: rgba(123, 41, 82, 0.1);
  border-color: var(--color-primary, #7b2952);
}

.progress-step.current .step-title {
  background: rgba(123, 41, 82, 0.1);
  border-color: var(--color-primary, #7b2952);
}

/* Enhanced tussenstijl selection */
.tussenstijl-card {
  display: inline-block;
  margin: 10px;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  position: relative;
  min-width: 120px;
  text-align: center;
}

.tussenstijl-card:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0,123,255,0.25);
  transform: translateY(-2px);
}

.tussenstijl-card.selected {
  border-color: #007bff;
  background: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.tussenstijl-card.selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #007bff;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid white;
}

/* Enhanced table row selection */
.results-table-wrapper table tbody tr.selected {
  background-color: #e3f2fd !important;
  border-left: 4px solid #007bff;
}

.results-table-wrapper table tbody tr.table-row-hover {
  background-color: #f8f9fa;
  cursor: pointer;
}

/* Enhanced alert styles */
.alert {
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  position: relative;
  margin-bottom: 15px;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert .close {
  position: absolute;
  top: 8px;
  right: 15px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
}

.alert .close:hover {
  opacity: 1;
}

/* Mobile table enhancements */
@media (max-width: 768px) {
  .mobile-table {
    border: 0;
  }
  
  .mobile-table thead {
    display: none;
  }
  
  .mobile-table tbody tr {
    display: block;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 4px;
    padding: 10px;
  }
  
  .mobile-table tbody td {
    display: block;
    text-align: right;
    border: none;
    padding: 5px 0;
    position: relative;
    padding-left: 50%;
  }
  
  .mobile-table tbody td::before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 0;
    width: 45%;
    text-align: left;
    font-weight: bold;
    color: #333;
  }
}

/* Enhanced button states */
.btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Accessibility improvements */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus improvements */
.calculator-tabs .tab-link:focus,
.tussenstijl-card:focus-within,
.span-cell:focus,
.btn:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Red box styling for bewegende delen > 1800mm */
#thrust_box_span_table tbody td.span_cell.redbox,
#thrust_box_span_table tbody td.span-cell.redbox,
.windstuwdruk-vakgrootte-table .span-cell.redbox,
.windstuwdruk-vakgrootte-table .span_cell.redbox {
  background-color: #EABDAF !important;
  color: #721c24;
  font-weight: bold;
}

#thrust_box_span_table tbody td.span_cell.hover_horizontal.redbox,
#thrust_box_span_table tbody td.span_cell.hover_vertical.redbox,
#thrust_box_span_table tbody td.span-cell.hover_horizontal.redbox,
#thrust_box_span_table tbody td.span-cell.hover_vertical.redbox,
.windstuwdruk-vakgrootte-table .span-cell.redbox:hover,
.windstuwdruk-vakgrootte-table .span_cell.redbox:hover,
.windstuwdruk-vakgrootte-table .span-cell.redbox.hover-vertical,
.windstuwdruk-vakgrootte-table .span_cell.redbox.hover-vertical,
.windstuwdruk-vakgrootte-table .span-cell.redbox.hover-horizontal,
.windstuwdruk-vakgrootte-table .span_cell.redbox.hover-horizontal {
  background-color: #EDCEC5 !important;
  color: #721c24;
}

.redbox-information {
  background-color: #EABDAF;
  font-weight: normal;
  margin-right: -6px;
  padding: 20px 15px 20px 20px;
  line-height: 23px;
  color: #721c24;
  border-radius: 4px;
  margin-bottom: 10px;
}

.redbox-information-table {
  table-layout: auto;
  width: 100%;
  margin-bottom: 15px;
}

.redbox-information-table thead th {
  background-color: transparent !important;
  padding: 9px 6px;
  border: none;
}

.redbox-information-table tbody {
  display: none;
}

/* Enhanced redbox styling for better visibility */
.windstuwdruk-vakgrootte-table .span-cell.redbox,
.windstuwdruk-vakgrootte-table .span_cell.redbox,
#thrust_box_span_table .span-cell.redbox,
#thrust_box_span_table .span_cell.redbox {
  position: relative;
  border: 2px solid #d4a574;
}


/* Print optimizations */
@media print {
  .calculator-tabs,
  .results-actions,
  .ajax-progress,
  .alert,
  .visually-hidden,
  .no-print {
    display: none !important;
  }
  
  .nbvt-calculator-form {
    box-shadow: none;
    border: none;
  }
  
  .results-table-wrapper table {
    page-break-inside: avoid;
  }
  
  .windstuwdruk-vakgrootte-table {
    font-size: 10px;
  }
  
  .windstuwdruk-vakgrootte-table th,
  .windstuwdruk-vakgrootte-table td {
    padding: 4px;
  }
  
  /* Print redbox styling */
  .windstuwdruk-vakgrootte-table .span-cell.redbox,
  .windstuwdruk-vakgrootte-table .span_cell.redbox,
  #thrust_box_span_table .span-cell.redbox,
  #thrust_box_span_table .span_cell.redbox {
    background-color: #EABDAF !important;
    border: 2px solid #721c24 !important;
  }
  
  .redbox-information {
    background-color: #EABDAF !important;
    border: 1px solid #721c24 !important;
  }
}

@media (max-width: 768px) {
  .calculator-tabs {
    flex-direction: column;
  }
  
  .calculator-tabs .tab-link {
    margin-right: 0;
    margin-bottom: 5px;
  }
  
  .nbvt-calculator-form {
    margin: 0 15px;
  }
  
  .results-table-wrapper {
    font-size: 14px;
  }
  
  .results-table-wrapper th,
  .results-table-wrapper td {
    padding: 6px 8px;
  }
  
  .windstuwdruk-vakgrootte-table,
  #thrust_box_span_table {
    font-size: 12px;
  }
  
  .windstuwdruk-vakgrootte-table th,
  .windstuwdruk-vakgrootte-table td,
  #thrust_box_span_table th,
  #thrust_box_span_table td {
    padding: 4px 6px;
  }
  
  .tussenstijl-card {
    margin: 5px;
    padding: 5px;
  }
  
.tussenstijl-image {
  max-width: 60px;
  max-height: 60px;
  }
}

/* Moving parts image selection */
.moving-parts-row .active {
  display: none;
}

.moving-parts-row label.selected .holder {
  display: none;
}

.moving-parts-row label.selected .active {
  display: block;
}

/* Step 1 Layout */
.step-1-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-1-layout .groep1 {
  flex: 0 0 70%;
  max-width: 70%;
}

.step-1-layout .groep2 {
  flex: 0 0 30%;
  max-width: 30%;
}

/* Step 2 Layout */
.step-2-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-2-layout .groep1 {
  flex: 0 0 70%;
  max-width: 70%;
}

.step-2-layout .groep2 {
  flex: 0 0 30%;
  max-width: 30%;
}

/* Step 3 Layout */
.step-3-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-3-layout .groep1 {
  flex: 0 0 70%;
  max-width: 70%;
}

.step-3-layout .groep2 {
  flex: 0 0 30%;
  max-width: 30%;
}

/* Step 4 Layout */
.step-4-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-4-layout .groep1 {
  flex: 0 0 70%;
  max-width: 70%;
}

.step-4-layout .groep2 {
  flex: 0 0 30%;
  max-width: 30%;
}

/* Step 5 Layout */
.step-5-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-5-layout .groep1 {
  flex: 0 0 70%;
  max-width: 70%;
}

.step-5-layout .groep2 {
  flex: 0 0 30%;
  max-width: 30%;
}

/* Step 6 Layout */
.step-6-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-6-layout .groep1 {
  flex: 0 0 70%;
  max-width: 70%;
}

.step-6-layout .groep2 {
  flex: 0 0 30%;
  max-width: 30%;
}

/* Vakbreedte explanation styling */
.vakbreedte-explanation {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.vakbreedte-explanation p {
  margin: 0 0 15px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #495057;
  text-align: justify;
}

.vakbreedte-image-container {
  text-align: center;
  margin: 15px 0 0 0;
  padding: 15px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.vakbreedte-calculation-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.vakbreedte-calculation-image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Enhanced vakbreedte explanation for better readability */
.vakbreedte-explanation::before {
  content: "ℹ️";
  font-size: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

.vakbreedte-explanation h4 {
  margin: 0 0 10px 0;
  color: #007bff;
  font-size: 16px;
  font-weight: 600;
  display: inline-block;
  vertical-align: middle;
}

/* Responsive vakbreedte styling */
@media (max-width: 768px) {
  .vakbreedte-explanation {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .vakbreedte-explanation p {
    font-size: 13px;
    text-align: left;
  }
  
  .vakbreedte-image-container {
    padding: 10px;
    margin: 10px 0 0 0;
  }
  
  .vakbreedte-calculation-image {
    max-width: 100%;
    height: auto;
  }
}

/* Print styling for vakbreedte explanation */
@media print {
  .vakbreedte-explanation {
    background: #fff !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  
  .vakbreedte-calculation-image {
    max-width: 100% !important;
    box-shadow: none !important;
  }
}


/* Wind fields horizontal layout with CSS Grid for precise alignment */
.wind-fields-horizontal {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 20px !important;
  margin-top: 20px !important;
  align-items: stretch !important;
  min-height: 350px !important;
}

.wind-field-third {
  display: grid !important;
  grid-template-rows: 1fr !important;
  min-height: 350px !important;
}

.wind-field-third fieldset {
  margin-bottom: 0 !important;
  padding: 15px !important;
  display: grid !important;
  grid-template-rows: 1fr auto !important;
  min-height: 350px !important;
  align-content: space-between !important;
}

/* Content area (top section) */
.wind-field-third fieldset .content-area {
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

/* Select area (bottom section) */
.wind-field-third fieldset .select-area {
  grid-row: 2 !important;
  margin-top: auto !important;
}

/* Target the legend specifically */
.wind-field-third fieldset legend {
  position: relative !important;
  margin-bottom: 15px !important;
}

/* Target the image containers */
.wind-field-third .gebouwhoogte-image-container,
.wind-field-third .windgebied-image-container {
  margin-bottom: 15px !important;
  flex-shrink: 0 !important;
}

/* Force select fields to bottom using CSS positioning */
.wind-field-third .form-item {
  position: relative !important;
}

.wind-field-third fieldset > .form-item:last-child {
  position: absolute !important;
  bottom: 15px !important;
  left: 15px !important;
  right: 15px !important;
  margin: 0 !important;
  margin-bottom: 1rem !important;
}

/* Ensure select fields maintain full width */
.wind-field-third select {
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Target specific select fields */
.wind-field-third select[name="gebouwhoogte"],
.wind-field-third select[name="windgebied"],
.wind-field-third select[name="omgevingsgebied"] {
  width: 100% !important;
  margin: 0 !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}

/* Labels positioning */
.wind-field-third .form-item:last-child label {
  display: block !important;
  margin-bottom: 5px !important;
  font-weight: bold !important;
}

/* Ensure content doesn't overlap with positioned select */
.wind-field-third fieldset {
  padding-bottom: 80px !important;
}

/* Fine-tuning for perfect alignment across all form items */
.nbvt-calculator-form .form-item {
  margin-bottom: -0.1rem;
}

/* Fix field spacing for bewegende delen form - step 1 (step 2 in code) */
.step-2-layout .groep2 .form-item {
  margin-bottom: 1.5rem;
}

.step-2-layout .groep2 .form-item:last-child {
  margin-bottom: 1rem;
}

/* Ensure proper spacing for cascade selection fields */
.step-2-layout .groep2 .fieldset-content .form-item {
  margin-bottom: 1.5rem;
}

/* Specific spacing for big class dropdowns in bewegende delen */
.nbvt-calculator-form .form-item select.big {
  margin-bottom: 1rem;
}

/* Additional spacing for bewegende delen form fields with big class */
.step-2-layout .form-item:has(select.big) {
  margin-bottom: 1.5rem;
}

/* Fallback for browsers that don't support :has() */
.step-2-layout .form-item select[name="slis_or_deuvel"],
.step-2-layout .form-item select[name="window_type"],
.step-2-layout .form-item select[name="doorsnedeafmeting"] {
  margin-bottom: 1rem;
}

.step-2-layout .form-item:has(select[name="slis_or_deuvel"]),
.step-2-layout .form-item:has(select[name="window_type"]),
.step-2-layout .form-item:has(select[name="doorsnedeafmeting"]) {
  margin-bottom: 1.5rem;
}

/* Responsive behavior for wind fields */
@media (max-width: 768px) {
  .wind-fields-horizontal {
    flex-direction: column;
    gap: 15px;
  }
  
  .wind-field-third {
    max-width: 100%;
  }
}

/* Enhanced form field spacing for all bewegende delen steps */
.step-3-layout .groep2 .form-item,
.step-4-layout .groep2 .form-item,
.step-5-layout .groep2 .form-item {
  margin-bottom: 1.5rem;
}

.step-3-layout .groep2 .form-item:last-child,
.step-4-layout .groep2 .form-item:last-child,
.step-5-layout .groep2 .form-item:last-child {
  margin-bottom: 1rem;
}

/* Ensure proper spacing for sterkteklasse explanation text */
.step-3-layout .groep2 .sterkteklasse-explanation {
  margin-bottom: 1.5rem;
}

/* Ensure proper spacing for breedte explanation text */
.step-4-layout .groep1 .breedte-explanation {
  margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
  .step-1-layout,
  .step-2-layout,
  .step-3-layout,
  .step-4-layout,
  .step-5-layout,
  .step-6-layout {
    flex-direction: column;
  }

  .step-1-layout .groep1,
  .step-1-layout .groep2,
  .step-2-layout .groep1,
  .step-2-layout .groep2,
  .step-3-layout .groep1,
  .step-3-layout .groep2,
  .step-4-layout .groep1,
  .step-4-layout .groep2,
  .step-5-layout .groep1,
  .step-5-layout .groep2,
  .step-6-layout .groep1,
  .step-6-layout .groep2 {
    max-width: 100%;
    width: 100%;
  }
}

/* ===== INLINE EDITING STYLES ===== */

/* Edit icon styling */
.edit-icon {
  margin-left: 8px;
  cursor: pointer;
  color: #6c757d;
  font-size: 14px;
  opacity: 0.7;
  transition: all 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
  display: inline-block;
  line-height: 1;
}

.edit-icon:hover {
  opacity: 1;
  color: var(--color-primary, #7b2952);
  background-color: rgba(123, 41, 82, 0.1);
  transform: scale(1.1);
}

/* Editable cell styling */
.editable-cell {
  position: relative;
  transition: background-color 0.2s ease;
}

.editable-cell:hover {
  background-color: #f8f9fa;
}

.editable-cell.editing {
  background-color: #fff3cd;
  border: 2px solid #ffc107;
  padding: 4px;
}

/* Inline editing wrapper */
.inline-edit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  max-width: 300px;
}

.inline-edit-wrapper input,
.inline-edit-wrapper select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inline-edit-wrapper input:focus,
.inline-edit-wrapper select:focus {
  outline: none;
  border-color: var(--color-primary, #7b2952);
  box-shadow: 0 0 0 2px rgba(123, 41, 82, 0.25);
}

/* Inline editing action buttons */
.inline-edit-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 4px;
}

.inline-edit-save,
.inline-edit-cancel {
  padding: 4px 8px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.inline-edit-save {
  background-color: #28a745;
  color: white;
}

.inline-edit-save:hover {
  background-color: #218838;
  transform: scale(1.05);
}

.inline-edit-save:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
}

.inline-edit-cancel {
  background-color: #6c757d;
  color: white;
}

.inline-edit-cancel:hover {
  background-color: #5a6268;
  transform: scale(1.05);
}

/* Loading state for inline editing */
.inline-edit-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #6c757d;
  font-style: italic;
  gap: 8px;
}

.inline-edit-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error message styling for inline editing */
#inline-edit-error {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  padding: 12px 16px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 14px;
  line-height: 1.4;
}

/* Selection summary table enhancements for inline editing */
.selection-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.selection-summary-table th,
.selection-summary-table td {
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  text-align: center;
  vertical-align: middle;
}

.selection-summary-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  color: #495057;
}

.selection-summary-table td {
  background-color: #fff;
}

/* Enhanced hover states for editable cells in selection summary */
.selection-summary-table .editable-cell:hover {
  background-color: #e3f2fd;
  cursor: pointer;
}

.selection-summary-table .editable-cell.editing {
  background-color: #fff3cd;
  padding: 8px;
}

/* Responsive behavior for inline editing */
@media (max-width: 768px) {
  .inline-edit-wrapper {
    min-width: 150px;
    max-width: 250px;
  }
  
  .inline-edit-wrapper input,
  .inline-edit-wrapper select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 8px;
  }
  
  .edit-icon {
    font-size: 16px;
    padding: 4px 6px;
  }
  
  #inline-edit-error {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }
  
  .selection-summary-table th,
  .selection-summary-table td {
    padding: 8px 6px;
    font-size: 14px;
  }
}

/* Print styles - hide inline editing elements */
@media print {
  .edit-icon,
  .inline-edit-wrapper,
  .inline-edit-actions,
  .inline-edit-loading,
  #inline-edit-error {
    display: none !important;
  }
  
  .editable-cell.editing {
    background-color: transparent !important;
    border: none !important;
    padding: 8px 12px !important;
  }
}

/* Focus management for accessibility */
.inline-edit-wrapper input:focus,
.inline-edit-wrapper select:focus {
  outline: 2px solid var(--color-primary, #7b2952);
  outline-offset: 2px;
}

.inline-edit-save:focus,
.inline-edit-cancel:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Animation for smooth transitions */
.editable-cell {
  transition: all 0.3s ease;
}

.inline-edit-wrapper {
  animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Enhanced visual feedback for different field types */
.inline-edit-wrapper select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='m2 0l2 3h-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px;
  padding-right: 28px;
  appearance: none;
}

.inline-edit-wrapper input[type="number"] {
  text-align: right;
}

/* Selection summary container styling */
.selection-summary-container {
  margin: 20px 0;
  padding: 15px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Better visual hierarchy for inline editing states */
.editable-cell.editing {
  position: relative;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Improved button styling for inline editing */
.inline-edit-save,
.inline-edit-cancel {
  border: 1px solid transparent;
  text-shadow: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.inline-edit-save {
  border-color: #28a745;
}

.inline-edit-cancel {
  border-color: #6c757d;
}

.inline-edit-save:hover,
.inline-edit-cancel:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Field-specific styling hints */
.inline-edit-wrapper[data-field="sterkteklasse"] select,
.inline-edit-wrapper[data-field="glasgewicht"] select {
  font-weight: 500;
}

.inline-edit-wrapper[data-field="kozijnmaat"] input,
.inline-edit-wrapper[data-field="afmeting"] input {
  font-family: monospace;
}

/* Saving state for inline editing - shows during server processing */
.editable-cell.saving {
  position: relative;
  opacity: 0.7;
  background-color: #fff3cd !important;
  border: 2px solid #ffc107 !important;
  pointer-events: none;
  transition: all 0.2s ease;
}

.editable-cell.saving::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--color-primary, #7b2952);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 100;
}

.editable-cell.saving .inline-edit-wrapper {
  opacity: 0.3;
  pointer-events: none;
}

.editable-cell.saving select,
.editable-cell.saving input {
  opacity: 0.5;
}

/* Success state animation */
.editable-cell.saved {
  animation: successFlash 0.6s ease-out;
}

@keyframes successFlash {
  0% { background-color: #d4edda; }
  50% { background-color: #c3e6cb; }
  100% { background-color: transparent; }
}

/* Maximum span result update styling */
span.result {
  font-weight: bold;
  color: var(--color-primary, #7b2952);
  transition: all 0.3s ease;
  padding: 2px 4px;
  border-radius: 3px;
}

span.result.updated {
  background-color: #d4edda;
  color: #155724;
  transform: scale(1.05);
  animation: resultUpdate 1s ease-out;
}

@keyframes resultUpdate {
  0% {
    background-color: #28a745;
    color: white;
    transform: scale(1.1);
  }
  50% {
    background-color: #d4edda;
    color: #155724;
    transform: scale(1.05);
  }
  100% {
    background-color: transparent;
    color: var(--color-primary, #7b2952);
    transform: scale(1);
  }
}

/* ===== TYPE SELECTION MODAL STYLES ===== */

/* Edit type icon styling */
.edit-type-icon {
  margin-left: 8px;
  cursor: pointer;
  color: #6c757d;
  font-size: 16px;
  opacity: 0.7;
  transition: all 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

.edit-type-icon:hover {
  opacity: 1;
  color: var(--color-primary, #7b2952);
  background-color: rgba(123, 41, 82, 0.1);
  transform: scale(1.2);
}

.edit-type-icon.loading {
  opacity: 0.6;
  animation: pulse 1.5s infinite;
  cursor: wait;
}

/* Modal overlay */
.type-selection-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal content */
.type-selection-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  max-height: 85vh;
  width: 900px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Modal header */
.type-selection-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f9fa;
  position: relative;
}

.type-selection-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

/* Close button */
.type-selection-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.type-selection-modal-close:hover {
  background-color: #e9ecef;
  color: #333;
  transform: rotate(90deg);
}

/* Modal body */
.type-selection-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(85vh - 80px);
}

/* Type selection cards container */
.type-selection-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 10px;
}

/* Individual type card */
.type-selection-card {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.type-selection-card:hover {
  border-color: var(--color-primary, #7b2952);
  box-shadow: 0 6px 20px rgba(123, 41, 82, 0.2);
  transform: translateY(-4px);
}

.type-selection-card.selected,
.type-selection-card.dimmed {
  transition: all 0.2s ease;
}

.type-selection-card.selected {
  background-color: #d4edda;
  border-color: #28a745;
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
}

.type-selection-card.dimmed {
  opacity: 0.4;
  transform: scale(0.95);
  filter: grayscale(50%);
}

/* Current type indicator */
.type-selection-card.current-type {
  border-color: var(--color-primary, #7b2952);
  background-color: rgba(123, 41, 82, 0.05);
  box-shadow: 0 4px 12px rgba(123, 41, 82, 0.15);
}

.type-selection-card.current-type::after {
  content: '✓ Huidige selectie';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-primary, #7b2952);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Type card image */
.type-selection-card .tussenstijl-image-container {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.type-selection-card .tussenstijl-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  transition: all 0.3s ease;
}

.type-selection-card:hover .tussenstijl-image {
  transform: scale(1.1);
}

.type-selection-card.selected .tussenstijl-image {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Type card title */
.type-selection-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-top: 8px;
  line-height: 1.4;
}

.type-selection-card:hover .type-selection-card-title {
  color: var(--color-primary, #7b2952);
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Type change message */
.type-change-message {
  background-color: #d4edda;
  color: #155724;
  padding: 12px 16px;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  margin: 15px 0;
  font-size: 14px;
  animation: fadeInSlide 0.4s ease-out;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Selection summary placeholder */
.selection-summary-placeholder {
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  padding: 30px;
  text-align: center;
  border-radius: 8px;
  margin: 20px 0;
}

.selection-summary-placeholder p {
  color: #6c757d;
  font-size: 16px;
  margin: 0;
  font-style: italic;
}

/* Responsive modal for tablets */
@media (max-width: 992px) {
  .type-selection-modal-content {
    width: 85%;
    max-width: 700px;
  }

  .type-selection-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .type-selection-card .tussenstijl-image-container {
    width: 100px;
    height: 100px;
  }
}

/* Responsive modal for mobile */
@media (max-width: 768px) {
  .type-selection-modal-content {
    width: 95%;
    max-width: none;
    max-height: 90vh;
    border-radius: 8px;
  }

  .type-selection-modal-header {
    padding: 15px 20px;
  }

  .type-selection-modal-header h3 {
    font-size: 18px;
  }

  .type-selection-modal-body {
    padding: 15px;
    max-height: calc(90vh - 70px);
  }

  .type-selection-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 5px;
  }

  .type-selection-card {
    padding: 12px;
  }

  .type-selection-card .tussenstijl-image-container {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
  }

  .type-selection-card-title {
    font-size: 12px;
  }

  .type-selection-card.current-type::after {
    font-size: 10px;
    padding: 3px 8px;
  }

  .edit-type-icon {
    font-size: 18px;
    padding: 4px 6px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .type-selection-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .type-selection-card {
    padding: 10px;
  }

  .type-selection-card .tussenstijl-image-container {
    width: 70px;
    height: 70px;
  }

  .type-selection-card-title {
    font-size: 11px;
  }
}

/* Print styles - hide modal */
@media print {
  .type-selection-modal-overlay,
  .type-change-message,
  .edit-type-icon {
    display: none !important;
  }
}

/* Accessibility improvements */
.type-selection-modal-close:focus {
  outline: 2px solid var(--color-primary, #7b2952);
  outline-offset: 2px;
}

.type-selection-card:focus {
  outline: 2px solid var(--color-primary, #7b2952);
  outline-offset: 2px;
  border-color: var(--color-primary, #7b2952);
}

/* Loading spinner for modal cards */
.type-selection-card.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--color-primary, #7b2952);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

.type-selection-card.loading {
  pointer-events: none;
  opacity: 0.6;
}

/* Smooth transitions for modal */
.type-selection-modal-overlay {
  transition: opacity 0.3s ease-out;
}

.type-selection-modal-content {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Enhanced hover effects */
.type-selection-card {
  overflow: hidden;
}

.type-selection-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.5s ease;
  opacity: 0;
}

.type-selection-card:hover::before {
  opacity: 1;
  transform: translateX(50%) translateY(50%) rotate(45deg);
}

/* Tussenstijl section labels and dividers */
.tussenstijl-section-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary, #7b2952);
  margin: 20px 0 15px 0;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-left: 4px solid var(--color-primary, #7b2952);
  border-radius: 4px;
}

.type-selection-modal-body .tussenstijl-section-label:first-child {
  margin-top: 0;
}

.tussenstijl-divider {
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-primary, #7b2952),
    transparent
  );
  margin: 30px 0;
  position: relative;
}

.tussenstijl-divider::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background-color: var(--color-primary, #7b2952);
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fff;
}

/* Responsive adjustments for section labels */
@media (max-width: 768px) {
  .tussenstijl-section-label {
    font-size: 16px;
    padding: 8px 12px;
    margin: 15px 0 12px 0;
  }

  .tussenstijl-divider {
    margin: 20px 0;
  }
}
