@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

body {
  background: #1e1e2f;
  color: white;
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 20px;
}

h1, h2 {
  text-align: center;
  font-weight: 700;
  letter-spacing: 1px;
}

#formation-selection, #team-name-section, #search-section {
  margin: 25px auto;
  text-align: center;
}

label {
  font-weight: 600;
  font-size: 18px;
  margin-right: 10px;
  vertical-align: middle;
}

input[type="text"], select {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  padding: 12px 20px;
  border: 2px solid #555;
  border-radius: 8px;
  background-color: #2a2a3d;
  color: white;
  outline: none;
  transition: all 0.3s ease;
  vertical-align: middle;
}

input[type="text"]:focus, select:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  background-color: #33334d;
}

#search-item {
  width: 400px;
  font-size: 18px;
  padding: 15px 25px;
  border-radius: 25px;
}

#team-name {
  width: 300px;
}

#formation {
  cursor: pointer;
  padding: 12px 15px;
}

input::placeholder {
  color: #aaa;
  font-style: italic;
}

#team-layout {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
  margin: 30px auto 0;
  width: fit-content;
}

.right-side-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#relic-slot {
  width: 140px;
  height: 140px;
  border: 2px dashed #ffcc00;
  background-color: #2a2a3d;
  border-radius: 8px;
  position: relative; 
  align-self: flex-start;
}

#team-grid {
  position: relative;
  width: 900px;
  height: 700px;
  background-color: #2a2a3d;
  border: 2px solid #555;
  border-radius: 12px;
}

.grid-slot {
  width: 140px;
  height: 210px; 
  border: 2px dashed #aaa;
  background: #2a2a3d;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  position: absolute;
}

.artifact-slot {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 70px;
  height: 70px;
  border: 2px dashed #ff5555;
  background: #1e1e2f;
  border-radius: 50%;
  z-index: 10;
}

.img-wrapper {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  z-index: 1; 
  display: flex; /* Zentrierung für das Bild */
  justify-content: center;
  align-items: center;
}

.artifact-slot .img-wrapper {
  border-radius: 50%;
}

.hero-image, .relic-image, .artifact-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image {
  object-position: top center; 
  transform: scale(1.12); 
}
.relic-image {
  transform: scale(1.12);
}
.artifact-image {
  transform: scale(1.15);
}

.artifact-name {
  position: absolute;
  bottom: 75px; 
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #ddd;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 1px 1px 3px #000;
  z-index: 11;
}

.slot-name {
  position: absolute;
  bottom: -25px;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: #ddd;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 1px 1px 3px #000;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
}

.action-buttons-bottom {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.action-btn {
  padding: 12px 20px;
  background-color: #333;
  color: white;
  border: 2px solid #555;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background-color: #444;
  border-color: #00f0ff;
}

.saved-teams-controls {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 40px;
  margin-bottom: 20px;
}

.tab-button {
  padding: 10px 25px;
  background-color: #333;
  color: white;
  border: 2px solid #555;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.tab-button:hover {
  background-color: #444;
  border-color: #00f0ff;
}

.tab-button.active {
  background-color: #00f0ff;
  color: #000;
  border-color: #00f0ff;
}

.selection-container {
  display: none; 
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 40px;
}

.selection-container.active-tab {
  display: flex; 
}

.item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: slideIn 0.5s forwards;
}

.item-card:hover {
  transform: scale(1.1);
}

.item-icon {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center 10%; 
  border-radius: 50%;
  border: 2px solid #555;
  transition: border-color 0.3s ease;
}

.item-card.selected .item-icon, 
.item-card:hover .item-icon {
  border-color: #00f0ff;
}

.item-name-label {
  margin-top: 8px;
  font-size: 15px;
  color: #ddd;
  text-align: center;
  font-weight: bold;
}

#autocomplete-list {
  position: absolute;
  background: #333;
  border: 1px solid #555;
  border-radius: 8px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  width: 400px;
  margin: 5px auto 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.autocomplete-item img {
  width: 35px;
  height: 35px;
  object-fit: cover;
  object-position: center 10%;
  border-radius: 50%;
  margin-right: 15px;
}

.autocomplete-item:hover {
  background-color: #444;
}

.flex-column {
  flex-direction: column;
  align-items: center;
}

#search-saved-teams {
  width: 500px;
  margin-bottom: 20px;
}

#saved-teams-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  width: 100%;
}

.saved-team-card {
  background-color: #2a2a3d;
  border: 2px solid #555;
  border-radius: 12px;
  padding: 15px;
  width: 300px;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.saved-team-card:hover {
  transform: translateY(-5px);
  border-color: #00f0ff;
}

.saved-team-title {
  font-size: 18px;
  font-weight: bold;
  color: #00f0ff;
  margin-bottom: 5px;
  text-align: center;
}

.saved-team-formation {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 15px;
  text-align: center;
}

.saved-team-preview {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.mini-hero-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 10%;
  border: 2px solid #555;
}

.mini-hero-empty {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px dashed #555;
  background-color: #1e1e2f;
}

/* Verschleierte Bezeichnungen für die Löschfunktion */
.btn-rem {
  display: none; 
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ff4444;
  color: white;
  border: none;
  border-radius: 5px;
  width: 25px;
  height: 25px;
  font-weight: bold;
  cursor: pointer;
  z-index: 20;
  transition: background-color 0.2s;
}

.btn-rem:hover {
  background-color: #cc0000;
}

#saved-teams-list.m-edit .btn-rem {
  display: block;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}