:root {
  --txbus-primary: var(--e-global-color-primary, #0a5ea8);
  --txbus-secondary: #f8f9fa;
  --txbus-border: #ddd;
  --txbus-text: #333;
  --txbus-error: #dc3545;
  --txbus-success: #28a745;
}

#txbus-quote {
  max-width: 700px;
  margin-inline: auto;
  font-family: inherit;
  font-size: 16px;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#txbus-quote h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--txbus-primary);
  border-bottom: 2px solid var(--txbus-primary);
  padding-bottom: 0.5rem;
}

#txbus-quote .form-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

#txbus-quote .form-row.single {
  flex-direction: column;
}

#txbus-quote .form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#txbus-quote label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--txbus-text);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#txbus-quote input,
#txbus-quote select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--txbus-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#txbus-quote input:focus,
#txbus-quote select:focus {
  outline: none;
  border-color: var(--txbus-primary);
  box-shadow: 0 0 0 3px rgba(10, 94, 168, 0.1);
}

#txbus-quote input:read-only {
  background-color: var(--txbus-secondary);
  cursor: not-allowed;
  color: #666;
}

#txbus-quote .button-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

#txbus-quote button {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

#txbus-quote .btn-primary {
  background: var(--txbus-primary);
  color: #fff;
}

#txbus-quote .btn-primary:hover {
  background: #094a8a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 94, 168, 0.3);
}

#txbus-quote .btn-secondary {
  background: #6c757d;
  color: #fff;
}

#txbus-quote .btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

#txbus-quote button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

#txbus-quote .results {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--txbus-secondary);
  border-radius: 6px;
  border-left: 4px solid var(--txbus-primary);
}

#txbus-quote .results h3 {
  margin-top: 0;
  color: var(--txbus-primary);
  font-size: 1.25rem;
}

#txbus-quote .results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

#txbus-quote .result-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
}

#txbus-quote .result-item:last-child {
  border-bottom: none;
}

#txbus-quote .result-label {
  font-weight: 600;
  color: var(--txbus-text);
}

#txbus-quote .result-value {
  color: var(--txbus-primary);
  font-weight: 500;
}

#txbus-quote .error {
  background: #f8d7da;
  color: var(--txbus-error);
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid var(--txbus-error);
  margin-top: 1rem;
}

#txbus-quote .loading {
  text-align: center;
  padding: 2rem;
  color: var(--txbus-primary);
}

#txbus-quote .loading:after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--txbus-primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

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

/* Responsive design */
@media (max-width: 768px) {
  #txbus-quote .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  #txbus-quote .button-group {
    flex-direction: column;
    align-items: center;
  }
  
  #txbus-quote button {
    width: 100%;
    max-width: 300px;
  }
  
  #txbus-quote .results-grid {
    grid-template-columns: 1fr;
  }
}

/* Google Places Autocomplete styling */
.pac-container {
  border-radius: 6px;
  border: 1px solid var(--txbus-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-family: inherit;
}

.pac-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.pac-item:hover {
  background-color: var(--txbus-secondary);
}

.pac-item-selected {
  background-color: var(--txbus-primary);
  color: white;
}

/* Pricing Section Styles */
#txbus-quote #pricing-section {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--txbus-secondary);
  border-radius: 8px;
  border: 2px solid var(--txbus-border);
}

#txbus-quote #pricing-section h3 {
  color: var(--txbus-primary);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  border-bottom: 2px solid var(--txbus-primary);
  padding-bottom: 0.5rem;
}

/* Blurred field styles - for pricing summary fields and estimate display */
#txbus-quote .pricing-summary .blurred-text,
#txbus-quote .estimate-display.blurred-text,
#txbus-quote .blurred-field {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.3s ease;
}

#txbus-quote .blurred-field {
  background-color: #f0f0f0;
  color: #999;
}

/* Ensure address inputs are always interactive */
#txbus-quote input#origin,
#txbus-quote input#destination {
  pointer-events: auto !important;
  filter: none !important;
  background-color: white !important;
  color: var(--txbus-text) !important;
}

/* Pricing Summary Styles */
#txbus-quote .pricing-summary {
  margin-top: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--txbus-border);
}

#txbus-quote .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

#txbus-quote .summary-row:last-child {
  border-bottom: none;
}

#txbus-quote .summary-row.total-row {
  border-top: 2px solid var(--txbus-primary);
  margin-top: 1rem;
  padding-top: 1rem;
  font-weight: 600;
}

#txbus-quote .summary-label {
  font-weight: 500;
  color: var(--txbus-text);
  flex: 1;
}

