/* General styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 5px;
  color: #172B4D;
  background-color: #f4f5f7;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#header {
  flex-shrink: 0;
}

/* Reduce margins for the banner */
.premium-banner {
  margin-bottom: 5px !important;
  padding: 5px !important;
}

/* Button row */
#button-row {
  display: flex;
  margin-bottom: 5px;
  flex-shrink: 0;
}

/* Grid styles */
.grid-container {
  margin-top: 5px;
  border: 1px solid #DFE1E6;
  border-radius: 3px;
  overflow: auto;
  flex: 1;
}

table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  background-color: white;
  table-layout: fixed;
  font-size: 13px;
}

th, td {
  border: 1px solid #DFE1E6;
  padding: 4px 6px;
  text-align: left;
  min-width: 120px; /* Minimum width for all columns */
  max-width: 300px; /* Maximum width for all columns */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: auto; /* Do not allow width to change based on content */
}

/* Special case for checkbox column */
th.checkbox-cell, td.checkbox-cell {
  min-width: 30px;
  max-width: 30px;
  width: 30px;
  padding: 2px;
}

th {
  background-color: #F4F5F7;
  position: sticky;
  top: 0;
  z-index: 10;
}

tr:hover {
  background-color: #F4F5F7;
}

/* Button styles */
.btn {
  background-color: #0079BF;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
}

.btn:hover {
  background-color: #026AA7;
}

.btn-secondary {
  background-color: #EDDBF4;
  color: #42526E;
}

.btn-secondary:hover {
  background-color: #DFC5E8;
}

/* Form styles */
.form-container {
  background-color: white;
  border-radius: 3px;
  padding: 20px;
  margin-top: 20px;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* Checkbox and label alignment */
label input[type="checkbox"] {
  vertical-align: middle;
  margin-right: 8px;
  width: auto;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #DFE1E6;
  border-radius: 3px;
}

/* Utility classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* Progress indicator */
.progress-bar {
  height: 6px;
  background-color: #DEEBFF;
  width: 100%;
  border-radius: 3px;
  margin: 10px 0;
}

.progress-value {
  height: 100%;
  background-color: #0079BF;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Overlay and modal */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background-color: white;
  border-radius: 3px;
  padding: 20px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Modal content container to enable proper scrolling */
.modal-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 10px;
}

/* Modal footer with sticky buttons */
.modal-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #F4F5F7;
}

.cancel-button {
  background-color: transparent;
  color: #5E6C84;
  border: none;
  padding: 8px 12px;
  border-radius: 3px;
  font-weight: bold;
  cursor: pointer;
}

.checkout-button {
  background-color: #0079BF;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 3px;
  font-weight: bold;
  cursor: pointer;
}

.checkout-button:hover {
  background-color: #026AA7;
}

.checkout-button:disabled {
  background-color: #97A0AF;
  cursor: not-allowed;
}

/* Preview and results sections */
#preview-section, #results-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#preview-content, #results-content {
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

/* Field rows container with specific max height */
#field-rows-container {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
}

/* Checkbox and selection styles */
.checkbox-cell {
  width: 30px;
  text-align: center;
}

.selected-row {
  background-color: #E4F0F6;
}

/* Column row styles */
.column-row {
  cursor: move;
  margin-bottom: 5px;
}

.column-row:hover {
  opacity: 0.9;
}

/* Add column menu */
.add-column-option:hover {
  background-color: #F4F5F7;
  border-radius: 3px;
}

/* Reduce heading size */
h1 {
  font-size: 18px;
  margin: 0 0 10px 0;
}

/* Field rows for the Azure DevOps style edit form */
.field-row {
  background-color: #f7f9fa;
  border-radius: 3px;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.field-row:hover,
.field-row:focus-within {
  z-index: 10;
}

#add-field-btn {
  background-color: #f7f9fa;
  border: 1px dashed #ccc;
  border-radius: 3px;
  transition: background-color 0.2s;
}

#add-field-btn:hover {
  background-color: #e9eef2;
}

/* Make sure dropdown menus appear below their triggers and have a scrollbar */
select {
  appearance: menulist !important; /* Force native dropdown appearance */
  direction: ltr !important; /* Ensure dropdown direction is standard */
  position: relative;
  z-index: 5;
}

/* Style for field select and other dropdowns */
.field-select, select.field-value {
  overflow-y: auto;
  max-height: 200px;
  background-position: right 8px center !important;
  background-repeat: no-repeat !important;
}

/* Fix for Edge and IE */
select::-ms-expand {
  display: block !important;
}

/* Ensure focus works properly */
select:focus {
  outline: none;
  border-color: #0079BF;
  box-shadow: 0 0 0 2px rgba(0, 121, 191, 0.2);
}

/* Browser-specific fixes for dropdowns */
@supports (-webkit-appearance: none) or (-moz-appearance: none) {
  select {
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
  }
  
  /* Specific Firefox fix */
  @-moz-document url-prefix() {
    select {
      text-indent: 0.01px;
      text-overflow: '';
      padding-right: 1em;
    }
  }
  
  /* Webkit browsers */
  @media screen and (-webkit-min-device-pixel-ratio:0) {
    select {
      padding-right: 18px;
    }
  }
}

/* Fix for label and member containers */
.field-value[data-field-id="labels"],
.field-value[data-field-id="labels-remove"],
.field-value[data-field-id="members"],
.field-value[data-field-id="members-remove"] {
  padding: 8px;
  background-color: white;
  border: 1px solid #DFE1E6;
  border-radius: 3px;
  max-height: 150px !important;
  overflow-y: auto !important;
}

/* Ensure checkbox containers stay visible */
.field-value div {
  position: relative;
  z-index: 1;
}

/* Fix for checkboxes in the label selection area */
.modal input[type="checkbox"] {
  z-index: 2;
  position: relative;
}

