/* Meine Teile Seite - Styles */

/* Hauptcontainer */
main {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

main h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 24px;
  text-align: center;
}

/* Grid-Container für Teile */
#partsList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* Einzelne Teil-Karte */
.part {
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #ddd;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.part:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

/* Bilder in Teil-Karten */
.part img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  background: #f0f0f0;
  margin-bottom: 8px;
}

/* Titel in Teil-Karten */
.part h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Beschreibung und andere Texte */
.part p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 6px;
}

.part p strong {
  color: #333;
  font-weight: 600;
}

/* Spezielle Styles für Preis */
.part p:has(strong:contains("Preis")) strong {
  color: #28a745;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Aktions-Buttons Container */
.part-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

/* Button-Styles */
.part-actions button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Bearbeiten-Button */
.part-actions button:first-child {
  background-color: #007bff;
  color: white;
}

.part-actions button:first-child:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

/* Löschen-Button */
.part-actions button:last-child {
  background-color: #dc3545;
  color: white;
}

.part-actions button:last-child:hover {
  background-color: #c82333;
  transform: translateY(-1px);
}

/* Lade-, Fehler- und Leere-Zustände */
.loading-state, .error-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 16px;
  border: 1px solid #ddd;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
}

.loading-state {
  color: #666;
  font-size: 1.1rem;
}

.error-state {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
  font-size: 1.1rem;
}

.empty-state {
  background: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    padding: 16px;
  }
  
  main h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }
  
  #partsList {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .part {
    padding: 16px;
  }
  
  .part img {
    height: 160px;
  }
  
  .part-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .part-actions button {
    padding: 12px 16px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 12px;
  }
  
  .part {
    padding: 12px;
  }
  
  .part img {
    height: 140px;
  }
  
  .part h3 {
    font-size: 1.1rem;
  }
  
  .part p {
    font-size: 0.85rem;
  }
}