/* Form Section Styles */
.form-section {
  padding: 60px 0;
  background-color: transparent;
  position: relative;
  z-index: 1;
}

.form-container {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.form-container.visible {
  opacity: .95;
  transform: translateY(0);
}

.form-layout {
  display: flex;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar Styles */
.form-sidebar {
  width: 280px;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 20px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.question-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.question-item {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-family: "Britti Sans", "Inter", sans-serif;
  transition: all 0.2s ease;
  position: relative;
  cursor: default;
  margin: 0;
  border-left: 3px solid transparent;
}

.question-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.question-item.active, .question-item.completed {
  cursor: pointer;
}

.question-item.active {
  background-color: rgba(215, 255, 82, 0.1);
  color: #fff;
  font-weight: 500;
  border-left: 3px solid #D7FF52;
}

.question-item.completed {
  color: #fff;
}

.question-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin-right: 12px;
  font-size: 14px;
  font-family: "Britti Sans", "Inter", sans-serif;
  font-weight: 600;
}

.question-item.active .question-number {
  background-color: #D7FF52;
  color: #000;
}

.question-title {
  font-family: "Britti Sans", "Inter", sans-serif;
  letter-spacing: 0.01em;
  flex: 1;
}

.question-status {
  margin-left: auto;
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
  position: relative;
}

.question-item.completed .question-status {
  opacity: 1;
}

.question-item.completed .question-status:before {
  content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='7' stroke='%23D7FF52' stroke-width='2'/%3E%3Cpath d='M5 8L7 10L11 6' stroke='%23D7FF52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  position: absolute;
  top: 0;
  left: 0;
  color: #D7FF52;
  font-weight: bold;
}

.sidebar-divider {
  padding: 0;
  margin: 0;
  height: 2px;
  opacity: 0.8;
}

/* Content Area Styles */
.form-content {
  flex: 1;
  padding: 40px;
  min-height: 600px;
}

.question-section {
  display: none;
  flex-direction: column;
  padding: 40px;
  flex: 1;
}

.question-section.active {
  display: flex;
}

.question-heading {
  font-size: 24px;
  color: #fff;
  margin-bottom: 16px;
  font-weight: 600;
}

.question-description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
}

/* Option Buttons */
.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
  flex: 1;
}

.option-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-width: 140px;
  min-height: 120px;
  flex: 1;
  max-width: calc(33.333% - 16px);
  color: #fff;
}

.option-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.option-button.selected {
  background-color: rgba(215, 255, 82, 0.1);
  border-color: #D7FF52;
}

.option-image {
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
}

.option-label {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}

/* Address Input Specific Styles */
.address-input {
  flex-direction: column;
  position: relative;
}

/* Create a container for the input and suggestions */
.input-suggestions-container {
  position: relative;
  margin-bottom: 10px;
}

.form-input {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 12px 16px;
  color: #fff;
  font-size: 16px;
  width: 100%;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
}

/* Special handling for the address field */
#address-field {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.2);
  color: white;
  margin-bottom: 0;
  transition: border-color 0.3s ease;
  position: relative;
  z-index: 2;
}

#address-field:focus {
  border-color: #D7FF52;
  outline: none;
}