/* Subscription modal */
.subscription-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.subscription-container {
  background-color: white;
  border-radius: 3px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  max-height: 90vh;
  overflow-y: auto;
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.subscription-header h2 {
  margin: 0;
  font-size: 20px;
  color: #172B4D;
}

.subscription-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6B778C;
  padding: 0;
  line-height: 1;
}

.subscription-close:hover {
  color: #172B4D;
}

.subscription-plan {
  text-align: center;
  margin-bottom: 20px;
}

.subscription-price {
  font-size: 32px;
  font-weight: bold;
  color: #172B4D;
}

.subscription-price sup {
  font-size: 16px;
  font-weight: normal;
}

.subscription-features {
  margin-top: 20px;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  color: #172B4D;
}

.feature-item svg {
  margin-right: 10px;
  color: #61BD4F;
  flex-shrink: 0;
}

.subscription-button {
  display: block;
  width: 100%;
  padding: 10px;
  background-color: #61BD4F;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  text-align: center;
}

.subscription-button:hover {
  background-color: #5DAC44;
}

/* Order Summary Modal */
.order-summary {
  padding: 20px;
  border-bottom: 1px solid #DFE1E6;
}

.order-summary h3 {
  font-size: 18px;
  margin: 0 0 16px 0;
  color: #172B4D;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.summary-label {
  color: #172B4D;
  font-weight: 500;
}

.summary-value {
  color: #5E6C84;
}

/* Business Checkbox */
.business-checkbox {
  display: flex;
  align-items: center;
}

.business-checkbox input[type="checkbox"] {
  margin-right: 8px;
  width: auto;
}

.business-checkbox label {
  margin: 0;
  color: #172B4D;
  font-weight: normal;
  display: inline;
}

/* Subscription success/cancel pages */
.subscription-success,
.subscription-canceled {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f5f6f7;
  padding: 20px;
}

.success-container,
.canceled-container {
  max-width: 500px;
  width: 100%;
  padding: 30px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.success-icon,
.canceled-icon {
  margin-bottom: 20px;
}

.subscription-success h1,
.subscription-canceled h1 {
  font-size: 24px;
  color: #333;
  margin-bottom: 20px;
}

.subscription-success p,
.subscription-canceled p {
  font-size: 16px;
  color: #666;
  margin-bottom: 10px;
}

.actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.primary-button {
  background-color: #0079bf;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.primary-button:hover {
  background-color: #026aa7;
}

.secondary-button {
  background-color: transparent;
  color: #0079bf;
  border: 1px solid #0079bf;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.secondary-button:hover {
  background-color: rgba(0, 121, 191, 0.1);
}

/* Business info section */
.business-info {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 0;
  opacity: 0;
}

.business-info.visible {
  max-height: 1000px;
  margin-top: 20px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.form-field {
  margin-bottom: 15px;
  text-align: left;
}

.form-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #666;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

/* User account button and modal styles */
.top-right-controls {
  position: fixed;
  top: 8px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 200;
}

.feedback-link {
  padding: 3px 8px;
  border-radius: 3px;
  background-color: #DFE1E6;
  color: #172B4D;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
}

.feedback-link:hover {
  background-color: #C1C7D0;
  text-decoration: none;
  color: #172B4D;
}

.user-account-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #DFE1E6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  color: #172B4D;
  font-size: 16px;
  transition: background-color 0.2s;
}

.user-account-button:hover {
  background-color: #C1C7D0;
}

.user-account-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.user-account-container {
  background-color: white;
  border-radius: 3px;
  padding: 20px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  position: relative;
}

.user-account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #DFE1E6;
  padding-bottom: 10px;
}

.user-account-header h2 {
  margin: 0;
  font-size: 18px;
  color: #172B4D;
}

.user-info-section {
  margin-bottom: 20px;
}

.user-info-row {
  display: flex;
  margin-bottom: 10px;
}

.user-info-label {
  font-weight: bold;
  width: 120px;
  color: #6B778C;
}

.user-info-value {
  flex: 1;
  color: #172B4D;
}

.subscription-info-section {
  background-color: #F4F5F7;
  padding: 15px;
  border-radius: 3px;
  margin-bottom: 20px;
}

.subscription-info-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
  color: #172B4D;
}

.subscription-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font-weight: bold;
  margin-bottom: 15px;
}

.subscription-status.premium {
  background-color: #E3FCEF;
  color: #006644;
}

.subscription-status.premium-canceling {
  background-color: #FFE7DB;
  color: #974F0C;
}

.subscription-status.premium-payment-failed {
  background-color: #FFEBE6;
  color: #BF2600;
}

.subscription-status.free {
  background-color: #DEEBFF;
  color: #0052CC;
}

.subscription-action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.cancel-subscription-button {
  background-color: #FFEBE6;
  color: #BF2600;
  border: none;
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

.cancel-subscription-button:hover {
  background-color: #FFBDAD;
}

.update-payment-button {
  background-color: #0079BF;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

.update-payment-button:hover {
  background-color: #026AA7;
}

.upgrade-button {
  background-color: #E3FCEF;
  color: #006644;
  border: none;
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
}

.upgrade-button:hover {
  background-color: #ABF5D1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Profile icon in account button */
.profile-icon {
  width: 18px;
  height: 18px;
}

/* Payment Failed Banner */
.payment-failed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FFEBE6;
  color: #BF2600;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 3px;
  font-size: 14px;
}

.payment-failed-message {
  display: flex;
  align-items: center;
  gap: 10px;
}

.payment-failed-message svg {
  flex-shrink: 0;
}

.payment-failed-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dismiss-banner-button {
  background: none;
  border: none;
  color: #505F79;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.dismiss-banner-button:hover {
  color: #172B4D;
} 