/* Animated card entrance */
.vehicle-selection-card {
  animation: slideInDown 0.8s ease-out;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header.success {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Card animations */
.card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
}

/* Parts table styles */
.parts-table {
  margin-bottom: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.parts-table thead th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
  padding: 1rem;
  border: none;
}

.parts-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
}

.parts-table-row {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.parts-table-row.visible {
  opacity: 1;
  transform: translateX(0);
}

.table-row-even {
  background-color: #ffffff;
}

.table-row-odd {
  background-color: #f8f9fa;
}

.parts-table-row:hover {
  background-color: rgba(102, 126, 234, 0.1) !important;
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.parts-table .badge {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
}

/* Form select styles */
.form-select {
  transition: all 0.3s ease;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
  transform: scale(1.02);
}

.form-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Parts section animation */
#partsSection {
  animation: fadeInUp 0.8s ease-out;
  margin-bottom: 4rem;
  padding-bottom: 2rem;
}

#partsSection .vehicle-selection-card {
  min-height: 500px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Parts search styles */
#partsSearchWrapper {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
  border-radius: 15px;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

#partsSearchWrapper .input-group {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#partsSearchWrapper .input-group:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.2);
}

#partsSearchWrapper .input-group:focus-within {
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
  border-color: #667eea;
  transform: translateY(-2px);
}

#partsSearchWrapper .input-group-text {
  border: none;
  background: transparent;
  color: #6c757d;
  padding: 0.75rem 1.25rem;
  font-size: 1.1rem;
}

#partsSearchWrapper .input-group-text i {
  transition: all 0.3s ease;
}

#partsSearchWrapper .input-group:focus-within .input-group-text i {
  color: #667eea;
  transform: scale(1.1);
}

#partsSearchInput {
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: #212529;
  transition: all 0.3s ease;
}

#partsSearchInput::placeholder {
  color: #adb5bd;
  font-weight: 400;
}

#partsSearchInput:focus {
  outline: none;
  box-shadow: none;
  background: transparent;
}

#clearSearchBtn {
  border: none;
  background: transparent;
  color: #adb5bd;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#clearSearchBtn:hover {
  background-color: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: scale(1.1);
}

#partsSearchWrapper .row:last-child {
  margin-top: 1rem;
}

#partsSearchWrapper small {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c757d;
  font-size: 0.875rem;
  letter-spacing: 0.3px;
}

#partsCount {
  color: #667eea;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Autocomplete styles */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

#categoryAutocomplete {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  background: white;
  width: 100%;
}

#categoryAutocomplete:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
  outline: none;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 340px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 10px;
  z-index: 1000;
  display: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  margin-top: 2px;
}

.autocomplete-dropdown.show {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  font-weight: 500;
  color: #495057;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: #667eea;
  transform: translateX(5px);
}

.autocomplete-item.main-category {
  font-weight: 600;
  color: #212529;
  background: #f8f9fa;
}

.autocomplete-item.main-category:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.autocomplete-item.sub-category {
  padding-left: 2rem;
  font-weight: 400;
  color: #6c757d;
  font-size: 0.95rem;
}

.autocomplete-item.sub-category:hover {
  padding-left: 2.5rem;
}

.autocomplete-item i {
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.autocomplete-dropdown::-webkit-scrollbar {
  width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 10px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .form-select-lg {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
  }

  .parts-table-row {
    animation: slideInLeft 0.4s ease-out forwards;
  }

  @keyframes slideInLeft {
    from {
      opacity: 0;
      transform: translateX(-20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .parts-table {
    font-size: 0.9rem;
  }

  .parts-table thead th {
    font-size: 0.8rem;
    padding: 0.75rem;
  }

  .parts-table tbody td {
    padding: 0.75rem;
  }
}

/* Global loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 2000;
}

.loading-overlay .spinner {
  width: 56px;
  height: 56px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-overlay .loading-text {
  color: #ffffff;
  margin-top: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.loading {
  cursor: progress;
}