.map-preview {
  width: 100%;
  height: 300px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.placeholder-map {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

/* Navigation Buttons */
.form-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
}

.back-button, .next-button, .calculate-button, .reset-button {
  margin-top: 25px;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-button {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.back-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.next-button, .calculate-button {
  background-color: #D7FF52;
  color: #000;
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.next-button:hover, .calculate-button:hover {
  background-color: #e0ff7a;
  transform: translateY(-2px);
}

.next-button:disabled, .calculate-button:disabled {
  background-color: #5a5a5a;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.calculate-button {
  padding: 14px 28px;
}

.reset-button {
  background-color: rgba(91, 253, 66, 0.1);
  color: #fff;
  border: 1px solid rgba(91, 253, 66, 0.2);
}

.reset-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Hide header content when form is visible */
.header-content.hidden {
  display: none;
}

.success-message {
  position: absolute;
  z-index: 100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.form-transition-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.form-transition-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.w-form-done {
  position: fixed;
  z-index: 999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  padding: 16px 24px;
  max-width: 300px;
  width: 90%;
  margin: 0 !important;
  display: none;
}

.success-light {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.placeholder-map {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
    height: 100%; 
    display: flex;
    align-items: center;
    justify-content: center;
}
  
.map-overlay {
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
z-index: 5;
}

.gradient-overlay {
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
object-fit: cover;
mix-blend-mode: screen;
opacity: 0.95;
filter: drop-shadow(0 0 10px rgba(215, 255, 82, 0.4));
pointer-events: none;
}

/* Address autocomplete dropdown */
.address-suggestions {
  position: absolute;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background-color: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  top: 100%;
  left: 0;
  margin-top: -1px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  display: none;
  pointer-events: auto;
}

.address-suggestions.visible {
  display: block;
}

/* Use actual buttons for suggestion items to ensure they're interactive */
.suggestion-item {
  background: none;
  border: none;
  width: 100%;
  padding: 12px 15px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.95);
  transition: background-color 0.2s ease;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  -webkit-user-select: none;
  user-select: none;
  display: block;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover, 
.suggestion-item.focused {
  background-color: rgba(215, 255, 82, 0.2);
  color: #fff;
}

/* Loading indicator */
.address-loading {
  position: absolute;
  right: 15px;
  top: 14px;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top: 2.5px solid #D7FF52;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
  z-index: 10;
}

.address-loading.visible {
  display: block;
}

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

/* Results section styles */
.loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.results-container {
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-top: 20px;
}

.results-table-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 20px 0;
}

.result-card {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.result-card h4 {
  padding: 16px 20px;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 18px;
  font-weight: 600;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-table tr:last-child {
  border-bottom: none;
}

.result-label, .result-value {
  padding: 12px 20px;
  text-align: left;
}

.result-label {
  width: 40%;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.result-value {
  width: 60%;
  color: #fff;
}

.results-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.results-note {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-style: italic;
}

.no-results {
  text-align: center;
  padding: 30px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

/* Keep the JSON results styles for potential debugging use */
.json-results {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  color: #fff;
  font-family: monospace;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.error-message {
  background-color: rgba(255, 75, 75, 0.1);
  border-left: 4px solid #ff4b4b;
  padding: 15px 20px;
  border-radius: 4px;
  margin-top: 20px;
}

.error-details {
  font-family: monospace;
  font-size: 0.9em;
  margin-top: 10px;
  opacity: 0.7;
}

/* Raw data toggle button */
.toggle-raw-button {
  margin-top: 15px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.toggle-raw-button:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Card navigation styles */
.card-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-button {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.2);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card-indicator {
  margin-top: 25px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
}

.cards-container {
  position: relative;
  min-height: 300px;
}

/* Recommendation card styles */
.recommendation-card {
  display: none;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.recommendation-card.active {
  display: block;
}

.card-title {
  padding: 18px 20px;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 20px;
  font-weight: 600;
  color: #D7FF52;
}

.card-content {
  padding: 0;
}

/* Section styles */
.card-section {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 12px 0;
}

/* Data table styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:last-child {
  border-bottom: none;
}

.data-table td {
  padding: 10px 0;
  text-align: left;
  color: rgba(255, 255, 255, 0.7);
}

.data-table td.value {
  text-align: right;
  color: #fff;
  font-family: "Britti Sans", "Inter", "Helvetica", sans-serif;
}

/* Positive/negative value styling */
.data-table td.value.positive {
  color: #83D01B;
}

.data-table td.value.negative {
  color: #ff6b6b;
}

.sidebar-toggle {
  display: none; /* Hide by default for desktop */
}

/* Mobile Responsive Styles */
@media screen and (max-width: 991px) {
  .form-container {
    margin: 20px auto 0;
    padding: 0 15px;
  }
  
  .form-layout {
    flex-direction: column;
    max-height: none;
  }
  
  /* Reorder content to put question content first */
  .form-content {
    order: 1;
    padding: 20px;
    min-height: auto;
  }
  
  /* Move sidebar to the bottom */
  .form-sidebar {
    order: 2;
    width: 100%;
    border-right: none;
    padding: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 60px; /* Show only toggle button initially */
    background-color: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
  }
  
  /* Add collapsible toggle for sidebar */
  .form-sidebar .sidebar-toggle {
    display: flex !important; /* Ensure this is active for mobile and overrides global hide */
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    cursor: pointer;
    position: relative;
  }
  
  .form-sidebar .sidebar-toggle:after { /* Ensure arrow styles are correctly selected */
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
    transform: rotate(45deg);
    position: absolute;
    right: 20px;
    transition: transform 0.2s ease;
  }
  
  .form-sidebar.expanded {
    max-height: 400px;
  }
  
  .form-sidebar.expanded .sidebar-toggle:after {
    transform: rotate(-135deg);
  }
  
  .question-list {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    overflow-y: auto;
    max-height: 340px; /* Ensure the list doesn't get too long */
  }
  
  .question-item {
    margin-bottom: 5px;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: none;
  }
  
  .question-item.active {
    border-left: none;
    background-color: rgba(215, 255, 82, 0.2);
  }
  
  .sidebar-divider {
    display: none;
  }
  
  .question-section {
    padding: 20px 0;
  }
  
  .question-heading {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .question-description {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .options-container {
    margin-bottom: 30px;
    gap: 10px;
  }
  
  .option-button {
    max-width: calc(50% - 5px);
    min-height: 100px;
    padding: 15px 10px;
  }
  
  .option-image {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
  }
  
  .option-label {
    font-size: 14px;
  }
  
  .map-preview {
    height: 200px;
  }
  
  .form-navigation {
    margin-top: 20px;
  }
  
  .back-button, .next-button, .calculate-button, .reset-button {
    margin-top: 15px;
    padding: 10px 16px;
    font-size: 15px;
  }
  
  .calculate-button {
    padding: 12px 20px;
  }
  
  /* Results section mobile styles */
  .results-container {
    padding: 15px;
  }
  
  .card-title {
    font-size: 18px;
    padding: 15px;
  }
  
  .card-section {
    padding: 12px 15px;
  }
  
  .section-title {
    font-size: 15px;
  }
  
  .data-table td {
    padding: 8px 0;
    font-size: 14px;
  }
  
  .card-navigation {
    flex-wrap: wrap;
  }
  
  .card-indicator {
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    margin-top: 0;
  }
  
  /* Current question indicator in mobile toggle */
  .sidebar-current-question {
    font-weight: 600;
    margin-left: 10px;
    color: #D7FF52;
  }
}

@media screen and (max-width: 767px) {
  .form-container {
    padding: 0 10px;
  }
  
  .question-item {
    font-size: 14px;
  }
  
  .question-number {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  
  .option-button {
    max-width: 100%;
    margin-bottom: 10px;
  }
  
  .back-button, .next-button, .calculate-button, .reset-button {
    padding: 12px 16px;
    width: 45%;
  }
  
  .form-navigation {
    justify-content: space-between;
  }
  
  /* Card navigation on smaller screens */
  .nav-button {
    padding: 8px 12px;
    font-size: 14px;
  }
}

@media screen and (max-width: 479px) {
  .form-container {
    margin: 10px auto 0;
  }
  
  .form-content {
    padding: 15px;
  }
  
  .question-section {
    padding: 15px 0;
  }
  
  .question-heading {
    font-size: 18px;
  }
  
  .question-description {
    font-size: 13px;
  }
  
  .option-button {
    min-height: 80px;
    padding: 12px 8px;
  }
  
  .option-image {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
  }
  
  .option-label {
    font-size: 13px;
  }
  
  .back-button, .next-button, .calculate-button, .reset-button {
    font-size: 14px;
    padding: 10px 14px;
  }
  
  /* Further reduce card padding */
  .card-section {
    padding: 10px 12px;
  }
  
  .section-title {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .data-table td {
    padding: 6px 0;
    font-size: 13px;
  }
}

/* Special mobile orientation for hot water system question which has 6 options */
@media screen and (max-width: 767px) {
  .question-section[data-question="7"] .option-button {
    max-width: calc(50% - 5px);
  }
}

/* Safari specific fix for scrolling */
@media not all and (min-resolution:.001dpcm) { 
  @supports (-webkit-appearance:none) {
    .question-list {
      -webkit-overflow-scrolling: touch;
    }
  }
}