/* TODO: Move to tailwind */
.registry-container {
  padding: 1rem;
}

.registry-header {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.registry-header h2 {
  margin-bottom: 8px;
}

.registry-header p {
  color: var(--text-secondary, #666);
}

.search-container {
  margin: 1.5rem 0;
}

.search-section {
  margin: 1.5rem 0;
  width: 100%;
  box-sizing: border-box;
}

.search-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  font-size: 1rem;
  box-sizing: border-box;
}

.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  background: var(--button-bg, #ffffff);
  color: var(--text-primary, #2c2c2c);
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .page-info {
  color: var(--text-secondary, #666);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .registry-container {
    --text-primary: #ffffff;
    --text-secondary: #aaa;
    --border-color: #333;
    --input-bg: #1f1f1f;
    --button-bg: #1f1f1f;
    --focus-color: #4a7dea;
  }

  .search-input {
    background-color: var(--input-bg);
    color: var(--text-primary);
  }

  .pagination button {
    background-color: var(--button-bg);
    color: var(--text-primary);
  }
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  background-color: white;
}

.app-card:hover {
  transform: translateY(-4px);
}

.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  font-size: 3rem;
  font-weight: bold;
}

.app-details {
  padding: 1.25rem;
  flex-grow: 1;
}

.app-details h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.app-author {
  color: #6c757d;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.app-description {
  color: #495057;
  font-size: 0.9rem;
}

.app-actions {
  padding: 1.25rem;
  border-top: 1px solid #f1f3f5;
  background-color: #f8f9fa;
}

.install-button {
  width: 100%;
  padding: 0.75rem;
  border-radius: 4px;
  border: none;
  background-color: #007bff;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.install-button:hover:not(:disabled) {
  background-color: #0069d9;
}

.install-button.installed {
  background-color: #28a745;
  cursor: default;
}

.install-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loading-state {
  margin: 2rem 0;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

.empty-state {
  margin: 3rem 0;
  text-align: center;
  padding: 2rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px dashed #dee2e6;
}

.tools-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: white;
}

.tool-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.tool-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tool-info {
  flex: 1;
}

.tool-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tool-name {
  margin: 0;
  font-size: 1.25rem;
}

.tool-metadata {
  display: flex;
  align-items: center;
  margin-left: 1rem;
}

.runner-icon {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
}

.runner-icon.unknown {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: #f0f0f0;
  border-radius: 50%;
  font-size: 14px;
  color: #666;
}

.tool-description {
  margin: 0 0 0.75rem 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.tool-publisher {
  font-size: 0.85rem;
  color: #6c757d;
}

.publisher-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.publisher-link:hover {
  text-decoration: underline;
}

.tool-action {
  margin-left: 1.5rem;
}

.install-button {
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  border: none;
  background-color: #007bff;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-width: 100px;
}

.install-button:hover:not(:disabled) {
  background-color: #0069d9;
}

.install-button.installed {
  background-color: #28a745;
  cursor: default;
}

.install-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tool-action .uninstall-button {
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  border: 1px solid #dc3545;
  background-color: white;
  color: #dc3545;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.tool-action .uninstall-button:hover {
  background-color: #dc3545;
  color: white;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .registry-container {
    --text-primary: #ffffff;
    --text-secondary: #aaa;
    --border-color: #333;
    --input-bg: #1f1f1f;
    --button-bg: #1f1f1f;
    --focus-color: #4a7dea;
  }

  .tool-item {
    background-color: #1f1f1f;
  }
  .tools-list {
    background-color: #1f1f1f;
  }
  .tool-name {
    color: #ffffff;
  }

  .tool-description {
    color: #aaaaaa;
  }

  .tool-publisher {
    color: #aaaaaa;
  }

  .publisher-link {
    color: #4a9eff;
  }

  .runner-icon.unknown {
    background-color: #333333;
    color: #aaaaaa;
  }

  .tool-action .uninstall-button {
    background-color: #1f1f1f;
    border-color: #ff6b6b;
    color: #ff6b6b;
  }

  .tool-action .uninstall-button:hover {
    background-color: #ff6b6b;
    color: #1f1f1f;
  }
}
