/* Modal overflow and message positioning fixes */

/* Submit button shadow enhancement for modal forms */
.modal-content .submit-button:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Ensure modal content is scrollable when it overflows */
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Keep form block from growing beyond container */
.modal-content .form-block {
  flex-shrink: 0;
}

/* Position success and error messages properly */
.modal-content .success-message,
.modal-content .error-message {
  position: relative;
  margin-top: 1.5em;
  z-index: 10;
  flex-shrink: 0;
}

/* Ensure messages are visible and not behind button */
.modal-content .w-form {
  position: relative;
}

/* Add some bottom padding to modal content to prevent cutoff */
.modal-content {
  padding-bottom: 2em !important;
}

/* Mobile optimizations for smaller viewports */
@media screen and (max-height: 700px) {
  .modal-content {
    max-height: 95vh;
  }
  
  .modal-content .textarea {
    height: 80px !important;
    min-height: 80px !important;
  }
  
  .modal-header h2 {
    margin-bottom: 0.5em;
  }
}

/* Very short viewports */
@media screen and (max-height: 600px) {
  .modal-content {
    max-height: 98vh;
    padding-top: 1.5em !important;
    padding-bottom: 1.5em !important;
  }
  
  .modal-content .textarea {
    height: 60px !important;
    min-height: 60px !important;
  }
  
  .modal-header {
    margin-bottom: 0.5em;
  }
  
  .modal-header h2 {
    font-size: 1.6em !important;
    margin-bottom: 0.25em;
  }
  
  .field-block {
    margin-bottom: 1em;
  }
}

/* Smooth scrolling for modal */
.modal-content {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar while keeping scroll functionality */
.modal-content {
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.modal-content::-webkit-scrollbar {
  display: none;
}

/* Normalize button sizes on webdev and marketing hero sections */
.page-webdev .block-buttons-hero .button.large,
.page-marketing .block-buttons-hero .button.large {
  padding: 1em 2em;
  font-size: 1rem;
}

.page-webdev .block-buttons-hero .button.large .button-text,
.page-marketing .block-buttons-hero .button.large .button-text {
  font-size: 1rem;
}
