:host {
  height: 100%;
}

.config-list-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.25rem;
  background-color: var(--gray-850);
  border-radius: 8px;
}

/* Search Input */
.search-input-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background-color: var(--gray-800);
  border: 1px solid var(--gray-750);
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.search-icon {
  color: var(--gray-500);
  margin-right: 0.75rem;
  font-size: 1.25rem;
  transition: color 0.2s ease;
}

.search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9375rem;
  color: var(--gray-200);
  width: 100%;
  transition: color 0.2s ease;
}

.search-input::placeholder {
  color: var(--gray-600);
}

.search-input-wrapper.input-has-content,
.search-input-wrapper:focus-within {
  border-color: var(--gray-600);
  box-shadow: 0 0 0 1px var(--gray-600), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-input-wrapper.input-has-content .search-icon,
.search-input-wrapper:focus-within .search-icon {
  color: var(--gray-600);
}

.search-input-wrapper.input-has-content .search-input,
.search-input-wrapper:focus-within .search-input {
  color: var(--white);
}

/* List Content Wrapper */
.list-content-wrapper {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.list-content-wrapper::-webkit-scrollbar {
  width: 6px;
}

.list-content-wrapper::-webkit-scrollbar-track {
  background: var(--gray-800);
  border-radius: 3px;
}

.list-content-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--gray-700);
  border-radius: 3px;
}

.list-content-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: var(--gray-600);
}

.no-configs-message {
  color: var(--gray-400);
  font-size: 0.9375rem;
  margin: 1.5rem 0;
  text-align: center;
  font-style: italic;
}

/* Config List */
.config-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.config-list li {
  display: flex;
  align-items: center;
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  border-left: 2px solid transparent;
  background-color: var(--gray-800);
  color: var(--gray-300);
  transition: all 0.2s ease-in-out;
}

.config-list li:hover {
  background-color: var(--gray-750);
  transform: translateX(2px);
}

.config-list li.selected {
  background-color: var(--gray-750);
  border-left: 2px solid var(--gray-600);
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.config-name {
  flex-grow: 1;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gray-200);
  padding-right: 0.5rem;
}

.delete-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  margin-left: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease-in-out;
}

.delete-button:hover {
  background-color: rgba(103, 103, 103, 0.2);
}

.delete-button i.material-icons {
  font-size: 1.125rem;
  color: var(--gray-500);
  transition: color 0.2s ease;
}

.delete-button:hover i.material-icons {
  color: var(--gray-400);
}

/* Create New Button */
.create-config-button {
  flex-shrink: 0;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--white);
  background-color: var(--gray-600);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.create-config-button:hover {
  background-color: var(--gray-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.create-config-button:active {
  background-color: var(--gray-750);
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.create-config-button:disabled {
  background-color: var(--gray-700);
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.create-config-button i.material-icons {
  font-size: 1.25rem;
}

/* Focus States for Accessibility */
.config-list li:focus,
.create-config-button:focus,
.delete-button:focus {
  outline: 2px solid var(--gray-600);
  outline-offset: 2px;
}

.config-list li:focus:not(:focus-visible),
.create-config-button:focus:not(:focus-visible),
.delete-button:focus:not(:focus-visible) {
  outline: none;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.config-list li {
  animation: fadeIn 0.2s ease-out;
  animation-fill-mode: both;
}

.config-list li:nth-child(1) {
  animation-delay: 0.05s;
}
.config-list li:nth-child(2) {
  animation-delay: 0.1s;
}
.config-list li:nth-child(3) {
  animation-delay: 0.15s;
}
.config-list li:nth-child(4) {
  animation-delay: 0.2s;
}
.config-list li:nth-child(5) {
  animation-delay: 0.25s;
}
