/**
 * Custom CSS for Car Rental Form - Price Display
 * Clean, modern card design for price information
 */

/* Style the container as an elegant info card */
.form-item-car-price {
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0 2rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Add a subtle green accent bar on the left */
.form-item-car-price::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #66cc00 0%, #52a300 100%);
}

/* Add a label/icon header */
.form-item-car-price::after {
  content: "💰 Mietkosten";
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #66cc00;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
}

/* Hide the default label since we're using ::after */
.form-item-car-price > label {
  display: none;
}

/* The price input - styled as display text */
.js-CarPrice,
input.js-CarPrice,
.FskInput.js-CarPrice {
  /* Remove all input styling */
  border: none !important;
  background: none !important;
  padding: 0 0 0 1rem !important;
  margin: 0 !important;
  
  /* Typography - Clear and prominent but not overwhelming */
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: #1a1a1a !important;
  text-align: left !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  
  /* Remove editable appearance */
  cursor: default !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  
  /* Remove any browser defaults */
  box-shadow: none !important;
  outline: none !important;
  min-height: auto !important;
  width: auto !important;
  display: inline-block !important;
}

/* Remove all interaction states */
.js-CarPrice:focus,
.js-CarPrice:hover,
input.js-CarPrice:focus,
input.js-CarPrice:hover {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: none !important;
}

/* Description text - helpful info below price */
.form-item-car-price .description {
  margin-top: 1rem;
  padding-top: 1rem;
  padding-left: 1rem;
  border-top: 1px solid #e8e8e8;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.6;
}

/* Add a subtle hover effect for the whole card */
.form-item-car-price:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #66cc00;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .form-item-car-price {
    padding: 2rem;
  }
  
  .js-CarPrice,
  input.js-CarPrice,
  .FskInput.js-CarPrice {
    font-size: 2rem !important;
  }
  
  .form-item-car-price .description {
    font-size: 0.9rem;
  }
}

/* Optional: Make it stand out more on mobile */
@media (max-width: 767px) {
  .form-item-car-price {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* Style the parent fieldset for better visual hierarchy */
fieldset[data-drupal-selector*="donate-fieldset"] .form-item-car-price {
  margin-top: 0;
}

/* Add some breathing room */
.form-item-car-price + * {
  margin-top: 2rem;
}

/* Rental benefits styling - reassuring info in one row */
.rental-benefits {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #2d6d2e;
  background-color: #f0f9f0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid #66cc00;
  border-radius: 4px;
  margin: 1rem 0 0.5rem 0;
  font-weight: 500;
  display: flex;
  justify-content: space-between; /* Spread items across full width */
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.rental-benefits span {
  display: inline-block;
  white-space: nowrap;
  flex: 0 1 auto;
}

.rental-benefits br {
  display: none; /* Hide line breaks to keep everything in one row */
}

/* Trust message below benefits */
.rental-trust {
  font-size: 0.95rem;
  color: #1a5a1b;
  text-align: center;
  margin: 0.5rem 0 1.5rem 0;
  font-weight: 600;
  font-style: italic;
}

@media (min-width: 768px) {
  .rental-benefits {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
  }
  
  .rental-trust {
    font-size: 1rem;
  }
}

@media (max-width: 1200px) {
  /* Stack in 2 rows if screen not wide enough for 4 items */
  .rental-benefits {
    gap: 0.75rem 1rem;
  }
}

@media (max-width: 767px) {
  .rental-benefits {
    font-size: 1rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start; /* Reset to normal stacking on mobile */
    gap: 0.5rem;
  }
  
  .rental-benefits span {
    white-space: normal;
  }
  
  .rental-benefits br {
    display: block; /* Show line breaks on mobile for better readability */
  }
  
  .rental-trust {
    font-size: 0.9rem;
  }
}

/* Fix alignment for rental period fields - remove ALL top spacing and borders */
#edit-gift-donation-steps--wrapper > .LayoutFieldset:first-child {
  border-top: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

#edit-gift-donation-step-1.LayoutFieldset-fieldset {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#edit-gift-donation-step-1 .LayoutFieldset-legend {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

#edit-gift-donation-step-1 .LayoutFieldset-wrapper {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Also target by class in case ID doesn't work */
.js-webform-type-donate-fieldset:first-of-type {
  border-top: none !important;
  padding-top: 0 !important;
}

.js-webform-type-donate-fieldset:first-of-type .LayoutFieldset-wrapper {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Car name styling under each thumbnail */
.Motive-variantName {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  padding-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

/* Add padding to label to give space for the border */
.Motive-label {
  padding-bottom: 0.75rem;
}

/* Style when the variant is selected */
.Motive-radio:checked + .Motive-label .Motive-variantName {
  color: #66cc00;
  font-weight: 700;
}

/* Hover effect */
.Motive-label:hover .Motive-variantName {
  color: #52a300;
}

/* Mobile optimization for preview car image */
@media (max-width: 767px) {
  /* Make preview container centered and limit width */
  .Motive-preview {
    max-width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  /* Limit preview image size on mobile */
  .Motive-preview .Motive-image.js-Motive-previewImage {
    max-width: 90%;
    width: auto !important;
    height: auto !important;
    max-height: 280px;
    object-fit: contain;
    margin: 0 auto;
  }
  
  /* Center the price display */
  .Motive-previewPrice {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
  }
}

/* Tablet optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .Motive-preview .Motive-image.js-Motive-previewImage {
    max-width: 85%;
    height: auto !important;
    margin: 0 auto;
  }
}