#txbus-quote .summary-value {
  font-weight: 600;
  color: var(--txbus-primary);
  text-align: right;
  min-width: 100px;
}

#txbus-quote .total-row .summary-value {
  font-size: 1.1rem;
  color: var(--txbus-primary);
}

/* Contact Section Styles */
#txbus-quote .contact-section {
  margin-top: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  border: 2px solid var(--txbus-primary);
}

#txbus-quote .contact-section h3 {
  color: var(--txbus-primary);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Enhanced responsive design */
@media (max-width: 768px) {
  #txbus-quote #pricing-section,
  #txbus-quote .contact-section {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  #txbus-quote .summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  #txbus-quote .summary-value {
    text-align: left;
    min-width: auto;
  }
}

/* Animation for revealing estimates */
#txbus-quote .reveal-animation {
  animation: reveal 0.5s ease-in-out;
}

@keyframes reveal {
  from {
    filter: blur(4px);
    opacity: 0.7;
  }
  to {
    filter: blur(0);
    opacity: 1;
  }
}

/* Contact Popup Styles */
#contact-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

#contact-popup .popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#contact-popup .popup-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: popupSlideIn 0.3s ease-out;
}

#contact-popup h3 {
  color: var(--txbus-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

#contact-popup p {
  margin-bottom: 1rem;
  color: #666;
  line-height: 1.5;
}

#contact-popup .contact-info {
  background: var(--txbus-secondary);
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  border-left: 4px solid var(--txbus-primary);
}

#contact-popup .contact-info strong {
  color: var(--txbus-primary);
  font-size: 1.2rem;
}

#contact-popup .btn-primary {
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  background: var(--txbus-primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.3s ease;
}

#contact-popup .btn-primary:hover {
  background: #094a8a;
}

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

/* Estimate Display */
.estimate-display {
  text-align: center;
  padding: 30px;
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  margin: 20px 0;
}

.estimate-display h3 {
  font-size: 24px;
  color: #333;
  margin: 0 0 10px 0;
  font-weight: bold;
}

.estimate-subtitle {
  color: #666;
  margin: 0 0 20px 0;
  font-size: 14px;
}

.main-estimate {
  font-size: 48px;
  font-weight: bold;
  color: #2563eb;
  margin: 20px 0;
}

.estimate-disclaimer {
  color: #666;
  font-size: 13px;
  margin: 20px 0 30px 0;
  line-height: 1.4;
}

.range-values {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin: 30px 0;
}

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

.range-item .amount {
  display: block;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
}

.range-item.low .amount {
  color: #22c55e;
}

.range-item.mid .amount {
  color: #f59e0b;
}

.range-item.high .amount {
  color: #ef4444;
}

.range-item .label {
  display: block;
  font-size: 14px;
  color: #666;
}

.email-quote-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: background-color 0.2s;
}

.email-quote-btn:hover {
  background: #1d4ed8;
}

/* Info Icon Styles */
#txbus-quote .info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  color: #6c757d;
  transition: color 0.2s ease;
  position: relative;
}

#txbus-quote .info-icon:hover {
  color: var(--txbus-primary);
}

#txbus-quote .info-icon svg {
  width: 16px;
  height: 16px;
}

/* Tooltip Styles */
#txbus-quote .info-icon[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #333;
  color: white;
  font-size: 13px;
  font-weight: normal;
  border-radius: 6px;
  white-space: normal;
  width: 250px;
  max-width: 90vw;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  line-height: 1.4;
  text-align: left;
}

#txbus-quote .info-icon[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 3px;
  border: 5px solid transparent;
  border-top-color: #333;
  z-index: 1001;
}

/* Mobile adjustments for tooltip */
@media (max-width: 768px) {
  #txbus-quote .info-icon[title]:hover::after {
    left: auto;
    right: -10px;
    transform: none;
    width: 200px;
  }
  
  #txbus-quote .info-icon[title]:hover::before {
    left: auto;
    right: 15px;
    transform: none;
  }
}

/* Info icon with tooltip - New styles for updated markup */
.txbus-quote-form label.with-info-icon {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.txbus-quote-form label.with-info-icon input {
    width: 100%;
    margin-top: 5px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    cursor: help;
    color: #666;
    transition: color 0.2s;
}

.info-icon:hover,
.info-icon:focus {
    color: #0073e6;
    outline: none;
}

.info-icon svg {
    width: 16px;
    height: 16px;
}

.info-icon .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #333;
    color: white;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: normal;
    width: 200px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}

.info-icon .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.info-icon:hover .tooltip,
.info-icon:focus .tooltip,
.info-icon:focus-within .tooltip {
    opacity: 1;
    visibility: visible;
}
